Sort the keys before comparing them in the test
The return order of the keys is random, so let's sort both first, then we can compare the lists. Should get rid of the test flakiness. Change-Id: I2e89d3cc603da6a4667b3677350baa4d40d59b45 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>bb10
parent
808969527a
commit
7e7cd1c294
|
|
@ -270,7 +270,12 @@ void tst_QShaderNodesLoader::shouldLoadFromJsonStream()
|
|||
QCOMPARE(loader.status(), status);
|
||||
|
||||
QFETCH(NodeHash, nodes);
|
||||
QCOMPARE(loader.nodes().keys(), nodes.keys());
|
||||
const auto sortedKeys = [](const NodeHash &nodes) {
|
||||
auto res = nodes.keys();
|
||||
res.sort();
|
||||
return res;
|
||||
};
|
||||
QCOMPARE(sortedKeys(loader.nodes()), sortedKeys(nodes));
|
||||
for (const auto &key : nodes.keys()) {
|
||||
const auto actual = loader.nodes().value(key);
|
||||
const auto expected = nodes.value(key);
|
||||
|
|
|
|||
Loading…
Reference in New Issue