aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test1.cc (renamed from unittest/test.cc)0
-rw-r--r--unittest/test_C_API.cpp2
-rw-r--r--unittest/test_HOTP.cc2
-rw-r--r--unittest/test_offline.cc2
4 files changed, 3 insertions, 3 deletions
diff --git a/unittest/test.cc b/unittest/test1.cc
index 51a2ef6..51a2ef6 100644
--- a/unittest/test.cc
+++ b/unittest/test1.cc
diff --git a/unittest/test_C_API.cpp b/unittest/test_C_API.cpp
index 2d83ef4..acfadd2 100644
--- a/unittest/test_C_API.cpp
+++ b/unittest/test_C_API.cpp
@@ -74,7 +74,7 @@ TEST_CASE("multiple devices with ID", "[BASIC]") {
int t;
string = strndup(s, 4096);
- free ( (void*) s);
+ free (static_cast<void*>(const_cast<char*>(s)));
while ((token = strsep(&string, ";")) != nullptr){
if (strnlen(token, 4096) < 3) continue;
diff --git a/unittest/test_HOTP.cc b/unittest/test_HOTP.cc
index c13fb8e..b11cf25 100644
--- a/unittest/test_HOTP.cc
+++ b/unittest/test_HOTP.cc
@@ -38,7 +38,7 @@ void hexStringToByte(uint8_t data[], const char* hexString){
REQUIRE(strlen(hexString)%2==0);
char buf[3];
buf[2] = '\0';
- for(int i=0; i<strlen(hexString); i++){
+ for(size_t i=0; i<strlen(hexString); i++){
buf[i%2] = hexString[i];
if (i%2==1){
data[i/2] = strtoul(buf, NULL, 16) & 0xFF;
diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc
index 3ef63d2..468849e 100644
--- a/unittest/test_offline.cc
+++ b/unittest/test_offline.cc
@@ -113,7 +113,7 @@ TEST_CASE("Test helper function - hex_string_to_byte", "[fast]") {
REQUIRE_NOTHROW(v = hex_string_to_byte("00112233445566"));
const uint8_t test_data[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66};
REQUIRE(v.size() == sizeof(test_data));
- for (int i = 0; i < v.size(); ++i) {
+ for (size_t i = 0; i < v.size(); ++i) {
INFO("Position i: " << i);
REQUIRE(v[i] == test_data[i]);
}