From 73c8aebac338d3454d7e345ffd687324317077ec Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jan 2020 12:00:15 +0100 Subject: 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. --- tests/device.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests') 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 +// Copyright (C) 2018-2020 Robin Krahl // SPDX-License-Identifier: MIT mod util; @@ -639,6 +639,14 @@ fn clear_new_sd_card_warning(device: Storage) { assert!(!status.new_sd_card_found); } +#[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; -- cgit v1.2.1