Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcontacts
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mer-core-attic
libcontacts
Commits
c40d47f8
Commit
c40d47f8
authored
Apr 08, 2015
by
chriadam
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #102 from nemomobile/fixtests
[libcontacts] Fix unit tests
parents
74283e96
a80cc4f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
7 deletions
+18
-7
libcontacts.pro
libcontacts.pro
+1
-0
rpm/libcontacts-qt5.spec
rpm/libcontacts-qt5.spec
+1
-0
src/seasidecache.cpp
src/seasidecache.cpp
+3
-0
tests/tests.pro
tests/tests.pro
+1
-0
tests/tests.xml.in
tests/tests.xml.in
+3
-3
tests/tst_seasideimport/tst_seasideimport.cpp
tests/tst_seasideimport/tst_seasideimport.cpp
+9
-4
No files found.
libcontacts.pro
View file @
c40d47f8
TEMPLATE
=
subdirs
SUBDIRS
=
src
tests
OTHER_FILES
+=
rpm
/
libcontacts
-
qt5
.
spec
tests
.
depends
=
src
rpm/libcontacts-qt5.spec
View file @
c40d47f8
...
...
@@ -22,6 +22,7 @@ BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) >= 0.2.1
%package tests
Summary: Nemo contact cache library tests
Group: System/Libraries
Requires: blts-tools
Requires: %{name} = %{version}-%{release}
%description tests
...
...
src/seasidecache.cpp
View file @
c40d47f8
...
...
@@ -170,6 +170,9 @@ QMap<QString, QString> managerParameters()
QMap
<
QString
,
QString
>
rv
;
// Report presence changes independently from other contact changes
rv
.
insert
(
QString
::
fromLatin1
(
"mergePresenceChanges"
),
QString
::
fromLatin1
(
"false"
));
if
(
!
qgetenv
(
"LIBCONTACTS_TEST_MODE"
).
isEmpty
())
{
rv
.
insert
(
QString
::
fromLatin1
(
"autoTest"
),
QString
::
fromLatin1
(
"true"
));
}
return
rv
;
}
...
...
tests/tests.pro
View file @
c40d47f8
...
...
@@ -2,6 +2,7 @@ include(../package.pri)
TEMPLATE
=
subdirs
SUBDIRS
=
tst_synchronizelists
tst_seasideimport
tst_resolve
OTHER_FILES
+=
tests
.
xml
.
in
tests_xml
.
target
=
tests
.
xml
tests_xml
.
depends
=
$$
PWD
/
tests
.
xml
.
in
...
...
tests/tests.xml.in
View file @
c40d47f8
...
...
@@ -5,13 +5,13 @@
<set
name=
"contactcache-test0"
feature=
"Contacts"
>
<description>
Contact cache automatic tests
</description>
<case
manual=
"false"
name=
"synchronizelists"
>
<step>
/opt/tests/@PACKAGENAME@/tst_synchronizelists
</step>
<step>
LIBCONTACTS_TEST_MODE=1 /usr/sbin/run-blts-root /bin/su -g privileged -c '/opt/tests/@PACKAGENAME@/tst_synchronizelists' nemo
</step>
</case>
<case
manual=
"false"
name=
"seasideimport"
>
<step>
/opt/tests/@PACKAGENAME@/tst_seasideimport
</step>
<step>
LIBCONTACTS_TEST_MODE=1 /usr/sbin/run-blts-root /bin/su -g privileged -c '/opt/tests/@PACKAGENAME@/tst_seasideimport' nemo
</step>
</case>
<case
manual=
"false"
name=
"resolve"
>
<step>
/opt/tests/@PACKAGENAME@/tst_resolve
</step>
<step>
LIBCONTACTS_TEST_MODE=1 /usr/sbin/run-blts-root /bin/su -g privileged -c '/opt/tests/@PACKAGENAME@/tst_resolve' nemo
</step>
</case>
</set>
</suite>
...
...
tests/tst_seasideimport/tst_seasideimport.cpp
View file @
c40d47f8
...
...
@@ -468,10 +468,15 @@ void tst_SeasideImport::mergedUid()
QCOMPARE
(
name
.
isEmpty
(),
true
);
const
QList
<
QContactNickname
>
nicknames
(
c
.
details
<
QContactNickname
>
());
QCOMPARE
(
nicknames
.
count
(),
1
);
QCOMPARE
(
nicknames
.
count
(),
2
);
const
QContactNickname
nick
(
nicknames
.
at
(
0
));
QCOMPARE
(
nick
.
nickname
(),
QString
::
fromLatin1
(
"Jebediah Springfield"
));
const
QContactNickname
nick1
(
nicknames
.
at
(
0
));
const
QContactNickname
nick2
(
nicknames
.
at
(
1
));
QVERIFY
(
nick1
.
nickname
()
==
QString
::
fromLatin1
(
"Jebediah Springfield"
)
||
nick1
.
nickname
()
==
QString
::
fromLatin1
(
"Obadiah Springfield"
));
QVERIFY
(
nick2
.
nickname
()
==
QString
::
fromLatin1
(
"Jebediah Springfield"
)
||
nick2
.
nickname
()
==
QString
::
fromLatin1
(
"Obadiah Springfield"
));
QVERIFY
(
nick1
.
nickname
()
!=
nick2
.
nickname
());
const
QList
<
QContactPhoneNumber
>
phoneNumbers
(
c
.
details
<
QContactPhoneNumber
>
());
QCOMPARE
(
phoneNumbers
.
count
(),
2
);
...
...
@@ -494,4 +499,4 @@ void tst_SeasideImport::mergedUid()
}
#include "tst_seasideimport.moc"
QTEST_
APP
LESS_MAIN
(
tst_SeasideImport
)
QTEST_
GUI
LESS_MAIN
(
tst_SeasideImport
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment