mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
account_archive: add test to validate changeAccountPassword
Change-Id: I7380645f022b1b08d2a961e191c3dd978916fe0e
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user