diff options
Diffstat (limited to 'tests/device.rs')
-rw-r--r-- | tests/device.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/device.rs b/tests/device.rs index 0c8bb26..d6ed0c4 100644 --- a/tests/device.rs +++ b/tests/device.rs @@ -120,7 +120,7 @@ fn get_retry_count(device: DeviceWrapper) { fn config(device: DeviceWrapper) { let admin = device.authenticate_admin(ADMIN_PASSWORD).unwrap(); let config = Config::new(None, None, None, true); - assert!(admin.write_config(config).is_ok()); + assert_eq!(Ok(()), admin.write_config(config)); let get_config = admin.get_config().unwrap(); assert_eq!(config, get_config); @@ -128,12 +128,12 @@ fn config(device: DeviceWrapper) { assert_eq!(Err(CommandError::InvalidSlot), admin.write_config(config)); let config = Config::new(Some(1), None, Some(0), false); - assert!(admin.write_config(config).is_ok()); + assert_eq!(Ok(()), admin.write_config(config)); let get_config = admin.get_config().unwrap(); assert_eq!(config, get_config); let config = Config::new(None, None, None, false); - assert!(admin.write_config(config).is_ok()); + assert_eq!(Ok(()), admin.write_config(config)); let get_config = admin.get_config().unwrap(); assert_eq!(config, get_config); } @@ -332,26 +332,26 @@ fn change_update_pin(device: Storage) { #[test_device] fn encrypted_volume(device: Storage) { - assert!(device.lock().is_ok()); + assert_eq!(Ok(()), device.lock()); assert_eq!(1, count_nitrokey_block_devices()); - assert!(device.disable_encrypted_volume().is_ok()); + assert_eq!(Ok(()), device.disable_encrypted_volume()); assert_eq!(1, count_nitrokey_block_devices()); assert_eq!( Err(CommandError::WrongPassword), device.enable_encrypted_volume("123") ); assert_eq!(1, count_nitrokey_block_devices()); - assert!(device.enable_encrypted_volume(USER_PASSWORD).is_ok()); + assert_eq!(Ok(()), device.enable_encrypted_volume(USER_PASSWORD)); assert_eq!(2, count_nitrokey_block_devices()); - assert!(device.disable_encrypted_volume().is_ok()); + assert_eq!(Ok(()), device.disable_encrypted_volume()); assert_eq!(1, count_nitrokey_block_devices()); } #[test_device] fn lock(device: Storage) { - assert!(device.enable_encrypted_volume(USER_PASSWORD).is_ok()); - assert!(device.lock().is_ok()); + assert_eq!(Ok(()), device.enable_encrypted_volume(USER_PASSWORD)); + assert_eq!(Ok(()), device.lock()); assert_eq!(1, count_nitrokey_block_devices()); } |