diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-22 09:02:41 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-11-03 15:09:19 +0100 |
commit | 3e5ef9e181084cc88ef59811e6eba1d7d82ba4cf (patch) | |
tree | 1b8e2fbf5965d8f2ee69b839282d2b9f7692e463 /unittest | |
parent | dab6f2bcf292dfd6ee629a4ad9b2216e104d7c1d (diff) | |
download | libnitrokey-3e5ef9e181084cc88ef59811e6eba1d7d82ba4cf.tar.gz libnitrokey-3e5ef9e181084cc88ef59811e6eba1d7d82ba4cf.tar.bz2 |
Use hand-inserted version. Remove one Git pass.pr_62
Full version name should consist of official version and Git one
Git describe should never fail with --always switch
Add more build specific information
Save compilation definitions and flags
Move getting information to the end of CMakeLists.txt
Use configuration over definitions
Proper implementation in C API for getting version
Test case for getting version.
Working configure file
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/test_C_API.cpp | 2 | ||||
-rw-r--r-- | unittest/test_offline.cc | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/unittest/test_C_API.cpp b/unittest/test_C_API.cpp index 160145b..a351139 100644 --- a/unittest/test_C_API.cpp +++ b/unittest/test_C_API.cpp @@ -31,4 +31,4 @@ TEST_CASE("Check long strings", "[STANDARD]") { result = NK_change_user_PIN(pin, longPin); REQUIRE(result == TOO_LONG_STRING); CAPTURE(result); -}
\ No newline at end of file +} diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc index 58c7555..f4063ab 100644 --- a/unittest/test_offline.cc +++ b/unittest/test_offline.cc @@ -11,6 +11,15 @@ using namespace nitrokey; //This test suite assumes no Pro or Storage devices are connected +#include <string.h> +TEST_CASE("Get version", "[BASIC]") { + const char * v = NK_version(); + CAPTURE(v); + REQUIRE( strnlen(v, 200) > 0 ); + free((void*)v); +} + + TEST_CASE("Return false on no device connected", "[fast]") { INFO("This test case assumes no Pro or Storage devices are connected"); auto stick = make_shared<Stick20>(); |