Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
523b2780
Commit
523b2780
authored
3 years ago
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/unitTest/account_archive/account_archive.cpp
+15
-0
15 additions, 0 deletions
test/unitTest/account_archive/account_archive.cpp
with
15 additions
and
0 deletions
test/unitTest/account_archive/account_archive.cpp
+
15
−
0
View file @
523b2780
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment