MCPcopy Create free account
hub / github.com/PowerShell/DSC / test_set_value_binary

Function test_set_value_binary

archive/ntreg/tests/registry_value_tests.rs:130–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128
129#[test]
130fn test_set_value_binary() {
131 let key = RegistryKey::new("HKCU");
132 assert!(key.is_ok());
133 let new_key = key.unwrap().create_or_get_key("TestKey_binary");
134 assert!(new_key.is_ok());
135 let new_key = new_key.unwrap();
136 let reg_value = RegistryValueData::Binary(vec![0x01, 0x02, 0x03, 0x04]);
137 let result = new_key.set_value("TestBinary", &reg_value);
138 assert!(result.is_ok());
139 let result = result.unwrap();
140 assert_eq!(result.name, "TestBinary".to_string());
141 assert_eq!(result.data, RegistryValueData::Binary(vec![0x01, 0x02, 0x03, 0x04]));
142 assert!(new_key.delete(false).is_ok());
143}
144
145#[test]
146fn test_set_value_resoucelist() {

Callers

nothing calls this directly

Calls 3

create_or_get_keyMethod · 0.80
set_valueMethod · 0.80
newFunction · 0.50

Tested by

no test coverage detected