diff options
Diffstat (limited to 'unittest/test_C_API.cpp')
-rw-r--r-- | unittest/test_C_API.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/unittest/test_C_API.cpp b/unittest/test_C_API.cpp index acfadd2..f38d0b6 100644 --- a/unittest/test_C_API.cpp +++ b/unittest/test_C_API.cpp @@ -84,4 +84,21 @@ TEST_CASE("multiple devices with ID", "[BASIC]") { } free (string); -}
\ No newline at end of file +} + +TEST_CASE("Get device model", "[BASIC]") { + auto success = NK_get_device_model(nullptr); + REQUIRE(!success); + + NK_logout(); + NK_device_model model = static_cast<NK_device_model>(3); + success = NK_get_device_model(&model); + REQUIRE(!success); + + auto result = NK_login_auto(); + REQUIRE(result != 0); + success = NK_get_device_model(&model); + REQUIRE(success); + REQUIRE((model == NK_PRO || model == NK_STORAGE)); + NK_logout(); +} |