Skip to content
Snippets Groups Projects
Commit 523b2780 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

account_archive: add test to validate changeAccountPassword

Change-Id: I7380645f022b1b08d2a961e191c3dd978916fe0e
parent 7c73d69c
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,7 @@ private:
void testExportImportPasswordDoubleGunzip();
void testExportDht();
void testExportDhtWrongPassword();
void testChangePassword();
CPPUNIT_TEST_SUITE(AccountArchiveTest);
CPPUNIT_TEST(testExportImportNoPassword);
......@@ -81,6 +82,7 @@ private:
CPPUNIT_TEST(testExportImportPasswordDoubleGunzip);
CPPUNIT_TEST(testExportDht);
CPPUNIT_TEST(testExportDhtWrongPassword);
CPPUNIT_TEST(testChangePassword);
CPPUNIT_TEST_SUITE_END();
};
......@@ -230,6 +232,19 @@ AccountArchiveTest::testExportDhtWrongPassword()
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(10), [&] { return status == 1; }));
}
void
AccountArchiveTest::testChangePassword()
{
// Test wrong password, should fail
CPPUNIT_ASSERT(!DRing::changeAccountPassword(aliceId, "wrong", "new"));
// Test correct password, should succeed
CPPUNIT_ASSERT(DRing::changeAccountPassword(aliceId, "", "new"));
// Now it should fail
CPPUNIT_ASSERT(!DRing::changeAccountPassword(aliceId, "", "new"));
// Remove password again (should succeed)
CPPUNIT_ASSERT(DRing::changeAccountPassword(aliceId, "new", ""));
}
} // namespace test
} // namespace jami
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment