aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-10-28 14:55:56 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-11-26 18:56:26 +0100
commit6343eea03980627cb763de777af6b316130bdf43 (patch)
treec8bb5413f81a7fa22f45180c9ff215eb5549148a /unittest
parente45e2f03cf40b5826632ab95cbc79c487249897a (diff)
downloadlibnitrokey-6343eea03980627cb763de777af6b316130bdf43.tar.gz
libnitrokey-6343eea03980627cb763de777af6b316130bdf43.tar.bz2
Support getting SD card occupancy and test
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test2.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittest/test2.cc b/unittest/test2.cc
index 8db91b7..f5d2b28 100644
--- a/unittest/test2.cc
+++ b/unittest/test2.cc
@@ -124,6 +124,12 @@ TEST_CASE("test device internal status with various commands", "[fast]") {
auto production_status = stick20::ProductionTest::CommandTransaction::run(stick);
REQUIRE(production_status.data().SD_Card_Size_u8 == 8);
REQUIRE(production_status.data().SD_CardID_u32 != 0);
+
+ auto sdcard_occupancy = stick20::GetSDCardOccupancy::CommandTransaction::run(stick);
+ REQUIRE((int) sdcard_occupancy.data().ReadLevelMin >= 0);
+ REQUIRE((int) sdcard_occupancy.data().ReadLevelMax <= 100);
+ REQUIRE((int) sdcard_occupancy.data().WriteLevelMin >= 0);
+ REQUIRE((int) sdcard_occupancy.data().WriteLevelMax <= 100);
}
TEST_CASE("setup hidden volume test", "[hidden]") {