summaryrefslogtreecommitdiff
path: root/src/plugins/perfprofiler
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-06-18 11:48:32 +0200
committerEike Ziller <eike.ziller@qt.io>2019-06-18 11:48:32 +0200
commitb02f4ae6154810a9894615eca3052957e6e3ec56 (patch)
tree4569646cf3882d862a4784d9a278a55b373a106e /src/plugins/perfprofiler
parent174b6f7e659f6667ea8621f2d57d3bf67fedcdbf (diff)
parenta2cfa434683552f63699a70e9de2295a12f41eaa (diff)
downloadqt-creator-b02f4ae6154810a9894615eca3052957e6e3ec56.tar.gz
Merge remote-tracking branch 'origin/4.9' into 4.10
Change-Id: I6f1bc9381dc8c0ce8abc5a6c006087076d8fc1bc
Diffstat (limited to 'src/plugins/perfprofiler')
-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());