diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-19 15:08:13 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-19 15:08:13 +0200 |
commit | b46dbfa63f344cd7e5323139cf71cd100a179682 (patch) | |
tree | 211be3e046dc4b398f7653b78c226d61626e9e68 /unittest | |
parent | 9eb759fc6fa0b41ecfbe366b56384e3eb97dd081 (diff) | |
parent | 57c0b8c1235c5bff3640e85a8e17be20e8f422f3 (diff) | |
download | libnitrokey-b46dbfa63f344cd7e5323139cf71cd100a179682.tar.gz libnitrokey-b46dbfa63f344cd7e5323139cf71cd100a179682.tar.bz2 |
Merge branch 'pr_117'
Library version getter for C API
Fixes #117
Fixes #35
Fixes #62
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/test_offline.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc index 468849e..aad875f 100644 --- a/unittest/test_offline.cc +++ b/unittest/test_offline.cc @@ -160,3 +160,14 @@ TEST_CASE("Test device commands ids", "[fast]") { REQUIRE(STICK20_CMD_CHANGE_UPDATE_PIN == static_cast<uint8_t>(CommandID::CHANGE_UPDATE_PIN)); } + +#include "version.h" +TEST_CASE("Test version getter", "[fast]") { + REQUIRE(nitrokey::get_major_library_version() >= 3u); + REQUIRE(nitrokey::get_minor_library_version() >= 3u); + const char *library_version = nitrokey::get_library_version(); + REQUIRE(library_version != nullptr); + std::string s = library_version; + REQUIRE(s.length() >= 8); + REQUIRE(s.find("g") != std::string::npos); +} |