Files
build/tools/aconfig/tests/aconfig_test_mode_test.rs
Vinh Tran 906405f5c9 Add rust_test with rust_aconfig_library in test mode
Using test mode in aconfig  allows us to override the flag for unit
testing

Test: atest aconfig.test_mode.test.rust
Change-Id: I890fb20fd8cf83e6033defc7093430e3a77e4de4
2023-08-11 21:41:13 +00:00

24 lines
1.0 KiB
Rust

#[test]
fn test_flags() {
assert!(!aconfig_test_rust_library::disabled_ro());
assert!(!aconfig_test_rust_library::disabled_rw());
// TODO: Fix template to not default both disabled and enabled to false
assert!(!aconfig_test_rust_library::enabled_ro());
assert!(!aconfig_test_rust_library::enabled_rw());
aconfig_test_rust_library::set_disabled_ro(true);
assert!(aconfig_test_rust_library::disabled_ro());
aconfig_test_rust_library::set_disabled_rw(true);
assert!(aconfig_test_rust_library::disabled_rw());
aconfig_test_rust_library::set_enabled_ro(true);
assert!(aconfig_test_rust_library::enabled_ro());
aconfig_test_rust_library::set_enabled_rw(true);
assert!(aconfig_test_rust_library::enabled_rw());
aconfig_test_rust_library::reset_flags();
assert!(!aconfig_test_rust_library::disabled_ro());
assert!(!aconfig_test_rust_library::disabled_rw());
assert!(!aconfig_test_rust_library::enabled_ro());
assert!(!aconfig_test_rust_library::enabled_rw());
}