diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-28 12:15:43 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-01-28 12:15:43 +0100 |
commit | e13dcef265dea3b222b85e09274333ba984ac1ca (patch) | |
tree | 0316b8fb03d4129aadce2f43d910829f492227a0 | |
parent | 4dbe7113cf374454f681736308d87e27403c147b (diff) | |
download | libnitrokey-e13dcef265dea3b222b85e09274333ba984ac1ca.tar.gz libnitrokey-e13dcef265dea3b222b85e09274333ba984ac1ca.tar.bz2 |
Replace NK_status with NK_get_status_as_string in unit tests
-rw-r--r-- | unittest/test_multiple_devices.cc | 2 | ||||
-rw-r--r-- | unittest/test_safe.cpp | 2 | ||||
-rw-r--r-- | unittest/test_strdup.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/unittest/test_multiple_devices.cc b/unittest/test_multiple_devices.cc index 4b1e2c1..7e10a42 100644 --- a/unittest/test_multiple_devices.cc +++ b/unittest/test_multiple_devices.cc @@ -117,7 +117,7 @@ TEST_CASE("Use C API", "[BASIC]") { while (ptr) { std::cout << "Connect with: " << ptr->model << " " << ptr->path << " " << ptr->serial_number << " | " << NK_connect_with_path(ptr->path) << " | "; - auto status = NK_status(); + auto status = NK_get_status_as_string(); std::cout << status << std::endl; free(status); ptr = ptr->next; diff --git a/unittest/test_safe.cpp b/unittest/test_safe.cpp index d6f8b63..a244027 100644 --- a/unittest/test_safe.cpp +++ b/unittest/test_safe.cpp @@ -60,7 +60,7 @@ TEST_CASE("Status command for Pro or Storage", "[BASIC]") { auto const m = NK_get_device_model(); REQUIRE(m != NK_DISCONNECTED); if (m == NK_PRO) - s = NK_status(); + s = NK_get_status_as_string(); else if (m == NK_STORAGE){ s = NK_get_status_storage_as_string(); } diff --git a/unittest/test_strdup.cpp b/unittest/test_strdup.cpp index 4f77b7f..c7f4ea8 100644 --- a/unittest/test_strdup.cpp +++ b/unittest/test_strdup.cpp @@ -34,7 +34,7 @@ static const int SHORT_STRING_LENGTH = 10; TEST_CASE("Test strdup memory free error", "[BASIC]") { NK_set_debug(false); - char *c = NK_status(); /* error --> string literal */ + char *c = NK_get_status_as_string(); /* error --> string literal */ REQUIRE(c != nullptr); REQUIRE(strnlen(c, SHORT_STRING_LENGTH) == 0); puts(c); @@ -48,7 +48,7 @@ TEST_CASE("Test strdup memory leak", "[BASIC]") if (!connected) return; REQUIRE(connected); - char *c = NK_status(); /* no error --> dynamically allocated */ + char *c = NK_get_status_as_string(); /* no error --> dynamically allocated */ REQUIRE(c != nullptr); REQUIRE(strnlen(c, SHORT_STRING_LENGTH) > 0); puts(c); |