diff options
author | Tatiana Borisova <[email protected]> | 2024-06-04 11:15:02 +0200 |
---|---|---|
committer | Tatiana Borisova <[email protected]> | 2024-11-14 13:52:13 +0100 |
commit | 454f010e58b4f17df5d2683233e92448097d2dd1 (patch) | |
tree | dca491f6ebb14d623b394405b3bdad67b51a17f6 | |
parent | 1e714bb0fc45e333d7f9f52a9586aee06e9178e8 (diff) |
Create a QCOMPARE_3WAY macro to test the C++20 spaceship operator <=>
Since the C++20 spaceship operator <=> appeared in the standard,
qtest framework starts using it for tests. To make the way of
usage the spaceship operator convenient and informative,
the QCOMPARE_3WAY macro is added.
- Add QCOMPARE_3WAY macro usage testcases.
- Add threewaycompare test to setftests.
[ChangeLog][QtTest] Added the QCOMPARE_3WAY macro. The macro
tests the C++20 spaceship operator <=>
Fixes: QTBUG-104108
Change-Id: Ia14b26c1d70625ac8c6cf2278d597b2a8cbe31d0
Reviewed-by: Marc Mutz <[email protected]>
19 files changed, 2443 insertions, 9 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 3c6d1adb34e..8431a9daeef 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2836,6 +2836,54 @@ bool QTest::compare_helper(bool success, const char *failureMsg, file, line, failureMsg); } + +/*! \internal + \since 6.9 + This function reports the result of a three-way comparison, when needed. + + Aside from logging every check if in verbose mode and reporting an + unexpected pass when failure was expected, if \a success is \c true + this produces no output. Otherwise, a failure is reported. The output + on failure reports the expressions compared, their values, the actual + result of the comparison and the expected result of comparison, along + with the supplied failure message \a failureMsg and the \a file and + \a line number at which the error arose. + + The expressions compared are supplied as \a lhsExpression and + \a rhsExpression. + These are combined, with \c{"<=>"}, to obtain the actual comparison + expression. Their actual values are pointed to by \a lhsPtr and + \a rhsPtr, which are formatted by \a lhsFormatter and \a rhsFormatter + as, respectively, \c lhsFormatter(lhsPtr) and \c rhsFormatter(rhsPtr). + The actual comparison expression is contrasted, + in the output, with the expected comparison expression + \a expectedExpression. Their respective values are supplied by + \a actualOrderPtr and \a expectedOrderPtr pointers, which are + formatted by \a orderFormatter. + + If \a failureMsg is \nullptr a default is used. If a formatter + function returns \a nullptr, the text \c{"<null>"} is used. +*/ +bool QTest::compare_3way_helper(bool success, const char *failureMsg, + const void *lhsPtr, const void *rhsPtr, + const char *(*lhsFormatter)(const void*), + const char *(*rhsFormatter)(const void*), + const char *lhsExpression, const char *rhsExpression, + const char *(*orderFormatter)(const void*), + const void *actualOrderPtr, const void *expectedOrderPtr, + const char *expectedExpression, + const char *file, int line) +{ + return QTestResult::report3WayResult(success, failureMsg, + lhsPtr, rhsPtr, + lhsFormatter, rhsFormatter, + lhsExpression, rhsExpression, + orderFormatter, + actualOrderPtr, expectedOrderPtr, + expectedExpression, + file, line); +} + /*! \internal \since 6.4 This function is called by various specializations of QTest::qCompare diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 6e7be04ba0a..033b2668252 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -14,7 +14,12 @@ #include <QtCore/qsharedpointer.h> #include <QtCore/qtemporarydir.h> #include <QtCore/qthread.h> + +#ifdef __cpp_concepts +#include <concepts> +#endif #include <QtCore/qxpfunctional.h> +#include <QtCore/qxptype_traits.h> #include <QtCore/q20utility.h> #include <string.h> @@ -288,6 +293,17 @@ do {\ QTEST_FAIL_ACTION; \ } while (false) +#ifdef __cpp_lib_three_way_comparison +#define QCOMPARE_3WAY(lhs, rhs, order) \ +do { \ + if (!QTest::qCompare3Way(lhs, rhs, order, #lhs, #rhs, #order, __FILE__, __LINE__)) \ + QTEST_FAIL_ACTION; \ +} while (false) +#else +#define QCOMPARE_3WAY(...) \ + static_assert(false, "QCOMPARE_3WAY test requires C++20 operator<=>()") +#endif // __cpp_lib_three_way_comparison + #ifdef QT_TESTCASE_BUILDDIR #ifndef QT_TESTCASE_SOURCEDIR @@ -499,6 +515,17 @@ namespace QTest const char *actual, const char *expected, const char *file, int line); + Q_TESTLIB_EXPORT bool compare_3way_helper(bool success, const char *failureMsg, + const void *lhsPtr, const void *rhsPtr, + const char *(*lhsFormatter)(const void*), + const char *(*rhsFormatter)(const void*), + const char *lhsStr, const char *rhsStr, + const char *(*orderFormatter)(const void *), + const void *actualOrderPtr, + const void *expectedOrderPtr, + const char *expectedExpression, + const char *file, int line); + Q_TESTLIB_EXPORT void addColumnInternal(int id, const char *name); template <typename T> @@ -754,8 +781,54 @@ namespace QTest bool result = Comparator::compare(std::forward<T1>(lhs), std::forward<T2>(rhs)); return doReport(result, std::forward<T1>(lhs), std::forward<T2>(rhs)); } -} +#if defined(__cpp_lib_three_way_comparison) + template <typename OrderingType, typename LHS, typename RHS = LHS> + inline bool qCompare3Way(LHS &&lhs, RHS &&rhs, OrderingType order, + const char *lhsExpression, + const char *rhsExpression, + const char *resultExpression, + const char *file, int line) + { +#if defined(__cpp_concepts) + static_assert(requires { lhs <=> rhs; }, + "The three-way comparison operator (<=>) is not implemented"); +#endif // __cpp_concepts + static_assert(QtOrderingPrivate::is_ordering_type_v<OrderingType>, + "Please provide, as the order parameter, a value " + "of one of the Qt::{partial,weak,strong}_ordering or " + "std::{partial,weak,strong}_ordering types."); + + const auto comparisonResult = std::forward<LHS>(lhs) <=> std::forward<RHS>(rhs); + static_assert(std::is_same_v<decltype(QtOrderingPrivate::to_Qt(comparisonResult)), + decltype(QtOrderingPrivate::to_Qt(order))>, + "The expected and actual ordering types should be the same " + "strength for proper comparison."); + + const OrderingType actualOrder = comparisonResult; + using DLHS = q20::remove_cvref_t<LHS>; + using DRHS = q20::remove_cvref_t<RHS>; + using Internal::genericToString; + + return compare_3way_helper(actualOrder == order, + "The result of operator<=>() is not what was expected", + std::addressof(lhs), std::addressof(rhs), + genericToString<DLHS>, genericToString<DRHS>, + lhsExpression, rhsExpression, + genericToString<OrderingType>, + std::addressof(actualOrder), std::addressof(order), + resultExpression, file, line); + } +#else + template <typename OrderingType, typename LHS, typename RHS = LHS> + void qCompare3Way(LHS &&lhs, RHS &&rhs, OrderingType order, + const char *lhsExpression, + const char *rhsExpression, + const char *resultExpression, + const char *file, int line) = delete; +#endif // __cpp_lib_three_way_comparison + +} #define QWARN(msg) QTest::qWarn(static_cast<const char *>(msg), __FILE__, __LINE__) diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc index 7614f67312b..a736b18865f 100644 --- a/src/testlib/qtestcase.qdoc +++ b/src/testlib/qtestcase.qdoc @@ -269,6 +269,36 @@ \sa QCOMPARE_EQ(), QCOMPARE_NE(), QCOMPARE_LT(), QCOMPARE_LE(), QCOMPARE_GT() */ +/*! \macro QCOMPARE_3WAY(lhs, rhs, order) + \since 6.9 + + \relates QTest + + The QCOMPARE_3WAY() macro applies the three-way comparison operator \c {<=>} + to the input expressions \a lhs and \a rhs, and checks if the result + is \a order. + 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. + The macro only accepts Qt:: and std:: ordering types as \a order + argument, otherwise it asserts. + \note \a order can be a Qt:: ordering type even if a + \c {decltype(lhs <=> rhs)} is a std one. + The result of \c {decltype(lhs <=> rhs)} operation should have the same + strength as \a order. Otherwise, applying the macro will result in + a compilation error. For example, if the result of \c {decltype(lhs <=> rhs)} + has a weak ordering type, the \a order argument can't have partial + or strong ordering types. + \note The macro only works if the compiler supports the \c{<=>} operator, + and otherwise it statically asserts that the prerequisite feature + isn't available. Before a macro usage always check if + \c __cpp_lib_three_way_comparison is defined, and use QSKIP, if it isn't. + + \include qtestcase.qdoc macro-usage-limitation + + \include qtestcase.qdoc to-string-overload-desc +*/ + /*! \macro QVERIFY_EXCEPTION_THROWN(expression, exceptiontype) \since 5.3 diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp index a9f42cbf5e2..0ad7eee8f25 100644 --- a/src/testlib/qtestresult.cpp +++ b/src/testlib/qtestresult.cpp @@ -321,12 +321,38 @@ bool QTestResult::verify(bool statement, const char *statementStr, static const char *leftArgNameForOp(QTest::ComparisonOperation op) { - return op == QTest::ComparisonOperation::CustomCompare ? "Actual " : "Computed "; + switch (op) { + case QTest::ComparisonOperation::CustomCompare: + return "Actual "; + case QTest::ComparisonOperation::ThreeWayCompare: + return "Left "; + case QTest::ComparisonOperation::Equal: + case QTest::ComparisonOperation::NotEqual: + case QTest::ComparisonOperation::LessThan: + case QTest::ComparisonOperation::LessThanOrEqual: + case QTest::ComparisonOperation::GreaterThan: + case QTest::ComparisonOperation::GreaterThanOrEqual: + return "Computed "; + } + Q_UNREACHABLE_RETURN(""); } static const char *rightArgNameForOp(QTest::ComparisonOperation op) { - return op == QTest::ComparisonOperation::CustomCompare ? "Expected " : "Baseline "; + switch (op) { + case QTest::ComparisonOperation::CustomCompare: + return "Expected "; + case QTest::ComparisonOperation::ThreeWayCompare: + return "Right "; + case QTest::ComparisonOperation::Equal: + case QTest::ComparisonOperation::NotEqual: + case QTest::ComparisonOperation::LessThan: + case QTest::ComparisonOperation::LessThanOrEqual: + case QTest::ComparisonOperation::GreaterThan: + case QTest::ComparisonOperation::GreaterThanOrEqual: + return "Baseline "; + } + Q_UNREACHABLE_RETURN(""); } static int approx_wide_len(const char *s) @@ -632,6 +658,8 @@ static const char *macroNameForOp(QTest::ComparisonOperation op) return "QCOMPARE_GT"; case ComparisonOperation::GreaterThanOrEqual: return "QCOMPARE_GE"; + case ComparisonOperation::ThreeWayCompare: + return "QCOMPARE_3WAY"; } Q_UNREACHABLE_RETURN(""); } @@ -642,6 +670,8 @@ static const char *failureMessageForOp(QTest::ComparisonOperation op) switch (op) { case ComparisonOperation::CustomCompare: return "Compared values are not the same"; /* not used */ + case ComparisonOperation::ThreeWayCompare: + return "The result of operator<=>() is not what was expected"; case ComparisonOperation::Equal: return "The computed value is expected to be equal to the baseline, but is not"; case ComparisonOperation::NotEqual: @@ -696,4 +726,61 @@ bool QTestResult::reportResult(bool success, const void *lhs, const void *rhs, return checkStatement(success, msg, file, line); } +bool QTestResult::report3WayResult(bool success, + const char *failureMessage, + const void *lhs, const void *rhs, + const char *(*lhsFormatter)(const void*), + const char *(*rhsFormatter)(const void*), + const char *lhsExpression, const char *rhsExpression, + const char *(*orderFormatter)(const void*), + const void *actualOrder, const void *expectedOrder, + const char *expectedExpression, + const char *file, int line) +{ + char msg[maxMsgLen]; + msg[0] = '\0'; + + QTEST_ASSERT(lhsExpression); + QTEST_ASSERT(rhsExpression); + QTEST_ASSERT(expectedExpression); + const char *macroName = macroNameForOp(QTest::ComparisonOperation::ThreeWayCompare); + const std::string actualExpression = std::string(lhsExpression) + " <=> " + rhsExpression; + + if (QTestLog::verboseLevel() >= 2) { + std::snprintf(msg, maxMsgLen, "%s(%s, %s, %s)", + macroName, lhsExpression, rhsExpression, expectedExpression); + QTestLog::info(msg, file, line); + } + + if (success) { + if (QTest::expectFailMode) { + std::snprintf(msg, maxMsgLen, "%s(%s, %s, %s) returned TRUE unexpectedly.", + macroName, lhsExpression, rhsExpression, expectedExpression); + } + return checkStatement(success, msg, file, line); + } + const std::unique_ptr<const char[]> lhsStr{lhsFormatter(lhs)}; + const std::unique_ptr<const char[]> rhsStr{rhsFormatter(rhs)}; + + const std::unique_ptr<const char[]> actual{orderFormatter(actualOrder)}; + const std::unique_ptr<const char[]> expected{orderFormatter(expectedOrder)}; + + if (!failureMessage) + failureMessage = failureMessageForOp(QTest::ComparisonOperation::ThreeWayCompare); + + // Left and Right compared parameters of QCOMPARE_3WAY + formatFailMessage(msg, maxMsgLen, failureMessage, + lhsStr.get(), rhsStr.get(), + lhsExpression, rhsExpression, + QTest::ComparisonOperation::ThreeWayCompare); + + // Actual and Expected results of comparison + formatFailMessage(msg + strlen(msg), maxMsgLen - strlen(msg), "", + actual.get(), expected.get(), + actualExpression.c_str(), expectedExpression, + QTest::ComparisonOperation::CustomCompare); + + return checkStatement(success, msg, file, line); +} + QT_END_NAMESPACE diff --git a/src/testlib/qtestresult_p.h b/src/testlib/qtestresult_p.h index e94de64c062..5233644c855 100644 --- a/src/testlib/qtestresult_p.h +++ b/src/testlib/qtestresult_p.h @@ -108,6 +108,17 @@ public: QTest::ComparisonOperation op, const char *file, int line, const char *failureMessage = nullptr); + static bool report3WayResult(bool success, + const char *failureMessage, + const void *lhs, const void *rhs, + const char *(*lhsFormatter)(const void *), + const char *(*rhsFormatter)(const void *), + const char *lhsExpression, const char *rhsExpression, + const char *(*orderFormatter)(const void *), + const void *actualOrder, const void *expectedOrder, + const char *expectedExpression, + const char *file, int line); + private: Q_DISABLE_COPY(QTestResult) }; diff --git a/src/testlib/qttestglobal.h b/src/testlib/qttestglobal.h index 8ede78c2a2f..a726ec8fa7e 100644 --- a/src/testlib/qttestglobal.h +++ b/src/testlib/qttestglobal.h @@ -31,6 +31,7 @@ namespace QTest LessThanOrEqual, GreaterThan, GreaterThanOrEqual, + ThreeWayCompare, }; } diff --git a/tests/auto/corelib/global/qcompare/tst_qcompare.cpp b/tests/auto/corelib/global/qcompare/tst_qcompare.cpp index 8d764ad5257..b79a6661db3 100644 --- a/tests/auto/corelib/global/qcompare/tst_qcompare.cpp +++ b/tests/auto/corelib/global/qcompare/tst_qcompare.cpp @@ -11,6 +11,17 @@ class tst_QCompare: public QObject { Q_OBJECT + + enum TestEnum : int { + Smaller, + Bigger + }; + +#ifdef __cpp_lib_three_way_comparison + template<typename LeftType, typename RightType, typename OrderingType> + void compare3WayHelper(LeftType lhs, RightType rhs, OrderingType order); +#endif + private slots: void legacyPartialOrdering(); void legacyConversions(); @@ -23,6 +34,7 @@ private slots: void is_eq_overloads(); void compareThreeWay(); void unorderedNeqLiteralZero(); + void compare3WayMacro(); }; void tst_QCompare::legacyPartialOrdering() @@ -777,12 +789,7 @@ void tst_QCompare::compareThreeWay() static_assert(noexcept(qCompareThreeWay(std::declval<float>(), std::declval<int>()))); static_assert(noexcept(qCompareThreeWay(std::declval<double>(), std::declval<float>()))); static_assert(noexcept(qCompareThreeWay(std::declval<int>(), std::declval<int>()))); - // enums - enum TestEnum : int { - Smaller, - Bigger - }; static_assert(noexcept(qCompareThreeWay(std::declval<TestEnum>(), std::declval<TestEnum>()))); // pointers @@ -876,5 +883,66 @@ void tst_QCompare::unorderedNeqLiteralZero() QVERIFY(is_neq(qtLegacyUnordered)); } +#ifdef __cpp_lib_three_way_comparison +template<typename LeftType, typename RightType, typename OrderingType> +void tst_QCompare::compare3WayHelper(LeftType lhs, RightType rhs, OrderingType order) +{ + // check Qt ordering type. + QCOMPARE_3WAY(lhs, rhs, QtOrderingPrivate::to_Qt(order)); + // Also check std ordering type. + QCOMPARE_3WAY(lhs, rhs, QtOrderingPrivate::to_std(order)); +} +#endif + +void tst_QCompare::compare3WayMacro() +{ +#ifdef __cpp_lib_three_way_comparison + constexpr std::array comparison_array = {1, 0}; + // for custom types + compare3WayHelper(StringWrapper("ABC"), StringWrapper("abc"), + Qt::weak_ordering::equivalent); + compare3WayHelper(StringWrapper("ABC"), StringWrapper("qwe"), + Qt::weak_ordering::less); + compare3WayHelper(StringWrapper("qwe"), StringWrapper("ABC"), + Qt::weak_ordering::greater); + + compare3WayHelper(StringWrapper("10"), 10, Qt::weak_ordering::equivalent); + compare3WayHelper(StringWrapper("10"), 12, Qt::weak_ordering::less); + compare3WayHelper(StringWrapper("12"), 10, Qt::weak_ordering::greater); + + // reversed compareThreeWay() + compare3WayHelper(10, StringWrapper("12"), Qt::weak_ordering::less); + compare3WayHelper(12, StringWrapper("10"), Qt::weak_ordering::greater); + compare3WayHelper(10, StringWrapper("10"), Qt::weak_ordering::equivalent); + + // built-in types + compare3WayHelper(1, 1.0, Qt::partial_ordering::equivalent); + compare3WayHelper(1, 2, Qt::strong_ordering::less); + compare3WayHelper(2.0f, 1.0, Qt::partial_ordering::greater); + + // enums + compare3WayHelper(Smaller, Bigger, Qt::strong_ordering::less); + + // pointers + compare3WayHelper(&comparison_array[1], &comparison_array[0], Qt::strong_ordering::greater); + compare3WayHelper(comparison_array.data(), + &comparison_array[0], Qt::strong_ordering::equivalent); + + const QString lhs = QStringLiteral("abc"); + + // We don't want to put those into test data since we want to specifically test comparison + // against inline string literals. + compare3WayHelper(lhs, u"", Qt::strong_ordering::greater); + compare3WayHelper(lhs, u"abc", Qt::strong_ordering::equal); + compare3WayHelper(lhs, u"abcd", Qt::strong_ordering::less); + + compare3WayHelper(lhs, "", Qt::strong_ordering::greater); + compare3WayHelper(lhs, "abc", Qt::strong_ordering::equal); + compare3WayHelper(lhs, "abcd", Qt::strong_ordering::less); +#else + QSKIP("This test requires C++20 comparison support enabled in the standard library"); +#endif +} + QTEST_MAIN(tst_QCompare) #include "tst_qcompare.moc" diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt index 366a4404d6e..bd2d42ec7cb 100644 --- a/tests/auto/testlib/selftests/CMakeLists.txt +++ b/tests/auto/testlib/selftests/CMakeLists.txt @@ -112,6 +112,12 @@ set(subprograms watchdog ) +if(FEATURE_cxx20) + list(APPEND subprograms + threewaycompare + ) +endif() + if(TARGET Qt::Gui) list(APPEND subprograms keyboard diff --git a/tests/auto/testlib/selftests/expected_threewaycompare.junitxml b/tests/auto/testlib/selftests/expected_threewaycompare.junitxml new file mode 100644 index 00000000000..e54a88f1f35 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_threewaycompare.junitxml @@ -0,0 +1,298 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<testsuite name="tst_ThreeWayCompare" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="52" failures="34" errors="0" skipped="0" time="@TEST_DURATION@"> + <properties> + <property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/> + <property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/> + <property name="QtBuild" value=""/> + </properties> + <testcase name="initTestCase" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="compareInts(Qt::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="compareInts(Qt::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="compareInts(Qt::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="compareFloats(Qt::partial_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::less]]> + </failure> + </testcase> + <testcase name="compareFloats(Qt::partial_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="compareFloats(Qt::partial_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1.1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::greater + Expected (expectedOrder): Qt::partial_ordering::less]]> + </failure> + </testcase> + <testcase name="compareDoubles(Qt::partial_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::greater]]> + </failure> + </testcase> + <testcase name="compareDoubles(Qt::partial_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 0 + Right (rhs): 0.1 + Actual (lhs <=> rhs) : Qt::partial_ordering::less + Expected (expectedOrder): Qt::partial_ordering::greater]]> + </failure> + </testcase> + <testcase name="compareDoubles(Qt::partial_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="comparePointers(Qt::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="comparePointers(Qt::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="comparePointers(Qt::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="compareToNullptr(Qt::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="compareToNullptr(Qt::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="compareToNullptr(Qt::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="compareUnregisteredEnum(Qt::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less]]> + </failure> + </testcase> + <testcase name="compareUnregisteredEnum(Qt::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="compareUnregisteredEnum(Qt::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less]]> + </failure> + </testcase> + <testcase name="compareRegisteredEnum(Qt::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::greater]]> + </failure> + </testcase> + <testcase name="compareRegisteredEnum(Qt::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): Monday + Right (rhs): Sunday + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::greater]]> + </failure> + </testcase> + <testcase name="compareRegisteredEnum(Qt::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="compareCustomTypes(Qt::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less]]> + </failure> + </testcase> + <testcase name="compareCustomTypes(Qt::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="compareCustomTypes(Qt::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less]]> + </failure> + </testcase> + <testcase name="stdCompareInts(std::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="stdCompareInts(std::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): -2 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="stdCompareInts(std::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): -2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="stdCompareFloats(std::partial_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 2 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::less]]> + </failure> + </testcase> + <testcase name="stdCompareFloats(std::partial_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 2 + Right (rhs): 1.1 + Actual (lhs <=> rhs) : std::partial_ordering::greater + Expected (expectedOrder): std::partial_ordering::less]]> + </failure> + </testcase> + <testcase name="stdCompareFloats(std::partial_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="stdCompareDoubles(std::partial_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 0.15 + Right (rhs): 0.15 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::greater]]> + </failure> + </testcase> + <testcase name="stdCompareDoubles(std::partial_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 0.15 + Right (rhs): 0.25 + Actual (lhs <=> rhs) : std::partial_ordering::less + Expected (expectedOrder): std::partial_ordering::greater]]> + </failure> + </testcase> + <testcase name="stdCompareDoubles(std::partial_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="stdComparePointers(std::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="stdComparePointers(std::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="stdComparePointers(std::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="stdCompareToNullptr(std::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="stdCompareToNullptr(std::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="stdCompareToNullptr(std::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="stdCompareUnregisteredEnum(std::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less]]> + </failure> + </testcase> + <testcase name="stdCompareUnregisteredEnum(std::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less]]> + </failure> + </testcase> + <testcase name="stdCompareUnregisteredEnum(std::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="stdCompareRegisteredEnum(std::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::greater]]> + </failure> + </testcase> + <testcase name="stdCompareRegisteredEnum(std::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): Monday + Right (rhs): Friday + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::greater]]> + </failure> + </testcase> + <testcase name="stdCompareRegisteredEnum(std::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="stdCompareCustomTypes(std::strong_ordering::equivalent)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less]]> + </failure> + </testcase> + <testcase name="stdCompareCustomTypes(std::strong_ordering::less)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> + <testcase name="stdCompareCustomTypes(std::strong_ordering::greater)" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less]]> + </failure> + </testcase> + <testcase name="checkComparisonForTemporaryObjects" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0 + Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1 + Actual (getClassForValue(0).getValuePointer() <=> getClassForValue(1).getValuePointer()): std::strong_ordering::less + Expected (std::strong_ordering::equal) : std::strong_ordering::equal]]> + </failure> + </testcase> + <testcase name="checkWeakComparison" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"> + <failure type="fail" message="The result of operator<=>() is not what was expected"> + <![CDATA[ Left (june) : 2012/06/20 14:33:02.500[CEST] + Right (juneLater): 2012/06/20 14:33:02.501[CEST] + Actual (june <=> juneLater) : Qt::weak_ordering::less + Expected (Qt::weak_ordering::greater): Qt::weak_ordering::greater]]> + </failure> + </testcase> + <testcase name="cleanupTestCase" classname="tst_ThreeWayCompare" time="@TEST_DURATION@"/> +</testsuite> diff --git a/tests/auto/testlib/selftests/expected_threewaycompare.lightxml b/tests/auto/testlib/selftests/expected_threewaycompare.lightxml new file mode 100644 index 00000000000..0c3a45bd645 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_threewaycompare.lightxml @@ -0,0 +1,386 @@ + <Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> + </Environment> + <TestFunction name="initTestCase"> + <Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareInts"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareFloats"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::less]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1.1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::greater + Expected (expectedOrder): Qt::partial_ordering::less]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareDoubles"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::greater]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0.1 + Actual (lhs <=> rhs) : Qt::partial_ordering::less + Expected (expectedOrder): Qt::partial_ordering::greater]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="comparePointers"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareToNullptr"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareUnregisteredEnum"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareRegisteredEnum"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::greater]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Sunday + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::greater]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareCustomTypes"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareInts"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): -2 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): -2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareFloats"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::partial_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::less]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::partial_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1.1 + Actual (lhs <=> rhs) : std::partial_ordering::greater + Expected (expectedOrder): std::partial_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::partial_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareDoubles"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::partial_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0.15 + Right (rhs): 0.15 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::greater]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::partial_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0.15 + Right (rhs): 0.25 + Actual (lhs <=> rhs) : std::partial_ordering::less + Expected (expectedOrder): std::partial_ordering::greater]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::partial_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdComparePointers"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareToNullptr"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareUnregisteredEnum"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareRegisteredEnum"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::greater]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Friday + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::greater]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareCustomTypes"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="checkComparisonForTemporaryObjects"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0 + Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1 + Actual (getClassForValue(0).getValuePointer() <=> getClassForValue(1).getValuePointer()): std::strong_ordering::less + Expected (std::strong_ordering::equal) : std::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="checkWeakComparison"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (june) : 2012/06/20 14:33:02.500[CEST] + Right (juneLater): 2012/06/20 14:33:02.501[CEST] + Actual (june <=> juneLater) : Qt::weak_ordering::less + Expected (Qt::weak_ordering::greater): Qt::weak_ordering::greater]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="cleanupTestCase"> + <Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> + </TestFunction> + <Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_threewaycompare.tap b/tests/auto/testlib/selftests/expected_threewaycompare.tap new file mode 100644 index 00000000000..d05bbe8bd16 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_threewaycompare.tap @@ -0,0 +1,398 @@ +TAP version 13 +# tst_ThreeWayCompare +ok 1 - initTestCase() +ok 2 - compareInts(Qt::strong_ordering::equivalent) +not ok 3 - compareInts(Qt::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal + at: tst_ThreeWayCompare::compareInts() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 4 - compareInts(Qt::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal + at: tst_ThreeWayCompare::compareInts() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 5 - compareFloats(Qt::partial_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::less + at: tst_ThreeWayCompare::compareFloats() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 6 - compareFloats(Qt::partial_ordering::less) +not ok 7 - compareFloats(Qt::partial_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1.1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::greater + Expected (expectedOrder): Qt::partial_ordering::less + at: tst_ThreeWayCompare::compareFloats() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 8 - compareDoubles(Qt::partial_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::greater + at: tst_ThreeWayCompare::compareDoubles() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 9 - compareDoubles(Qt::partial_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0.1 + Actual (lhs <=> rhs) : Qt::partial_ordering::less + Expected (expectedOrder): Qt::partial_ordering::greater + at: tst_ThreeWayCompare::compareDoubles() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 10 - compareDoubles(Qt::partial_ordering::greater) +ok 11 - comparePointers(Qt::strong_ordering::equivalent) +not ok 12 - comparePointers(Qt::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal + at: tst_ThreeWayCompare::comparePointers() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 13 - comparePointers(Qt::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal + at: tst_ThreeWayCompare::comparePointers() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 14 - compareToNullptr(Qt::strong_ordering::equivalent) +not ok 15 - compareToNullptr(Qt::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal + at: tst_ThreeWayCompare::compareToNullptr() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 16 - compareToNullptr(Qt::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal + at: tst_ThreeWayCompare::compareToNullptr() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 17 - compareUnregisteredEnum(Qt::strong_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less + at: tst_ThreeWayCompare::compareUnregisteredEnum() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 18 - compareUnregisteredEnum(Qt::strong_ordering::less) +not ok 19 - compareUnregisteredEnum(Qt::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less + at: tst_ThreeWayCompare::compareUnregisteredEnum() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 20 - compareRegisteredEnum(Qt::strong_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::greater + at: tst_ThreeWayCompare::compareRegisteredEnum() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 21 - compareRegisteredEnum(Qt::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Sunday + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::greater + at: tst_ThreeWayCompare::compareRegisteredEnum() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 22 - compareRegisteredEnum(Qt::strong_ordering::greater) +not ok 23 - compareCustomTypes(Qt::strong_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less + at: tst_ThreeWayCompare::compareCustomTypes() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 24 - compareCustomTypes(Qt::strong_ordering::less) +not ok 25 - compareCustomTypes(Qt::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less + at: tst_ThreeWayCompare::compareCustomTypes() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 26 - stdCompareInts(std::strong_ordering::equivalent) +not ok 27 - stdCompareInts(std::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): -2 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal + at: tst_ThreeWayCompare::stdCompareInts() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 28 - stdCompareInts(std::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): -2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal + at: tst_ThreeWayCompare::stdCompareInts() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 29 - stdCompareFloats(std::partial_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::less + at: tst_ThreeWayCompare::stdCompareFloats() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 30 - stdCompareFloats(std::partial_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1.1 + Actual (lhs <=> rhs) : std::partial_ordering::greater + Expected (expectedOrder): std::partial_ordering::less + at: tst_ThreeWayCompare::stdCompareFloats() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 31 - stdCompareFloats(std::partial_ordering::greater) +not ok 32 - stdCompareDoubles(std::partial_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 0.15 + Right (rhs): 0.15 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::greater + at: tst_ThreeWayCompare::stdCompareDoubles() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 33 - stdCompareDoubles(std::partial_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 0.15 + Right (rhs): 0.25 + Actual (lhs <=> rhs) : std::partial_ordering::less + Expected (expectedOrder): std::partial_ordering::greater + at: tst_ThreeWayCompare::stdCompareDoubles() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 34 - stdCompareDoubles(std::partial_ordering::greater) +ok 35 - stdComparePointers(std::strong_ordering::equivalent) +not ok 36 - stdComparePointers(std::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal + at: tst_ThreeWayCompare::stdComparePointers() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 37 - stdComparePointers(std::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal + at: tst_ThreeWayCompare::stdComparePointers() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 38 - stdCompareToNullptr(std::strong_ordering::equivalent) +not ok 39 - stdCompareToNullptr(std::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal + at: tst_ThreeWayCompare::stdCompareToNullptr() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 40 - stdCompareToNullptr(std::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal + at: tst_ThreeWayCompare::stdCompareToNullptr() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 41 - stdCompareUnregisteredEnum(std::strong_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less + at: tst_ThreeWayCompare::stdCompareUnregisteredEnum() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 42 - stdCompareUnregisteredEnum(std::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less + at: tst_ThreeWayCompare::stdCompareUnregisteredEnum() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 43 - stdCompareUnregisteredEnum(std::strong_ordering::greater) +not ok 44 - stdCompareRegisteredEnum(std::strong_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::greater + at: tst_ThreeWayCompare::stdCompareRegisteredEnum() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 45 - stdCompareRegisteredEnum(std::strong_ordering::less) + --- + # The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Friday + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::greater + at: tst_ThreeWayCompare::stdCompareRegisteredEnum() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 46 - stdCompareRegisteredEnum(std::strong_ordering::greater) +not ok 47 - stdCompareCustomTypes(std::strong_ordering::equivalent) + --- + # The result of operator<=>() is not what was expected + Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less + at: tst_ThreeWayCompare::stdCompareCustomTypes() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 48 - stdCompareCustomTypes(std::strong_ordering::less) +not ok 49 - stdCompareCustomTypes(std::strong_ordering::greater) + --- + # The result of operator<=>() is not what was expected + Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less + at: tst_ThreeWayCompare::stdCompareCustomTypes() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 50 - checkComparisonForTemporaryObjects() + --- + # The result of operator<=>() is not what was expected + Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0 + Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1 + Actual (getClassForValue(0).getValuePointer() <=> getClassForValue(1).getValuePointer()): std::strong_ordering::less + Expected (std::strong_ordering::equal) : std::strong_ordering::equal + at: tst_ThreeWayCompare::checkComparisonForTemporaryObjects() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +not ok 51 - checkWeakComparison() + --- + # The result of operator<=>() is not what was expected + Left (june) : 2012/06/20 14:33:02.500[CEST] + Right (juneLater): 2012/06/20 14:33:02.501[CEST] + Actual (june <=> juneLater) : Qt::weak_ordering::less + Expected (Qt::weak_ordering::greater): Qt::weak_ordering::greater + at: tst_ThreeWayCompare::checkWeakComparison() (qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp:0) + file: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp + line: 0 + ... +ok 52 - cleanupTestCase() +1..52 +# tests 52 +# pass 18 +# fail 34 diff --git a/tests/auto/testlib/selftests/expected_threewaycompare.teamcity b/tests/auto/testlib/selftests/expected_threewaycompare.teamcity new file mode 100644 index 00000000000..07c815fa008 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_threewaycompare.teamcity @@ -0,0 +1,140 @@ +##teamcity[testSuiteStarted name='tst_ThreeWayCompare' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='initTestCase()' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='initTestCase()' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareInts(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareInts(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareInts(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareInts(Qt::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): 2|n Actual (lhs <=> rhs) : Qt::strong_ordering::less|n Expected (expectedOrder): Qt::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareInts(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareInts(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareInts(Qt::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 2|n Right (rhs): 1|n Actual (lhs <=> rhs) : Qt::strong_ordering::greater|n Expected (expectedOrder): Qt::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareInts(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareFloats(Qt::partial_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareFloats(Qt::partial_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): 1|n Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent|n Expected (expectedOrder): Qt::partial_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareFloats(Qt::partial_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareFloats(Qt::partial_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareFloats(Qt::partial_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareFloats(Qt::partial_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareFloats(Qt::partial_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1.1|n Right (rhs): 1|n Actual (lhs <=> rhs) : Qt::partial_ordering::greater|n Expected (expectedOrder): Qt::partial_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareFloats(Qt::partial_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareDoubles(Qt::partial_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareDoubles(Qt::partial_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 0|n Right (rhs): 0|n Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent|n Expected (expectedOrder): Qt::partial_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareDoubles(Qt::partial_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareDoubles(Qt::partial_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareDoubles(Qt::partial_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 0|n Right (rhs): 0.1|n Actual (lhs <=> rhs) : Qt::partial_ordering::less|n Expected (expectedOrder): Qt::partial_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareDoubles(Qt::partial_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareDoubles(Qt::partial_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareDoubles(Qt::partial_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='comparePointers(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='comparePointers(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='comparePointers(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='comparePointers(Qt::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): 2|n Actual (lhs <=> rhs) : Qt::strong_ordering::less|n Expected (expectedOrder): Qt::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='comparePointers(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='comparePointers(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='comparePointers(Qt::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 2|n Right (rhs): 1|n Actual (lhs <=> rhs) : Qt::strong_ordering::greater|n Expected (expectedOrder): Qt::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='comparePointers(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareToNullptr(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareToNullptr(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareToNullptr(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareToNullptr(Qt::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): "nullptr"|n Right (rhs): 1|n Actual (lhs <=> rhs) : Qt::strong_ordering::less|n Expected (expectedOrder): Qt::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareToNullptr(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareToNullptr(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareToNullptr(Qt::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): "nullptr"|n Actual (lhs <=> rhs) : Qt::strong_ordering::greater|n Expected (expectedOrder): Qt::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareToNullptr(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareUnregisteredEnum(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareUnregisteredEnum(Qt::strong_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 0|n Right (rhs): 0|n Actual (lhs <=> rhs) : Qt::strong_ordering::equal|n Expected (expectedOrder): Qt::strong_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareUnregisteredEnum(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareUnregisteredEnum(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareUnregisteredEnum(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareUnregisteredEnum(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareUnregisteredEnum(Qt::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): 0|n Actual (lhs <=> rhs) : Qt::strong_ordering::greater|n Expected (expectedOrder): Qt::strong_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareUnregisteredEnum(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareRegisteredEnum(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareRegisteredEnum(Qt::strong_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): Monday|n Right (rhs): Monday|n Actual (lhs <=> rhs) : Qt::strong_ordering::equal|n Expected (expectedOrder): Qt::strong_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareRegisteredEnum(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareRegisteredEnum(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareRegisteredEnum(Qt::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): Monday|n Right (rhs): Sunday|n Actual (lhs <=> rhs) : Qt::strong_ordering::less|n Expected (expectedOrder): Qt::strong_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareRegisteredEnum(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareRegisteredEnum(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareRegisteredEnum(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareCustomTypes(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareCustomTypes(Qt::strong_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): MyClass(1)|n Right (rhs): MyClass(1)|n Actual (lhs <=> rhs) : Qt::strong_ordering::equal|n Expected (expectedOrder): Qt::strong_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareCustomTypes(Qt::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareCustomTypes(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareCustomTypes(Qt::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='compareCustomTypes(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='compareCustomTypes(Qt::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): MyClass(2)|n Right (rhs): MyClass(1)|n Actual (lhs <=> rhs) : Qt::strong_ordering::greater|n Expected (expectedOrder): Qt::strong_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='compareCustomTypes(Qt::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareInts(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareInts(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareInts(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareInts(std::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): -2|n Actual (lhs <=> rhs) : std::strong_ordering::greater|n Expected (expectedOrder): std::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareInts(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareInts(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareInts(std::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): -2|n Right (rhs): 1|n Actual (lhs <=> rhs) : std::strong_ordering::less|n Expected (expectedOrder): std::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareInts(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareFloats(std::partial_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareFloats(std::partial_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 2|n Right (rhs): 2|n Actual (lhs <=> rhs) : std::partial_ordering::equivalent|n Expected (expectedOrder): std::partial_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareFloats(std::partial_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareFloats(std::partial_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareFloats(std::partial_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 2|n Right (rhs): 1.1|n Actual (lhs <=> rhs) : std::partial_ordering::greater|n Expected (expectedOrder): std::partial_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareFloats(std::partial_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareFloats(std::partial_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareFloats(std::partial_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareDoubles(std::partial_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareDoubles(std::partial_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 0.15|n Right (rhs): 0.15|n Actual (lhs <=> rhs) : std::partial_ordering::equivalent|n Expected (expectedOrder): std::partial_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareDoubles(std::partial_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareDoubles(std::partial_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareDoubles(std::partial_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 0.15|n Right (rhs): 0.25|n Actual (lhs <=> rhs) : std::partial_ordering::less|n Expected (expectedOrder): std::partial_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareDoubles(std::partial_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareDoubles(std::partial_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareDoubles(std::partial_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdComparePointers(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdComparePointers(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdComparePointers(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdComparePointers(std::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): 2|n Actual (lhs <=> rhs) : std::strong_ordering::less|n Expected (expectedOrder): std::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdComparePointers(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdComparePointers(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdComparePointers(std::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 2|n Right (rhs): 1|n Actual (lhs <=> rhs) : std::strong_ordering::greater|n Expected (expectedOrder): std::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdComparePointers(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareToNullptr(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareToNullptr(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareToNullptr(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareToNullptr(std::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): "nullptr"|n Right (rhs): 1|n Actual (lhs <=> rhs) : std::strong_ordering::less|n Expected (expectedOrder): std::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareToNullptr(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareToNullptr(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareToNullptr(std::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): "nullptr"|n Actual (lhs <=> rhs) : std::strong_ordering::greater|n Expected (expectedOrder): std::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareToNullptr(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareUnregisteredEnum(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareUnregisteredEnum(std::strong_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): 1|n Actual (lhs <=> rhs) : std::strong_ordering::equal|n Expected (expectedOrder): std::strong_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareUnregisteredEnum(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareUnregisteredEnum(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareUnregisteredEnum(std::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): 1|n Right (rhs): 0|n Actual (lhs <=> rhs) : std::strong_ordering::greater|n Expected (expectedOrder): std::strong_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareUnregisteredEnum(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareUnregisteredEnum(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareUnregisteredEnum(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareRegisteredEnum(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareRegisteredEnum(std::strong_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): Monday|n Right (rhs): Monday|n Actual (lhs <=> rhs) : std::strong_ordering::equal|n Expected (expectedOrder): std::strong_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareRegisteredEnum(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareRegisteredEnum(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareRegisteredEnum(std::strong_ordering::less)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): Monday|n Right (rhs): Friday|n Actual (lhs <=> rhs) : std::strong_ordering::less|n Expected (expectedOrder): std::strong_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareRegisteredEnum(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareRegisteredEnum(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareRegisteredEnum(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareCustomTypes(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareCustomTypes(std::strong_ordering::equivalent)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): MyClass(1)|n Right (rhs): MyClass(1)|n Actual (lhs <=> rhs) : std::strong_ordering::equal|n Expected (expectedOrder): std::strong_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareCustomTypes(std::strong_ordering::equivalent)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareCustomTypes(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareCustomTypes(std::strong_ordering::less)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='stdCompareCustomTypes(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='stdCompareCustomTypes(std::strong_ordering::greater)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (lhs): MyClass(2)|n Right (rhs): MyClass(1)|n Actual (lhs <=> rhs) : std::strong_ordering::greater|n Expected (expectedOrder): std::strong_ordering::less' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='stdCompareCustomTypes(std::strong_ordering::greater)' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='checkComparisonForTemporaryObjects()' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='checkComparisonForTemporaryObjects()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0|n Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1|n Actual (getClassForValue(0).getValuePointer() <=> getClassForValue(1).getValuePointer()): std::strong_ordering::less|n Expected (std::strong_ordering::equal) : std::strong_ordering::equal' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='checkComparisonForTemporaryObjects()' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='checkWeakComparison()' flowId='tst_ThreeWayCompare'] +##teamcity[testFailed name='checkWeakComparison()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)|]' details='The result of operator<=>() is not what was expected|n Left (june) : 2012/06/20 14:33:02.500|[CEST|]|n Right (juneLater): 2012/06/20 14:33:02.501|[CEST|]|n Actual (june <=> juneLater) : Qt::weak_ordering::less|n Expected (Qt::weak_ordering::greater): Qt::weak_ordering::greater' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='checkWeakComparison()' flowId='tst_ThreeWayCompare'] +##teamcity[testStarted name='cleanupTestCase()' flowId='tst_ThreeWayCompare'] +##teamcity[testFinished name='cleanupTestCase()' flowId='tst_ThreeWayCompare'] +##teamcity[testSuiteFinished name='tst_ThreeWayCompare' flowId='tst_ThreeWayCompare'] diff --git a/tests/auto/testlib/selftests/expected_threewaycompare.txt b/tests/auto/testlib/selftests/expected_threewaycompare.txt new file mode 100644 index 00000000000..728c85c9201 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_threewaycompare.txt @@ -0,0 +1,226 @@ +********* Start testing of tst_ThreeWayCompare ********* +Config: Using QtTest library +PASS : tst_ThreeWayCompare::initTestCase() +PASS : tst_ThreeWayCompare::compareInts(Qt::strong_ordering::equivalent) +FAIL! : tst_ThreeWayCompare::compareInts(Qt::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::compareInts(Qt::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::compareFloats(Qt::partial_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::compareFloats(Qt::partial_ordering::less) +FAIL! : tst_ThreeWayCompare::compareFloats(Qt::partial_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): 1.1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::greater + Expected (expectedOrder): Qt::partial_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::compareDoubles(Qt::partial_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::compareDoubles(Qt::partial_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0.1 + Actual (lhs <=> rhs) : Qt::partial_ordering::less + Expected (expectedOrder): Qt::partial_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::compareDoubles(Qt::partial_ordering::greater) +PASS : tst_ThreeWayCompare::comparePointers(Qt::strong_ordering::equivalent) +FAIL! : tst_ThreeWayCompare::comparePointers(Qt::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::comparePointers(Qt::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::compareToNullptr(Qt::strong_ordering::equivalent) +FAIL! : tst_ThreeWayCompare::compareToNullptr(Qt::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::compareToNullptr(Qt::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::compareUnregisteredEnum(Qt::strong_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::compareUnregisteredEnum(Qt::strong_ordering::less) +FAIL! : tst_ThreeWayCompare::compareUnregisteredEnum(Qt::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::compareRegisteredEnum(Qt::strong_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::compareRegisteredEnum(Qt::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Sunday + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::compareRegisteredEnum(Qt::strong_ordering::greater) +FAIL! : tst_ThreeWayCompare::compareCustomTypes(Qt::strong_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::compareCustomTypes(Qt::strong_ordering::less) +FAIL! : tst_ThreeWayCompare::compareCustomTypes(Qt::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::stdCompareInts(std::strong_ordering::equivalent) +FAIL! : tst_ThreeWayCompare::stdCompareInts(std::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): -2 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdCompareInts(std::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): -2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdCompareFloats(std::partial_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdCompareFloats(std::partial_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1.1 + Actual (lhs <=> rhs) : std::partial_ordering::greater + Expected (expectedOrder): std::partial_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::stdCompareFloats(std::partial_ordering::greater) +FAIL! : tst_ThreeWayCompare::stdCompareDoubles(std::partial_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): 0.15 + Right (rhs): 0.15 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdCompareDoubles(std::partial_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): 0.15 + Right (rhs): 0.25 + Actual (lhs <=> rhs) : std::partial_ordering::less + Expected (expectedOrder): std::partial_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::stdCompareDoubles(std::partial_ordering::greater) +PASS : tst_ThreeWayCompare::stdComparePointers(std::strong_ordering::equivalent) +FAIL! : tst_ThreeWayCompare::stdComparePointers(std::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdComparePointers(std::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::stdCompareToNullptr(std::strong_ordering::equivalent) +FAIL! : tst_ThreeWayCompare::stdCompareToNullptr(std::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdCompareToNullptr(std::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdCompareUnregisteredEnum(std::strong_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdCompareUnregisteredEnum(std::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::stdCompareUnregisteredEnum(std::strong_ordering::greater) +FAIL! : tst_ThreeWayCompare::stdCompareRegisteredEnum(std::strong_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::stdCompareRegisteredEnum(std::strong_ordering::less) The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Friday + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::stdCompareRegisteredEnum(std::strong_ordering::greater) +FAIL! : tst_ThreeWayCompare::stdCompareCustomTypes(std::strong_ordering::equivalent) The result of operator<=>() is not what was expected + Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::stdCompareCustomTypes(std::strong_ordering::less) +FAIL! : tst_ThreeWayCompare::stdCompareCustomTypes(std::strong_ordering::greater) The result of operator<=>() is not what was expected + Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::checkComparisonForTemporaryObjects() The result of operator<=>() is not what was expected + Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0 + Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1 + Actual (getClassForValue(0).getValuePointer() <=> getClassForValue(1).getValuePointer()): std::strong_ordering::less + Expected (std::strong_ordering::equal) : std::strong_ordering::equal + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +FAIL! : tst_ThreeWayCompare::checkWeakComparison() The result of operator<=>() is not what was expected + Left (june) : 2012/06/20 14:33:02.500[CEST] + Right (juneLater): 2012/06/20 14:33:02.501[CEST] + Actual (june <=> juneLater) : Qt::weak_ordering::less + Expected (Qt::weak_ordering::greater): Qt::weak_ordering::greater + Loc: [qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp(0)] +PASS : tst_ThreeWayCompare::cleanupTestCase() +Totals: 18 passed, 34 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_ThreeWayCompare ********* diff --git a/tests/auto/testlib/selftests/expected_threewaycompare.xml b/tests/auto/testlib/selftests/expected_threewaycompare.xml new file mode 100644 index 00000000000..9bd8c191ca8 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_threewaycompare.xml @@ -0,0 +1,389 @@ +<?xml version="1.0" encoding="UTF-8"?> +<TestCase name="tst_ThreeWayCompare"> + <Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> + </Environment> + <TestFunction name="initTestCase"> + <Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareInts"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareFloats"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::less]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1.1 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::partial_ordering::greater + Expected (expectedOrder): Qt::partial_ordering::less]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareDoubles"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::partial_ordering::equivalent + Expected (expectedOrder): Qt::partial_ordering::greater]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0.1 + Actual (lhs <=> rhs) : Qt::partial_ordering::less + Expected (expectedOrder): Qt::partial_ordering::greater]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::partial_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="comparePointers"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareToNullptr"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareUnregisteredEnum"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareRegisteredEnum"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::greater]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Sunday + Actual (lhs <=> rhs) : Qt::strong_ordering::less + Expected (expectedOrder): Qt::strong_ordering::greater]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="compareCustomTypes"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::equal + Expected (expectedOrder): Qt::strong_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::less]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[Qt::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : Qt::strong_ordering::greater + Expected (expectedOrder): Qt::strong_ordering::less]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareInts"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): -2 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): -2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareFloats"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::partial_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::less]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::partial_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1.1 + Actual (lhs <=> rhs) : std::partial_ordering::greater + Expected (expectedOrder): std::partial_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::partial_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareDoubles"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::partial_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0.15 + Right (rhs): 0.15 + Actual (lhs <=> rhs) : std::partial_ordering::equivalent + Expected (expectedOrder): std::partial_ordering::greater]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::partial_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 0.15 + Right (rhs): 0.25 + Actual (lhs <=> rhs) : std::partial_ordering::less + Expected (expectedOrder): std::partial_ordering::greater]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::partial_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdComparePointers"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 2 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 2 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareToNullptr"> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): "nullptr" + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): "nullptr" + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareUnregisteredEnum"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 1 + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): 1 + Right (rhs): 0 + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareRegisteredEnum"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Monday + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::greater]]></Description> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): Monday + Right (rhs): Friday + Actual (lhs <=> rhs) : std::strong_ordering::less + Expected (expectedOrder): std::strong_ordering::greater]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="stdCompareCustomTypes"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::equivalent]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): MyClass(1) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::equal + Expected (expectedOrder): std::strong_ordering::less]]></Description> + </Incident> + <Incident type="pass" file="" line="0"> + <DataTag><![CDATA[std::strong_ordering::less]]></DataTag> + </Incident> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <DataTag><![CDATA[std::strong_ordering::greater]]></DataTag> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (lhs): MyClass(2) + Right (rhs): MyClass(1) + Actual (lhs <=> rhs) : std::strong_ordering::greater + Expected (expectedOrder): std::strong_ordering::less]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="checkComparisonForTemporaryObjects"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0 + Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1 + Actual (getClassForValue(0).getValuePointer() <=> getClassForValue(1).getValuePointer()): std::strong_ordering::less + Expected (std::strong_ordering::equal) : std::strong_ordering::equal]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="checkWeakComparison"> + <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp" line="0"> + <Description><![CDATA[The result of operator<=>() is not what was expected + Left (june) : 2012/06/20 14:33:02.500[CEST] + Right (juneLater): 2012/06/20 14:33:02.501[CEST] + Actual (june <=> juneLater) : Qt::weak_ordering::less + Expected (Qt::weak_ordering::greater): Qt::weak_ordering::greater]]></Description> + </Incident> + <Duration msecs="0"/> + </TestFunction> + <TestFunction name="cleanupTestCase"> + <Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> + </TestFunction> + <Duration msecs="0"/> +</TestCase> diff --git a/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp b/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp index 5a5fcdfa13b..07fd78ae293 100644 --- a/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp +++ b/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp @@ -17,6 +17,7 @@ switch (Type) { \ case QTest::ComparisonOperation::LessThanOrEqual: QCOMPARE_LE(arg1, arg2); break; \ case QTest::ComparisonOperation::GreaterThan: QCOMPARE_GT(arg1, arg2); break; \ case QTest::ComparisonOperation::GreaterThanOrEqual: QCOMPARE_GE(arg1, arg2); break; \ + case QTest::ComparisonOperation::ThreeWayCompare: break; \ } class MyClass @@ -186,6 +187,7 @@ template <typename T> static void executeComparison() case QTest::ComparisonOperation::LessThanOrEqual: QCOMPARE_LE(lhs, rhs); break; case QTest::ComparisonOperation::GreaterThan: QCOMPARE_GT(lhs, rhs); break; case QTest::ComparisonOperation::GreaterThanOrEqual: QCOMPARE_GE(lhs, rhs); break; + case QTest::ComparisonOperation::ThreeWayCompare: break; } } @@ -329,6 +331,7 @@ void tst_ExtendedCompare::checkComparisonWithTimeout() case QTest::ComparisonOperation::CustomCompare: QFAIL("Unexpected comparison operation"); break; + case QTest::ComparisonOperation::ThreeWayCompare: break; } } diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 350d20fa271..9f7bca678fe 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -39,7 +39,13 @@ TESTS = ['assert', 'badxml', 'benchlibcallgrind', 'benchlibcounting', 'printdatatags', 'printdatatagswithglobaltags', 'qexecstringlist', 'signaldumper', 'silent', 'silent_fatal', 'singleskip', 'skip', 'skipblacklisted', 'skipcleanup', 'skipcleanuptestcase', 'skipinit', - 'skipinitdata', 'sleep', 'strcmp', 'subtest', 'testlib', 'tuplediagnostics', + 'skipinitdata', + 'sleep', + 'strcmp', + 'subtest', + 'testlib', + 'threewaycompare', + 'tuplediagnostics', 'verbose1', 'verbose2', 'verifyexceptionthrown', 'warnings', 'watchdog', 'junit', 'keyboard'] diff --git a/tests/auto/testlib/selftests/threewaycompare/CMakeLists.txt b/tests/auto/testlib/selftests/threewaycompare/CMakeLists.txt new file mode 100644 index 00000000000..f5346ab8400 --- /dev/null +++ b/tests/auto/testlib/selftests/threewaycompare/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_executable(threewaycompare + NO_INSTALL + EXCEPTIONS + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + SOURCES + tst_threewaycompare.cpp + LIBRARIES + Qt::Test +) + +qt_internal_apply_testlib_coverage_options(threewaycompare) diff --git a/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp b/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp new file mode 100644 index 00000000000..bcc544d33a1 --- /dev/null +++ b/tests/auto/testlib/selftests/threewaycompare/tst_threewaycompare.cpp @@ -0,0 +1,243 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QTest> +#include <QtCore/qcompare.h> +#include <QtCore/qdatetime.h> +#include <QtCore/qurl.h> + +QT_BEGIN_NAMESPACE + +class MyClass +{ +public: + MyClass(int v) : m_value(v) {} + int value() const { return m_value; } + void setValue(int v) { m_value = v; } + + friend bool comparesEqual(const MyClass &lhs, const MyClass &rhs) noexcept + { + return lhs.m_value == rhs.m_value; + } + friend Qt::strong_ordering compareThreeWay(const MyClass &lhs, + const MyClass &rhs) noexcept + { + return Qt::compareThreeWay(lhs.m_value, rhs.m_value); + } + Q_DECLARE_STRONGLY_ORDERED(MyClass); +private: + int m_value; +}; +static MyClass arrayOfMyClassValues[] = { MyClass(-1), MyClass(-1) }; + +class ClassWithPointerGetter +{ + Q_DISABLE_COPY_MOVE(ClassWithPointerGetter) +public: + explicit ClassWithPointerGetter(int index) : m_index(index) + { + Q_ASSERT(m_index >= 0 && m_index < 2); + arrayOfMyClassValues[m_index].setValue(indexToValue(m_index)); + } + ~ClassWithPointerGetter() + { + arrayOfMyClassValues[m_index].setValue(-1); + } + + const MyClass *getValuePointer() const { return &arrayOfMyClassValues[m_index]; } + + static int indexToValue(int index) { return 2 - index; } + static int valueToIndex(int value) { return 2 - value; } + +private: + int m_index; +}; + +#ifdef __cpp_lib_three_way_comparison +// An auxiliary function to get a temporary object +static ClassWithPointerGetter getClassForValue(int val) +{ + return ClassWithPointerGetter(val); +} +#endif + +// various toString() overloads +namespace QTest { + +template <> char *toString(const int *const &val) +{ + return val ? toString(*val) : toString(nullptr); +} + +} // namespace QTest + +char *toString(const MyClass &val) +{ + char *msg = new char[128]; + std::snprintf(msg, 128, "MyClass(%d)", val.value()); + return msg; +} + +char *toString(const MyClass *val) +{ + if (val) { + char *msg = new char[128]; + const auto value = val->value(); + std::snprintf(msg, 128, "MyClass(%d) on memory address with index %d", value, + ClassWithPointerGetter::valueToIndex(value)); + return msg; + } + return toString(nullptr); +} + +enum MyUnregisteredEnum { MyUnregisteredEnumValue1, MyUnregisteredEnumValue2 }; + +namespace { +static constexpr int values[] = { 1, 2 }; +static const MyClass val1(1); +static const MyClass val2(2); +static const int *ptr = nullptr; +static const int value = 1; +} + +class tst_ThreeWayCompare : public QObject +{ + Q_OBJECT + +private: + template <typename T, typename OrderingType> + void generateData(T val1, T val2, OrderingType order); + template <typename T, typename OrderingType> void executeComparison(); + +private slots: + void compareInts_data() { generateData(1, 2, Qt::strong_ordering::equal); } + void compareInts() { executeComparison<int, Qt::strong_ordering>(); } + void compareFloats_data() { generateData(1.0f, 1.1f, Qt::partial_ordering::less); } + void compareFloats() { executeComparison<float, Qt::partial_ordering>(); } + void compareDoubles_data() { generateData(0.0, 0.1, Qt::partial_ordering::greater); } + void compareDoubles() { executeComparison<double, Qt::partial_ordering>(); } + void comparePointers_data() + { generateData(&values[0], &values[1], Qt::strong_ordering::equal); } + void comparePointers() { executeComparison<const int *, Qt::strong_ordering>(); } + void compareToNullptr_data() { generateData(ptr, &value, Qt::strong_ordering::equivalent); } + void compareToNullptr() { executeComparison<const int *, Qt::strong_ordering>(); } + void compareUnregisteredEnum_data() + { generateData(MyUnregisteredEnumValue1, + MyUnregisteredEnumValue2, Qt::strong_ordering::less); } + void compareUnregisteredEnum() + { executeComparison<MyUnregisteredEnum, Qt::strong_ordering>(); } + void compareRegisteredEnum_data() + { generateData(Qt::Monday, Qt::Sunday, Qt::strong_ordering::greater); } + void compareRegisteredEnum() { executeComparison<Qt::DayOfWeek, Qt::strong_ordering>(); } + void compareCustomTypes_data() { generateData(val1, val2, Qt::strong_ordering::less); } + void compareCustomTypes() { executeComparison<MyClass, Qt::strong_ordering>(); } + void stdCompareInts_data() { generateData(1, -2, std::strong_ordering::equal); } + void stdCompareInts() { (executeComparison<int, std::strong_ordering>()); } + void stdCompareFloats_data() + { generateData(2.0f, 1.1f, std::partial_ordering::less); } + void stdCompareFloats() { (executeComparison<float, std::partial_ordering>()); } + void stdCompareDoubles_data() { generateData(0.15, 0.25, std::partial_ordering::greater); } + void stdCompareDoubles() { (executeComparison<double, std::partial_ordering>()); } + void stdComparePointers_data() + { generateData(&values[0], &values[1], std::strong_ordering::equal); } + void stdComparePointers() { executeComparison<const int *, std::strong_ordering>(); } + void stdCompareToNullptr_data() + { generateData(ptr, &value, std::strong_ordering::equivalent); } + void stdCompareToNullptr() { executeComparison<const int *, std::strong_ordering>(); } + void stdCompareUnregisteredEnum_data() + { generateData(MyUnregisteredEnumValue2, + MyUnregisteredEnumValue1, std::strong_ordering::less); } + void stdCompareUnregisteredEnum() + { executeComparison<MyUnregisteredEnum, std::strong_ordering>(); } + void stdCompareRegisteredEnum_data() + { generateData(Qt::Monday, Qt::Friday, std::strong_ordering::greater); } + void stdCompareRegisteredEnum() { executeComparison<Qt::DayOfWeek, std::strong_ordering>(); } + void stdCompareCustomTypes_data() { generateData(val1, val2, std::strong_ordering::less); } + void stdCompareCustomTypes() { executeComparison<MyClass, std::strong_ordering>(); } + + void checkComparisonForTemporaryObjects(); + void checkWeakComparison(); +}; + +template <typename OrderingType> inline QByteArray typeName() +{ +#ifdef __cpp_lib_three_way_comparison + if constexpr (std::is_same_v<OrderingType, std::strong_ordering>) + return QByteArray("std::strong_ordering"); + if constexpr (std::is_same_v<OrderingType, std::weak_ordering>) + return QByteArray("std::weak_ordering"); + if constexpr (std::is_same_v<OrderingType, std::partial_ordering>) + return QByteArray("std::partial_ordering"); +#endif + + if constexpr (std::is_same_v<OrderingType, Qt::strong_ordering>) + return QByteArray("Qt::strong_ordering"); + if constexpr (std::is_same_v<OrderingType, Qt::partial_ordering>) + return QByteArray("Qt::partial_ordering"); + if constexpr (std::is_same_v<OrderingType, Qt::weak_ordering>) + return QByteArray("Qt::weak_ordering"); +} + +template <typename T, typename OrderingType> +void tst_ThreeWayCompare::generateData(T val1, T val2, OrderingType order) +{ +#ifdef __cpp_lib_three_way_comparison + QTest::addColumn<T>("lhs"); + QTest::addColumn<T>("rhs"); + QTest::addColumn<OrderingType>("expectedOrder"); + + QTest::newRow(typeName<OrderingType>().append("::equivalent").constData()) + << val1 << val1 << order; + QTest::newRow(typeName<OrderingType>().append("::less").constData()) + << val1 << val2 << order; + QTest::newRow(typeName<OrderingType>().append("::greater").constData()) + << val2 << val1 << order; +#else + Q_UNUSED(val1) + Q_UNUSED(val2) + Q_UNUSED(order) +#endif +} + +template <typename T, typename OrderingType> +void tst_ThreeWayCompare::executeComparison() +{ +#ifdef __cpp_lib_three_way_comparison + QFETCH(T, lhs); + QFETCH(T, rhs); + QFETCH(OrderingType, expectedOrder); + QCOMPARE_3WAY(lhs, rhs, expectedOrder); +#endif +} + +void tst_ThreeWayCompare::checkComparisonForTemporaryObjects() +{ +#ifdef __cpp_lib_three_way_comparison + QCOMPARE_3WAY(getClassForValue(0).getValuePointer(), + getClassForValue(1).getValuePointer(), + Qt::strong_ordering::less); + + QCOMPARE_3WAY(getClassForValue(0).getValuePointer(), + getClassForValue(1).getValuePointer(), + std::strong_ordering::equal); +#endif +} + +void tst_ThreeWayCompare::checkWeakComparison() +{ +#ifdef __cpp_lib_three_way_comparison + QUrl example_left("http://example.com"); + QUrl example_right("http://example.com:0"); + + QCOMPARE_3WAY(example_left, example_right, std::weak_ordering::less); + + QDateTime june(QDate(2012, 6, 20), QTime(14, 33, 2, 500)); + QDateTime juneLater = june.addMSecs(1); + QCOMPARE_3WAY(june, juneLater, Qt::weak_ordering::greater); +#endif +} + +QT_END_NAMESPACE + +QTEST_MAIN(tst_ThreeWayCompare) +#include "tst_threewaycompare.moc" diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index d7406386c6a..82324e06bf9 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -690,6 +690,13 @@ bool TestLogger::shouldIgnoreTest(const QString &test) const #endif } +#ifndef __cpp_lib_three_way_comparison + if (test == "threewaycompare") { + WARN("The threewaycompare test requires C++20 support. Skipping."); + return true; + } +#endif + if (logger != QTestLog::Plain || outputMode == FileOutput) { // The following tests only work with plain text output to stdout, // either because they execute multiple test objects or because |