summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-02-12 08:15:20 +0000
committerThiago Macieira <thiago.macieira@intel.com>2017-02-12 08:15:48 +0000
commitb1b53b7101b800aa7f2b749ffcead8a124c0a5f1 (patch)
treeb4d77ee99ee3ca99978052efc5132abe5bc5b97a /tests/auto/corelib
parentb0c1e07d648caf585d2be12cf3d18eb42b86f721 (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/tools/qcollator/BLACKLIST18
-rw-r--r--tests/auto/corelib/tools/qcollator/tst_qcollator.cpp28
2 files changed, 2 insertions, 44 deletions
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 <cstring>
-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);
}