diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2020-01-14 12:00:15 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2020-01-14 12:06:23 +0100 |
commit | 73c8aebac338d3454d7e345ffd687324317077ec (patch) | |
tree | 0dd468f41257d3c6c9287230792ff443657aed54 /tests | |
parent | 6142752da1563c1ab873dc7069aeec72522cca99 (diff) | |
download | nitrokey-rs-73c8aebac338d3454d7e345ffd687324317077ec.tar.gz nitrokey-rs-73c8aebac338d3454d7e345ffd687324317077ec.tar.bz2 |
Add the get_sd_card_usage function to the Storage struct
This patch adds support for the NK_get_SD_usage_data function. It
returns a range of the SD card that has not been accessed during this
power cycle.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/device.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/device.rs b/tests/device.rs index f2a7031..070f3c1 100644 --- a/tests/device.rs +++ b/tests/device.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2019 Robin Krahl <robin.krahl@ireas.org> +// Copyright (C) 2018-2020 Robin Krahl <robin.krahl@ireas.org> // SPDX-License-Identifier: MIT mod util; @@ -640,6 +640,14 @@ fn clear_new_sd_card_warning(device: Storage) { } #[test_device] +fn get_sd_card_usage(device: Storage) { + let range = unwrap_ok!(device.get_sd_card_usage()); + + assert!(range.end >= range.start); + assert!(range.end <= 100); +} + +#[test_device] fn export_firmware(device: Storage) { let mut device = device; assert_cmd_err!( |