summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtaptestlogger.cpp4
-rw-r--r--src/testlib/qtestcase.h54
-rw-r--r--src/testlib/qtestcase.qdoc96
-rw-r--r--src/testlib/qtestresult.cpp16
4 files changed, 85 insertions, 85 deletions
diff --git a/src/testlib/qtaptestlogger.cpp b/src/testlib/qtaptestlogger.cpp
index 2c87c15d6c..76f0ba0e8b 100644
--- a/src/testlib/qtaptestlogger.cpp
+++ b/src/testlib/qtaptestlogger.cpp
@@ -302,8 +302,8 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
static const QRegularExpression compareOpRegex(
u"^(?<message>.*)\n"
- "\\s*Left\\s+\\((?<actualexpression>.*)\\)\\s*: (?<actual>.*)\n"
- "\\s*Right\\s+\\((?<expectedexpresssion>.*)\\)\\s*: "
+ "\\s*Computed\\s+\\((?<actualexpression>.*)\\)\\s*: (?<actual>.*)\n"
+ "\\s*Baseline\\s+\\((?<expectedexpresssion>.*)\\)\\s*: "
"(?<expected>.*)$"_s);
const QString descriptionString = QString::fromUtf8(description);
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 54978e34e7..3e0b2b3fb3 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -75,12 +75,12 @@ do { \
} \
} while (false)
-#define QCOMPARE_EQ(lhs, rhs) QCOMPARE_OP_IMPL(lhs, rhs, ==, Equal)
-#define QCOMPARE_NE(lhs, rhs) QCOMPARE_OP_IMPL(lhs, rhs, !=, NotEqual)
-#define QCOMPARE_LT(lhs, rhs) QCOMPARE_OP_IMPL(lhs, rhs, <, LessThan)
-#define QCOMPARE_LE(lhs, rhs) QCOMPARE_OP_IMPL(lhs, rhs, <=, LessThanOrEqual)
-#define QCOMPARE_GT(lhs, rhs) QCOMPARE_OP_IMPL(lhs, rhs, >, GreaterThan)
-#define QCOMPARE_GE(lhs, rhs) QCOMPARE_OP_IMPL(lhs, rhs, >=, GreaterThanOrEqual)
+#define QCOMPARE_EQ(computed, baseline) QCOMPARE_OP_IMPL(computed, baseline, ==, Equal)
+#define QCOMPARE_NE(computed, baseline) QCOMPARE_OP_IMPL(computed, baseline, !=, NotEqual)
+#define QCOMPARE_LT(computed, baseline) QCOMPARE_OP_IMPL(computed, baseline, <, LessThan)
+#define QCOMPARE_LE(computed, baseline) QCOMPARE_OP_IMPL(computed, baseline, <=, LessThanOrEqual)
+#define QCOMPARE_GT(computed, baseline) QCOMPARE_OP_IMPL(computed, baseline, >, GreaterThan)
+#define QCOMPARE_GE(computed, baseline) QCOMPARE_OP_IMPL(computed, baseline, >=, GreaterThanOrEqual)
#ifndef QT_NO_EXCEPTIONS
@@ -209,41 +209,41 @@ do { \
#define QTRY_COMPARE(expr, expected) QTRY_COMPARE_WITH_TIMEOUT(expr, expected, 5000)
-#define QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(left, right, op, opId, timeout) \
+#define QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(computed, baseline, op, opId, timeout) \
do { \
- QTRY_IMPL(((left) op (right)), timeout) \
- QCOMPARE_OP_IMPL(left, right, op, opId); \
+ QTRY_IMPL(((computed) op (baseline)), timeout) \
+ QCOMPARE_OP_IMPL(computed, baseline, op, opId); \
} while (false)
-#define QTRY_COMPARE_EQ_WITH_TIMEOUT(left, right, timeout) \
- QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(left, right, ==, Equal, timeout)
+#define QTRY_COMPARE_EQ_WITH_TIMEOUT(computed, baseline, timeout) \
+ QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(computed, baseline, ==, Equal, timeout)
-#define QTRY_COMPARE_EQ(left, right) QTRY_COMPARE_EQ_WITH_TIMEOUT(left, right, 5000)
+#define QTRY_COMPARE_EQ(computed, baseline) QTRY_COMPARE_EQ_WITH_TIMEOUT(computed, baseline, 5000)
-#define QTRY_COMPARE_NE_WITH_TIMEOUT(left, right, timeout) \
- QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(left, right, !=, NotEqual, timeout)
+#define QTRY_COMPARE_NE_WITH_TIMEOUT(computed, baseline, timeout) \
+ QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(computed, baseline, !=, NotEqual, timeout)
-#define QTRY_COMPARE_NE(left, right) QTRY_COMPARE_NE_WITH_TIMEOUT(left, right, 5000)
+#define QTRY_COMPARE_NE(computed, baseline) QTRY_COMPARE_NE_WITH_TIMEOUT(computed, baseline, 5000)
-#define QTRY_COMPARE_LT_WITH_TIMEOUT(left, right, timeout) \
- QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(left, right, <, LessThan, timeout)
+#define QTRY_COMPARE_LT_WITH_TIMEOUT(computed, baseline, timeout) \
+ QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(computed, baseline, <, LessThan, timeout)
-#define QTRY_COMPARE_LT(left, right) QTRY_COMPARE_LT_WITH_TIMEOUT(left, right, 5000)
+#define QTRY_COMPARE_LT(computed, baseline) QTRY_COMPARE_LT_WITH_TIMEOUT(computed, baseline, 5000)
-#define QTRY_COMPARE_LE_WITH_TIMEOUT(left, right, timeout) \
- QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(left, right, <=, LessThanOrEqual, timeout)
+#define QTRY_COMPARE_LE_WITH_TIMEOUT(computed, baseline, timeout) \
+ QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(computed, baseline, <=, LessThanOrEqual, timeout)
-#define QTRY_COMPARE_LE(left, right) QTRY_COMPARE_LE_WITH_TIMEOUT(left, right, 5000)
+#define QTRY_COMPARE_LE(computed, baseline) QTRY_COMPARE_LE_WITH_TIMEOUT(computed, baseline, 5000)
-#define QTRY_COMPARE_GT_WITH_TIMEOUT(left, right, timeout) \
- QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(left, right, >, GreaterThan, timeout)
+#define QTRY_COMPARE_GT_WITH_TIMEOUT(computed, baseline, timeout) \
+ QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(computed, baseline, >, GreaterThan, timeout)
-#define QTRY_COMPARE_GT(left, right) QTRY_COMPARE_GT_WITH_TIMEOUT(left, right, 5000)
+#define QTRY_COMPARE_GT(computed, baseline) QTRY_COMPARE_GT_WITH_TIMEOUT(computed, baseline, 5000)
-#define QTRY_COMPARE_GE_WITH_TIMEOUT(left, right, timeout) \
- QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(left, right, >=, GreaterThanOrEqual, timeout)
+#define QTRY_COMPARE_GE_WITH_TIMEOUT(computed, baseline, timeout) \
+ QTRY_COMPARE_OP_WITH_TIMEOUT_IMPL(computed, baseline, >=, GreaterThanOrEqual, timeout)
-#define QTRY_COMPARE_GE(left, right) QTRY_COMPARE_GE_WITH_TIMEOUT(left, right, 5000)
+#define QTRY_COMPARE_GE(computed, baseline) QTRY_COMPARE_GE_WITH_TIMEOUT(computed, baseline, 5000)
#define QSKIP_INTERNAL(statement) \
do {\
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc
index dd47398e6d..823214a8c4 100644
--- a/src/testlib/qtestcase.qdoc
+++ b/src/testlib/qtestcase.qdoc
@@ -137,18 +137,18 @@
QCOMPARE_GT(), QCOMPARE_GE()
*/
-/*! \macro QCOMPARE_EQ(left, right)
+/*! \macro QCOMPARE_EQ(computed, baseline)
\since 6.4
\relates QTest
- The QCOMPARE_EQ() macro checks that \a left is equal to \a right using
+ The QCOMPARE_EQ() macro checks that \a computed is equal to \a baseline using
the equality operator. If that is true, execution continues. If not, a
failure is recorded in the test log and the test function returns without
attempting any later checks.
- It is generally similar to calling \c {QVERIFY(left == right);}
- but prints a formatted error message reporting \a left and \a right argument
+ It is generally similar to calling \c {QVERIFY(computed == baseline);}
+ but prints a formatted error message reporting \a computed and \a baseline argument
expressions and values in case of failure.
\include qtestcase.qdoc macro-usage-limitation
@@ -164,18 +164,18 @@
QCOMPARE_GE()
*/
-/*! \macro QCOMPARE_NE(left, right)
+/*! \macro QCOMPARE_NE(computed, baseline)
\since 6.4
\relates QTest
- The QCOMPARE_NE() macro checks that \a left is not equal to \a right using
+ The QCOMPARE_NE() macro checks that \a computed is not equal to \a baseline using
the inequality operator. If that is true, execution continues. If not, a
failure is recorded in the test log and the test function returns without
attempting any later checks.
- It is generally similar to calling \c {QVERIFY(left != right);}
- but prints a formatted error message reporting \a left and \a right argument
+ It is generally similar to calling \c {QVERIFY(computed != baseline);}
+ but prints a formatted error message reporting \a computed and \a baseline argument
expressions and values in case of failure.
\include qtestcase.qdoc macro-usage-limitation
@@ -185,18 +185,18 @@
\sa QCOMPARE_EQ(), QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GT(), QCOMPARE_GE()
*/
-/*! \macro QCOMPARE_LT(left, right)
+/*! \macro QCOMPARE_LT(computed, baseline)
\since 6.4
\relates QTest
- The QCOMPARE_LT() macro checks that \a left is less than \a right using the
+ The QCOMPARE_LT() macro checks that \a computed is less than \a baseline using the
less-than operator. If that is true, execution continues. If not, a failure
is recorded in the test log and the test function returns without attempting
any later checks.
- It is generally similar to calling \c {QVERIFY(left < right);}
- but prints a formatted error message reporting \a left and \a right argument
+ It is generally similar to calling \c {QVERIFY(computed < baseline);}
+ but prints a formatted error message reporting \a computed and \a baseline argument
expressions and values in case of failure.
\include qtestcase.qdoc macro-usage-limitation
@@ -206,18 +206,18 @@
\sa QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LE(), QCOMPARE_GT(), QCOMPARE_GE()
*/
-/*! \macro QCOMPARE_LE(left, right)
+/*! \macro QCOMPARE_LE(computed, baseline)
\since 6.4
\relates QTest
- The QCOMPARE_LE() macro checks that \a left is at most \a right using the
+ The QCOMPARE_LE() macro checks that \a computed is at most \a baseline using the
less-than-or-equal-to operator. If that is true, execution continues. If
not, a failure is recorded in the test log and the test function returns
without attempting any later checks.
- It is generally similar to calling \c {QVERIFY(left <= right);}
- but prints a formatted error message reporting \a left and \a right argument
+ It is generally similar to calling \c {QVERIFY(computed <= baseline);}
+ but prints a formatted error message reporting \a computed and \a baseline argument
expressions and values in case of failure.
\include qtestcase.qdoc macro-usage-limitation
@@ -227,18 +227,18 @@
\sa QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_GT(), QCOMPARE_GE()
*/
-/*! \macro QCOMPARE_GT(left, right)
+/*! \macro QCOMPARE_GT(computed, baseline)
\since 6.4
\relates QTest
- The QCOMPARE_GT() macro checks that \a left is greater than \a right using
+ The QCOMPARE_GT() macro checks that \a computed is greater than \a baseline using
the greater-than operator. If that is true, execution continues. If not, a
failure is recorded in the test log and the test function returns without
attempting any later checks.
- It is generally similar to calling \c {QVERIFY(left > right);}
- but prints a formatted error message reporting \a left and \a right argument
+ It is generally similar to calling \c {QVERIFY(computed > baseline);}
+ but prints a formatted error message reporting \a computed and \a baseline argument
expressions and values in case of failure.
\include qtestcase.qdoc macro-usage-limitation
@@ -248,18 +248,18 @@
\sa QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GE()
*/
-/*! \macro QCOMPARE_GE(left, right)
+/*! \macro QCOMPARE_GE(computed, baseline)
\since 6.4
\relates QTest
- The QCOMPARE_GE() macro checks that \a left is at least \a right using the
+ The QCOMPARE_GE() macro checks that \a computed is at least \a baseline using the
greater-than-or-equal-to operator. If that is true, execution continues. If
not, a failure is recorded in the test log and the test function returns
without attempting any later checks.
- It is generally similar to calling \c {QVERIFY(left >= right);}
- but prints a formatted error message reporting \a left and \a right argument
+ It is generally similar to calling \c {QVERIFY(computed >= baseline);}
+ but prints a formatted error message reporting \a computed and \a baseline argument
expressions and values in case of failure.
\include qtestcase.qdoc macro-usage-limitation
@@ -455,12 +455,12 @@
QEXPECT_FAIL()
*/
-/*! \macro QTRY_COMPARE_EQ_WITH_TIMEOUT(left, right, timeout)
+/*! \macro QTRY_COMPARE_EQ_WITH_TIMEOUT(computed, baseline, timeout)
\since 6.4
\relates QTest
This macro is similar to QCOMPARE_EQ(), but performs the comparison of the
- \a left and \a right values repeatedly, until either the comparison returns
+ \a computed and \a baseline values repeatedly, until either the comparison returns
\c true or the \a timeout (in milliseconds) is reached. Between each
comparison, events will be processed. If the timeout is reached, a failure
is recorded in the test log and the test won't be executed further.
@@ -470,11 +470,11 @@
\sa QCOMPARE_EQ(), QTRY_COMPARE_EQ()
*/
-/*! \macro QTRY_COMPARE_EQ(left, right)
+/*! \macro QTRY_COMPARE_EQ(computed, baseline)
\since 6.4
\relates QTest
- Performs comparison of \a left and \a right values by invoking
+ Performs comparison of \a computed and \a baseline values by invoking
QTRY_COMPARE_EQ_WITH_TIMEOUT with a timeout of five seconds.
\include qtestcase.qdoc macro-usage-limitation
@@ -482,12 +482,12 @@
\sa QCOMPARE_EQ(), QTRY_COMPARE_EQ_WITH_TIMEOUT()
*/
-/*! \macro QTRY_COMPARE_NE_WITH_TIMEOUT(left, right, timeout)
+/*! \macro QTRY_COMPARE_NE_WITH_TIMEOUT(computed, baseline, timeout)
\since 6.4
\relates QTest
This macro is similar to QCOMPARE_NE(), but performs the comparison of the
- \a left and \a right values repeatedly, until either the comparison returns
+ \a computed and \a baseline values repeatedly, until either the comparison returns
\c true or the \a timeout (in milliseconds) is reached. Between each
comparison, events will be processed. If the timeout is reached, a failure
is recorded in the test log and the test won't be executed further.
@@ -497,11 +497,11 @@
\sa QCOMPARE_NE(), QTRY_COMPARE_NE()
*/
-/*! \macro QTRY_COMPARE_NE(left, right)
+/*! \macro QTRY_COMPARE_NE(computed, baseline)
\since 6.4
\relates QTest
- Performs comparison of \a left and \a right values by invoking
+ Performs comparison of \a computed and \a baseline values by invoking
QTRY_COMPARE_NE_WITH_TIMEOUT with a timeout of five seconds.
\include qtestcase.qdoc macro-usage-limitation
@@ -509,12 +509,12 @@
\sa QCOMPARE_NE(), QTRY_COMPARE_NE_WITH_TIMEOUT()
*/
-/*! \macro QTRY_COMPARE_LT_WITH_TIMEOUT(left, right, timeout)
+/*! \macro QTRY_COMPARE_LT_WITH_TIMEOUT(computed, baseline, timeout)
\since 6.4
\relates QTest
This macro is similar to QCOMPARE_LT(), but performs the comparison of the
- \a left and \a right values repeatedly, until either the comparison returns
+ \a computed and \a baseline values repeatedly, until either the comparison returns
\c true or the \a timeout (in milliseconds) is reached. Between each
comparison, events will be processed. If the timeout is reached, a failure
is recorded in the test log and the test won't be executed further.
@@ -524,11 +524,11 @@
\sa QCOMPARE_LT(), QTRY_COMPARE_LT()
*/
-/*! \macro QTRY_COMPARE_LT(left, right)
+/*! \macro QTRY_COMPARE_LT(computed, baseline)
\since 6.4
\relates QTest
- Performs comparison of \a left and \a right values by invoking
+ Performs comparison of \a computed and \a baseline values by invoking
QTRY_COMPARE_LT_WITH_TIMEOUT with a timeout of five seconds.
\include qtestcase.qdoc macro-usage-limitation
@@ -536,12 +536,12 @@
\sa QCOMPARE_LT(), QTRY_COMPARE_LT_WITH_TIMEOUT()
*/
-/*! \macro QTRY_COMPARE_LE_WITH_TIMEOUT(left, right, timeout)
+/*! \macro QTRY_COMPARE_LE_WITH_TIMEOUT(computed, baseline, timeout)
\since 6.4
\relates QTest
This macro is similar to QCOMPARE_LE(), but performs the comparison of the
- \a left and \a right values repeatedly, until either the comparison returns
+ \a computed and \a baseline values repeatedly, until either the comparison returns
\c true or the \a timeout (in milliseconds) is reached. Between each
comparison, events will be processed. If the timeout is reached, a failure
is recorded in the test log and the test won't be executed further.
@@ -551,11 +551,11 @@
\sa QCOMPARE_LE(), QTRY_COMPARE_LE()
*/
-/*! \macro QTRY_COMPARE_LE(left, right)
+/*! \macro QTRY_COMPARE_LE(computed, baseline)
\since 6.4
\relates QTest
- Performs comparison of \a left and \a right values by invoking
+ Performs comparison of \a computed and \a baseline values by invoking
QTRY_COMPARE_LE_WITH_TIMEOUT with a timeout of five seconds.
\include qtestcase.qdoc macro-usage-limitation
@@ -563,12 +563,12 @@
\sa QCOMPARE_LE(), QTRY_COMPARE_LE_WITH_TIMEOUT()
*/
-/*! \macro QTRY_COMPARE_GT_WITH_TIMEOUT(left, right, timeout)
+/*! \macro QTRY_COMPARE_GT_WITH_TIMEOUT(computed, baseline, timeout)
\since 6.4
\relates QTest
This macro is similar to QCOMPARE_GT(), but performs the comparison of the
- \a left and \a right values repeatedly, until either the comparison returns
+ \a computed and \a baseline values repeatedly, until either the comparison returns
\c true or the \a timeout (in milliseconds) is reached. Between each
comparison, events will be processed. If the timeout is reached, a failure
is recorded in the test log and the test won't be executed further.
@@ -578,11 +578,11 @@
\sa QCOMPARE_GT(), QTRY_COMPARE_GT()
*/
-/*! \macro QTRY_COMPARE_GT(left, right)
+/*! \macro QTRY_COMPARE_GT(computed, baseline)
\since 6.4
\relates QTest
- Performs comparison of \a left and \a right values by invoking
+ Performs comparison of \a computed and \a baseline values by invoking
QTRY_COMPARE_GT_WITH_TIMEOUT with a timeout of five seconds.
\include qtestcase.qdoc macro-usage-limitation
@@ -590,12 +590,12 @@
\sa QCOMPARE_GT(), QTRY_COMPARE_GT_WITH_TIMEOUT()
*/
-/*! \macro QTRY_COMPARE_GE_WITH_TIMEOUT(left, right, timeout)
+/*! \macro QTRY_COMPARE_GE_WITH_TIMEOUT(computed, baseline, timeout)
\since 6.4
\relates QTest
This macro is similar to QCOMPARE_GE(), but performs the comparison of the
- \a left and \a right values repeatedly, until either the comparison returns
+ \a computed and \a baseline values repeatedly, until either the comparison returns
\c true or the \a timeout (in milliseconds) is reached. Between each
comparison, events will be processed. If the timeout is reached, a failure
is recorded in the test log and the test won't be executed further.
@@ -605,11 +605,11 @@
\sa QCOMPARE_GE(), QTRY_COMPARE_GE()
*/
-/*! \macro QTRY_COMPARE_GE(left, right)
+/*! \macro QTRY_COMPARE_GE(computed, baseline)
\since 6.4
\relates QTest
- Performs comparison of \a left and \a right values by invoking
+ Performs comparison of \a computed and \a baseline values by invoking
QTRY_COMPARE_GE_WITH_TIMEOUT with a timeout of five seconds.
\include qtestcase.qdoc macro-usage-limitation
diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp
index 00799a02da..e3545802cb 100644
--- a/src/testlib/qtestresult.cpp
+++ b/src/testlib/qtestresult.cpp
@@ -313,12 +313,12 @@ bool QTestResult::verify(bool statement, const char *statementStr,
static const char *leftArgNameForOp(QTest::ComparisonOperation op)
{
- return op == QTest::ComparisonOperation::CustomCompare ? "Actual " : "Left ";
+ return op == QTest::ComparisonOperation::CustomCompare ? "Actual " : "Computed ";
}
static const char *rightArgNameForOp(QTest::ComparisonOperation op)
{
- return op == QTest::ComparisonOperation::CustomCompare ? "Expected " : "Right ";
+ return op == QTest::ComparisonOperation::CustomCompare ? "Expected " : "Baseline ";
}
// Overload to format failures for "const char *" - no need to strdup().
@@ -609,17 +609,17 @@ static const char *failureMessageForOp(QTest::ComparisonOperation op)
case ComparisonOperation::CustomCompare:
return "Compared values are not the same"; /* not used */
case ComparisonOperation::Equal:
- return "Left value is expected to be equal to right value, but is not";
+ return "The computed value is expected to be equal to the baseline, but is not";
case ComparisonOperation::NotEqual:
- return "Left value is expected to be different from right value, but is not";
+ return "The computed value is expected to be different from the baseline, but is not";
case ComparisonOperation::LessThan:
- return "Left value is expected to be less than right value, but is not";
+ return "The computed value is expected to be less than the baseline, but is not";
case ComparisonOperation::LessThanOrEqual:
- return "Left value is expected to be less than or equal to right value, but is not";
+ return "The computed value is expected to be less than or equal to the baseline, but is not";
case ComparisonOperation::GreaterThan:
- return "Left value is expected to be greater than right value, but is not";
+ return "The computed value is expected to be greater than the baseline, but is not";
case ComparisonOperation::GreaterThanOrEqual:
- return "Left value is expected to be greater than or equal to right value, but is not";
+ return "The computed value is expected to be greater than or equal to the baseline, but is not";
}
Q_UNREACHABLE_RETURN("");
}