Loading Android.bp +22 −0 Original line number Diff line number Diff line Loading @@ -362,3 +362,25 @@ cc_test { ], min_sdk_version: "29", } rust_test { name: "doh_unit_test", enabled: support_rust_toolchain, crate_name: "doh", srcs: ["doh.rs"], edition: "2018", test_suites: ["general-tests"], auto_gen_config: true, rustlibs: [ "libandroid_logger", "libanyhow", "liblazy_static", "liblibc", "liblog_rust", "libquiche", "libring", "libtokio", "liburl", ], min_sdk_version: "29", } doh.rs +11 −0 Original line number Diff line number Diff line Loading @@ -472,3 +472,14 @@ pub unsafe extern "C" fn doh_query( } } } #[cfg(test)] mod tests { #[test] fn doh_init() { unsafe { // Safety: the returned pointer from doh_init() must be a null terminated string. assert_eq!(std::ffi::CStr::from_ptr(super::doh_init()).to_str().unwrap(), "1.0"); } } } Loading
Android.bp +22 −0 Original line number Diff line number Diff line Loading @@ -362,3 +362,25 @@ cc_test { ], min_sdk_version: "29", } rust_test { name: "doh_unit_test", enabled: support_rust_toolchain, crate_name: "doh", srcs: ["doh.rs"], edition: "2018", test_suites: ["general-tests"], auto_gen_config: true, rustlibs: [ "libandroid_logger", "libanyhow", "liblazy_static", "liblibc", "liblog_rust", "libquiche", "libring", "libtokio", "liburl", ], min_sdk_version: "29", }
doh.rs +11 −0 Original line number Diff line number Diff line Loading @@ -472,3 +472,14 @@ pub unsafe extern "C" fn doh_query( } } } #[cfg(test)] mod tests { #[test] fn doh_init() { unsafe { // Safety: the returned pointer from doh_init() must be a null terminated string. assert_eq!(std::ffi::CStr::from_ptr(super::doh_init()).to_str().unwrap(), "1.0"); } } }