From 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 4 Oct 2011 11:51:31 +1000 Subject: Avoid using QSKIP in lieu of compile-time checks QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: Ib2025339422749cf216e87ac414a3056250bf8f9 Reviewed-on: http://codereview.qt-project.org/5942 Reviewed-by: Qt Sanity Bot Reviewed-by: Rohan McGovern --- .../corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/auto/corelib/io/qprocessenvironment') diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp index 1c6bf6f19c..1827f8b2d7 100644 --- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp +++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp @@ -57,7 +57,9 @@ private slots: void caseSensitivity(); void systemEnvironment(); +#ifndef Q_OS_WINCE void putenv(); +#endif }; void tst_QProcessEnvironment::operator_eq() @@ -276,11 +278,10 @@ void tst_QProcessEnvironment::systemEnvironment() #endif } +// Windows CE has no environment. +#ifndef Q_OS_WINCE void tst_QProcessEnvironment::putenv() { -#ifdef Q_OS_WINCE - QSKIP("Windows CE has no environment", SkipAll); -#else static const char envname[] = "WE_RE_SETTING_THIS_ENVIRONMENT_VARIABLE"; static bool testRan = false; @@ -312,8 +313,8 @@ void tst_QProcessEnvironment::putenv() QVERIFY(eAfter.contains(lower)); QCOMPARE(eAfter.value(lower), QString("Hello, World")); # endif -#endif } +#endif QTEST_MAIN(tst_QProcessEnvironment) -- cgit v1.2.3