Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Discover
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Discover
Commits
88257be7
Commit
88257be7
authored
May 23, 2018
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dummy test
Don't assume we're listing the technical resources
parent
358a03b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
libdiscover/backends/DummyBackend/tests/DummyTest.cpp
libdiscover/backends/DummyBackend/tests/DummyTest.cpp
+7
-7
No files found.
libdiscover/backends/DummyBackend/tests/DummyTest.cpp
View file @
88257be7
...
...
@@ -81,7 +81,7 @@ void DummyTest::testReadData()
{
const
auto
resources
=
fetchResources
(
m_appBackend
->
search
({}));
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
()
*
2
,
resources
.
size
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
(),
resources
.
size
());
QBENCHMARK
{
for
(
AbstractResource
*
res
:
resources
)
{
QVERIFY
(
!
res
->
name
().
isEmpty
());
...
...
@@ -102,18 +102,18 @@ void DummyTest::testProxy()
QVERIFY
(
spy
.
wait
());
QVERIFY
(
!
pm
.
isBusy
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
()
*
2
,
pm
.
rowCount
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
(),
pm
.
rowCount
());
pm
.
setSearch
(
QStringLiteral
(
"techie"
));
QVERIFY
(
pm
.
isBusy
());
QVERIFY
(
spy
.
wait
());
QVERIFY
(
!
pm
.
isBusy
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
()
,
pm
.
rowCount
());
QCOMPARE
(
0
,
pm
.
rowCount
());
QCOMPARE
(
pm
.
subcategories
().
count
(),
7
);
pm
.
setSearch
(
QString
());
QVERIFY
(
pm
.
isBusy
());
QVERIFY
(
spy
.
wait
());
QVERIFY
(
!
pm
.
isBusy
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
()
*
2
,
pm
.
rowCount
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
(),
pm
.
rowCount
());
}
void
DummyTest
::
testProxySorting
()
...
...
@@ -131,7 +131,7 @@ void DummyTest::testProxySorting()
QVERIFY
(
spy
.
wait
());
QVERIFY
(
!
pm
.
isBusy
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
()
*
2
,
pm
.
rowCount
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
(),
pm
.
rowCount
());
QVariant
lastRatingCount
;
for
(
int
i
=
0
,
rc
=
pm
.
rowCount
();
i
<
rc
;
++
i
)
{
const
QModelIndex
mi
=
pm
.
index
(
i
,
0
);
...
...
@@ -145,14 +145,14 @@ void DummyTest::testProxySorting()
void
DummyTest
::
testFetch
()
{
const
auto
resources
=
fetchResources
(
m_appBackend
->
search
({}));
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
()
*
2
,
resources
.
count
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
(),
resources
.
count
());
//fetches updates, adds new things
m_appBackend
->
checkForUpdates
();
QSignalSpy
spy
(
m_model
,
SIGNAL
(
allInitialized
()));
QVERIFY
(
spy
.
wait
(
80000
));
auto
resources2
=
fetchResources
(
m_appBackend
->
search
({}));
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
()
*
4
,
resources2
.
count
());
QCOMPARE
(
m_appBackend
->
property
(
"startElements"
).
toInt
()
*
2
,
resources2
.
count
());
}
void
DummyTest
::
testSort
()
...
...
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