aboutsummaryrefslogtreecommitdiff
path: root/unittest/test_HOTP.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 17:18:59 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 17:18:59 +0100
commit22d05ce647281056d71fbd3c31df3bcd6396188d (patch)
tree90208930f54c47987bfd5ffcf0a0acaaad2510da /unittest/test_HOTP.cc
parented5044da43172d86a1aa475473561a4818b7c69c (diff)
parentac6b9c18ef55f4cd36e85069cf0cf82c14e04404 (diff)
downloadlibnitrokey-22d05ce647281056d71fbd3c31df3bcd6396188d.tar.gz
libnitrokey-22d05ce647281056d71fbd3c31df3bcd6396188d.tar.bz2
Merge branch 'libnitrokey_3'
Diffstat (limited to 'unittest/test_HOTP.cc')
-rw-r--r--unittest/test_HOTP.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/unittest/test_HOTP.cc b/unittest/test_HOTP.cc
index d31df55..e6f7d7c 100644
--- a/unittest/test_HOTP.cc
+++ b/unittest/test_HOTP.cc
@@ -1,4 +1,3 @@
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main()
#include "catch.hpp"
#include <iostream>
#include "device_proto.h"
@@ -14,7 +13,7 @@ using namespace nitrokey::log;
using namespace nitrokey::misc;
void hexStringToByte(uint8_t data[], const char* hexString){
- assert(strlen(hexString)%2==0);
+ REQUIRE(strlen(hexString)%2==0);
char buf[2];
for(int i=0; i<strlen(hexString); i++){
buf[i%2] = hexString[i];
@@ -34,8 +33,8 @@ TEST_CASE("test secret", "[functions]") {
}
TEST_CASE("Test HOTP codes according to RFC", "[HOTP]") {
- Stick10 stick;
- bool connected = stick.connect();
+ std::shared_ptr<Stick10> stick = make_shared<Stick10>();
+ bool connected = stick->connect();
REQUIRE(connected == true);
@@ -98,5 +97,5 @@ TEST_CASE("Test HOTP codes according to RFC", "[HOTP]") {
}
- stick.disconnect();
+ stick->disconnect();
}