aboutsummaryrefslogtreecommitdiff
path: root/unittest/test_strdup.cpp
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2019-01-29 16:37:22 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2019-01-29 16:37:22 +0100
commit1bf90425d2006558ce4f4aac0ed5680d31b77918 (patch)
treec6789df5d10d1b5f6b83c5d1c7c2889e5ad2a6d9 /unittest/test_strdup.cpp
parentb0d1d6a1a44210a25b3d0e6950ec08f551714ccf (diff)
parentdc9dd81105634aeb100c47637fedef425f0ac6f9 (diff)
downloadlibnitrokey-1bf90425d2006558ce4f4aac0ed5680d31b77918.tar.gz
libnitrokey-1bf90425d2006558ce4f4aac0ed5680d31b77918.tar.bz2
Merge branch 'pr_155'
Add Status structure, and a general command for using it as a result. Usable to limit calls to the device, when multiple status fields are required at given time. Tested on Nitrokey Pro v0.7 and v0.10. Run offline tests as well (C++ and Python). Fixes #155
Diffstat (limited to 'unittest/test_strdup.cpp')
-rw-r--r--unittest/test_strdup.cpp4
1 files changed, 2 insertions, 2 deletions
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);