summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/codecs
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-12-29 15:45:04 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-29 13:27:17 +0100
commit4c1469f7da33dd65eb5e8e9a50b79d935eb4add0 (patch)
treeeaf8becb7b893b0dcdaf84eed5d3ab3d8b3a69b0 /tests/auto/corelib/codecs
parent78c27380c6b029b7908642b92ea68aca649e2384 (diff)
Improve QTextCodec::codecForLocale() test.
Don't call QSKIP when omitting the optional part of the test, as doing so hides the fact that the rest of the test passed. Change-Id: I9c102e8daeaf9586b2e510c4c9ce697ead290795 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/codecs')
-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
}