aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_offline.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc
index 6f52a61..2ad6a0e 100644
--- a/unittest/test_offline.cc
+++ b/unittest/test_offline.cc
@@ -180,3 +180,28 @@ TEST_CASE("Test version getter", "[fast]") {
std::regex pattern(version + "(" + git_suffix + "|)");
REQUIRE(std::regex_match(s, pattern));
}
+
+TEST_CASE("Connect should not return true after the second attempt", "[fast]") {
+ int result = 0;
+
+ result = NK_login("S");
+ REQUIRE(result == 0);
+
+ result = NK_login_auto();
+ REQUIRE(result == 0);
+
+ result = NK_logout();
+ REQUIRE(result == 0);
+
+ result = NK_logout();
+ REQUIRE(result == 0);
+
+ result = NK_login("P");
+ REQUIRE(result == 0);
+
+ result = NK_login_auto();
+ REQUIRE(result == 0);
+
+ result = NK_logout();
+ REQUIRE(result == 0);
+}