aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp')
-rw-r--r--src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp b/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp
index 87d905c880..f242725c35 100644
--- a/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp
+++ b/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp
@@ -140,9 +140,10 @@ void PerfResourceCounterTest::testUnitSized()
QList<int> ids;
for (int i = 0; i < 10000; ++i) {
counter.request(1);
- int id = qrand();
+ const int id = qrand();
counter.obtain(id);
- ids.append(id);
+ if (id != 0) // Otherwise it's the invalid ID and that means the allocation "failed".
+ ids.append(id);
QCOMPARE(counter.currentTotal(), ids.length());
}
QCOMPARE(sum(container), counter.currentTotal());