aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-02-28 20:28:33 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-28 20:28:33 +0100
commit2b752acc507d60047576876c9ada4596442511b6 (patch)
treec12edaaf9170f393aa77e63d9be480324532b39c /unittest
parenta1e081303dc7f7329e5452dad7e6cedf7efe3699 (diff)
downloadlibnitrokey-2b752acc507d60047576876c9ada4596442511b6.tar.gz
libnitrokey-2b752acc507d60047576876c9ada4596442511b6.tar.bz2
Add test's scenario descriptions
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_multiple_devices.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/unittest/test_multiple_devices.cc b/unittest/test_multiple_devices.cc
index 65ae9ab..f497908 100644
--- a/unittest/test_multiple_devices.cc
+++ b/unittest/test_multiple_devices.cc
@@ -99,6 +99,12 @@ TEST_CASE("Use API ID", "[BASIC]") {
REQUIRE(v.size() > 0);
//no refresh - should not reconnect to new devices
+ // Scenario:
+ // 1. Run test
+ // 2. Remove one of the devices and reinsert it after a while
+ // 3. Device should not be reconnected and test should not crash
+ // 4. Remove all devices - test should continue
+
for (int j = 0; j < 100; j++) {
for (auto i : v) {
if (!nm->connect_with_ID(i)) continue;
@@ -121,6 +127,11 @@ TEST_CASE("Use API ID refresh", "[BASIC]") {
nm->set_loglevel(2);
//refresh in each iteration - should reconnect to new devices
+ // Scenario:
+ // 1. Run test
+ // 2. Remove one of the devices and reinsert it after a while
+ // 3. Device should be reconnected
+
for(int j=0; j<100; j++) {
auto v = nm->list_devices_by_cpuID();
REQUIRE(v.size() > 0);