aboutsummaryrefslogtreecommitdiff
path: root/src/tests/pws.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/pws.rs')
-rw-r--r--src/tests/pws.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tests/pws.rs b/src/tests/pws.rs
index d6125a9..02e33cd 100644
--- a/src/tests/pws.rs
+++ b/src/tests/pws.rs
@@ -1,3 +1,4 @@
+use device::Device;
use nitrokey_sys;
use pws::{GetPasswordSafe, PasswordSafe, SLOT_COUNT};
use tests::util::{Target, ADMIN_PASSWORD, USER_PASSWORD};
@@ -36,6 +37,9 @@ fn drop() {
assert_eq!(Ok(String::from("name")), result);
}
let result = result_from_string(unsafe { nitrokey_sys::NK_get_password_safe_slot_name(1) });
+ assert_eq!(Ok(String::from("name")), result);
+ device.lock();
+ let result = result_from_string(unsafe { nitrokey_sys::NK_get_password_safe_slot_name(1) });
assert_eq!(Err(CommandError::NotAuthorized), result);
}