diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-07 14:36:40 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-07 14:36:40 +0200 |
commit | da5606ff80dcd196deaa504626150c7e2a3b825f (patch) | |
tree | 118b154a3fa66961670f9e3c5e2c7948e4d673c1 /unittest | |
parent | e2e08e3e3ef9de6f3d5b1814a67d91ee68135cbb (diff) | |
download | libnitrokey-da5606ff80dcd196deaa504626150c7e2a3b825f.tar.gz libnitrokey-da5606ff80dcd196deaa504626150c7e2a3b825f.tar.bz2 |
Enter bytes directly instead of using string
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/test_offline.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc index a85a41f..58c7555 100644 --- a/unittest/test_offline.cc +++ b/unittest/test_offline.cc @@ -90,9 +90,10 @@ TEST_CASE("Test helper function - hex_string_to_byte", "[fast]") { using namespace nitrokey::misc; std::vector<uint8_t> v; REQUIRE_NOTHROW(v = hex_string_to_byte("00112233445566")); - const uint8_t test_data[] = "\x00\x11\x22\x33\x44\x55\x66"; - REQUIRE(v.size() == sizeof(test_data)-1); + 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) { + INFO("Position i: " << i); REQUIRE(v.data()[i] == test_data[i]); } } |