Tests: Make environment test less verbose

Only print out additional information if the environment
does not match the expected one.

Change-Id: I9be1a90400a180a4cbd0381f54eea79409c007c7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2024-06-05 13:20:35 +02:00
parent 7f08529a60
commit 9a4cae42c0

View File

@@ -377,9 +377,12 @@ void tst_Environment::pathChanges()
else
environment.appendOrSet(variable, value);
qDebug() << "Actual :" << environment.toStringList();
qDebug() << "Expected:" << expected.toStringList();
QCOMPARE(environment, expected);
const bool envEqualsExpected = environment == expected;
if (!envEqualsExpected) {
qDebug() << "Actual :" << environment.toStringList();
qDebug() << "Expected:" << expected.toStringList();
}
QVERIFY(envEqualsExpected);
}
void tst_Environment::find_data()