Skip to content

Commit

Permalink
test open is read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Feb 16, 2024
1 parent 5933440 commit b2d5b19
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/tests/registry/tests/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@ fn keys() -> Result<()> {
assert_eq!(err.code(), HRESULT(0x80070002u32 as i32)); // HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
assert_eq!(err.message(), "The system cannot find the file specified.");

let key = key.open("one")?;
let err = key.set_u32("name", 123).unwrap_err();
assert_eq!(err.code(), HRESULT(0x80070005u32 as i32)); // E_ACCESSDENIED
assert_eq!(err.message(), "Access is denied.");

Ok(())
}

0 comments on commit b2d5b19

Please sign in to comment.