diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-02-28 20:28:33 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-02-28 20:28:33 +0100 |
commit | 2b752acc507d60047576876c9ada4596442511b6 (patch) | |
tree | c12edaaf9170f393aa77e63d9be480324532b39c | |
parent | a1e081303dc7f7329e5452dad7e6cedf7efe3699 (diff) | |
download | libnitrokey-2b752acc507d60047576876c9ada4596442511b6.tar.gz libnitrokey-2b752acc507d60047576876c9ada4596442511b6.tar.bz2 |
Add test's scenario descriptions
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r-- | unittest/test_multiple_devices.cc | 11 |
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); |