From b1b53b7101b800aa7f2b749ffcead8a124c0a5f1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 12 Feb 2017 08:15:20 +0000 Subject: [PATCH] Revert "Add tests for QCollatorSortKey" This reverts commit b0c1e07d648caf585d2be12cf3d18eb42b86f721. The unit tests it introduced trigger errors with the macOS and Win32 implementations, which means the there's something seriously wrong with either the API, our implementation or the tests. Revert for now until this gets fixed. Blacklisting was also the wrong tool to use. The tests should have used QEXPECT_FAIL. Change-Id: Ida20c6bbe0c019835a22464535029585e8e1e367 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qcollator/BLACKLIST | 18 ------------ .../corelib/tools/qcollator/tst_qcollator.cpp | 28 ++----------------- 2 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 tests/auto/corelib/tools/qcollator/BLACKLIST diff --git a/tests/auto/corelib/tools/qcollator/BLACKLIST b/tests/auto/corelib/tools/qcollator/BLACKLIST deleted file mode 100644 index 09b69e0108..0000000000 --- a/tests/auto/corelib/tools/qcollator/BLACKLIST +++ /dev/null @@ -1,18 +0,0 @@ -[compare:swedish5] -osx -[compare:norwegian4] -osx -[compare:german6] -osx -windows -[compare:german7] -osx -windows -[compare:german8] -osx -[compare:german9] -osx -[compare:german10] -osx -[compare:french5] -osx diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp index ead0992f92..d09910fd5c 100644 --- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp @@ -33,11 +33,6 @@ #include -Q_CONSTEXPR inline int sign(int i) Q_DECL_NOTHROW -{ return i < 0 ? -1 : i > 0 ? 1 : 0; } - -#define QCOMPARE_SIGN(x, y) QCOMPARE(sign(x), sign(y)) - class tst_QCollator : public QObject { Q_OBJECT @@ -178,28 +173,9 @@ void tst_QCollator::compare() if (numericMode) collator.setNumericMode(true); - QCOMPARE_SIGN(collator.compare(s1, s2), result); - { - const auto s1sk = collator.sortKey(s1); - const auto s2sk = collator.sortKey(s2); - - QCOMPARE_SIGN(s1sk.compare(s2sk), result); -#define CHECK(op) QCOMPARE(s1sk op s2sk, result op 0) - CHECK(<); -#undef CHECK - } - + QCOMPARE(collator.compare(s1, s2), result); collator.setCaseSensitivity(Qt::CaseInsensitive); - QCOMPARE_SIGN(collator.compare(s1, s2), caseInsensitiveResult); - { - const auto s1sk = collator.sortKey(s1); - const auto s2sk = collator.sortKey(s2); - - QCOMPARE_SIGN(s1sk.compare(s2sk), caseInsensitiveResult); -#define CHECK(op) QCOMPARE(s1sk op s2sk, caseInsensitiveResult op 0) - CHECK(<); -#undef CHECK - } + QCOMPARE(collator.compare(s1, s2), caseInsensitiveResult); }