From 989c9d610ce47fa6eb30cff5ca5a4c361354d456 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 29 Jan 2018 18:16:19 +0100 Subject: Update Catch to v2.1.1 Signed-off-by: Szczepan Zalega --- unittest/Catch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unittest') diff --git a/unittest/Catch b/unittest/Catch index ae5ee2c..62dae59 160000 --- a/unittest/Catch +++ b/unittest/Catch @@ -1 +1 @@ -Subproject commit ae5ee2cf63d6d67bd1369b512d2a7b60b571c907 +Subproject commit 62dae592c330ab74cea30c897255ee9518639c3f -- cgit v1.2.3 From d6c05b7279c521514bde5f43ea4a9550ca150018 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 29 Jan 2018 18:51:57 +0100 Subject: Fix Capture for Catch v2.0 Signed-off-by: Szczepan Zalega --- unittest/test_HOTP.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unittest') diff --git a/unittest/test_HOTP.cc b/unittest/test_HOTP.cc index a4f42d2..520faaf 100644 --- a/unittest/test_HOTP.cc +++ b/unittest/test_HOTP.cc @@ -50,7 +50,7 @@ TEST_CASE("test secret", "[functions]") { slot_secret[20] = 0; const char* secretHex = "3132333435363738393031323334353637383930"; hexStringToByte(slot_secret, secretHex); - CAPTURE(slot_secret); + INFO("Secret: " << slot_secret); REQUIRE(strcmp("12345678901234567890",reinterpret_cast(slot_secret) ) == 0 ); } -- cgit v1.2.3 From fb74908ac898d40c75f5a6b25d19f25f63a7fb0b Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 29 Jan 2018 18:52:28 +0100 Subject: Do initialization of hidden volume before test (once) Signed-off-by: Szczepan Zalega --- unittest/test_issues.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'unittest') diff --git a/unittest/test_issues.cc b/unittest/test_issues.cc index fe80384..d4fd72e 100644 --- a/unittest/test_issues.cc +++ b/unittest/test_issues.cc @@ -87,6 +87,16 @@ bool test_31(){ } TEST_CASE("issue 31", "[issue]"){ + { + auto i = NitrokeyManager::instance(); + i->set_loglevel(4); + REQUIRE(i->connect()); + + i->unlock_encrypted_volume(default_user_pin); + i->create_hidden_volume(0, 70, 80, hidden_volume_pass); + i->lock_device(); + } + for(int i=0; i<20; i++){ REQUIRE(test_31()); } -- cgit v1.2.3 From 6f35a5f98174a84bc4d96a98c37f66acc06f5b22 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 29 Jan 2018 18:53:05 +0100 Subject: Fix bug with different data read Makes occasional fails Signed-off-by: Szczepan Zalega --- unittest/test_offline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unittest') diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc index 2d1fcb3..3ef63d2 100644 --- a/unittest/test_offline.cc +++ b/unittest/test_offline.cc @@ -115,7 +115,7 @@ TEST_CASE("Test helper function - hex_string_to_byte", "[fast]") { REQUIRE(v.size() == sizeof(test_data)); for (int i = 0; i < v.size(); ++i) { INFO("Position i: " << i); - REQUIRE(v.data()[i] == test_data[i]); + REQUIRE(v[i] == test_data[i]); } } -- cgit v1.2.3