summaryrefslogtreecommitdiffhomepage
path: root/tests/test-auth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-auth.cpp')
-rw-r--r--tests/test-auth.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/test-auth.cpp b/tests/test-auth.cpp
index 7948a0a..8397b35 100644
--- a/tests/test-auth.cpp
+++ b/tests/test-auth.cpp
@@ -22,7 +22,20 @@ public:
void teardown(){}
};
-BOOST_FIXTURE_TEST_CASE(auth, AuthFixture)
+BOOST_FIXTURE_TEST_CASE(generate, AuthFixture)
{
+ std::string pw0 {Auth::generate("")};
+ BOOST_CHECK_GT(pw0.size(), 0);
+ std::string pw1 {Auth::generate("abc")};
+ BOOST_CHECK_GT(pw1.size(), 0);
+
+ BOOST_CHECK_NE(pw0, pw1);
}
+BOOST_FIXTURE_TEST_CASE(validate, AuthFixture)
+{
+ BOOST_CHECK(Auth::validate("t5MMkLQXzYkdw", "abc"));
+
+ BOOST_CHECK(!Auth::validate("abc", "abc"));
+ BOOST_CHECK(!Auth::validate("t5MNkLQXzYkdw", "abc"));
+}