summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index deb983c262..9c5a15d92c 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -356,17 +356,18 @@ void tst_QTextCodec::codecForLocale()
break;
}
}
- if (!codec2) {
- QSKIP("Could not find a codec that is not already the codecForLocale()");
- }
- // set it, codecForLocale() should return it now
- QTextCodec::setCodecForLocale(codec2);
- QCOMPARE(QTextCodec::codecForLocale(), codec2);
+ // Only run the rest of the test if we could find a codec that is not
+ // already the codecForLocale().
+ if (codec2) {
+ // set it, codecForLocale() should return it now
+ QTextCodec::setCodecForLocale(codec2);
+ QCOMPARE(QTextCodec::codecForLocale(), codec2);
- // reset back to the default
- QTextCodec::setCodecForLocale(0);
- QCOMPARE(QTextCodec::codecForLocale(), codec);
+ // reset back to the default
+ QTextCodec::setCodecForLocale(0);
+ QCOMPARE(QTextCodec::codecForLocale(), codec);
+ }
#endif
}