summaryrefslogtreecommitdiffstats
path: root/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2011-05-06 07:30:14 (GMT)
committeraavit <qt-info@nokia.com>2011-05-06 07:30:14 (GMT)
commitb81e1b76231dfe41de1857e87d4f6bf918c609a6 (patch)
treeab5d96bd1299f426547e4845040f165bfd876fad /tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp
parent7ac511d8d906575dff1a02361e31251b244d3b3a (diff)
parent1d9a18142eb19d5dde93b7e5c63f9be0e4caf896 (diff)
downloadQt-b81e1b76231dfe41de1857e87d4f6bf918c609a6.zip
Qt-b81e1b76231dfe41de1857e87d4f6bf918c609a6.tar.gz
Qt-b81e1b76231dfe41de1857e87d4f6bf918c609a6.tar.bz2
Merge remote branch 'qt-mainline/4.8'
Diffstat (limited to 'tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp')
-rw-r--r--tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp
index 1c26343..98d4890 100644
--- a/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp
+++ b/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp
@@ -43,10 +43,6 @@
#include <QObject>
#include <QProcessEnvironment>
-// Note:
-// in cross-platform tests, ALWAYS use UPPERCASE variable names
-// That's because on Windows, the variables are uppercased
-
class tst_QProcessEnvironment: public QObject
{
Q_OBJECT
@@ -214,7 +210,7 @@ void tst_QProcessEnvironment::caseSensitivity()
e.insert("foo", "bar");
#ifdef Q_OS_WIN
- // on Windows, it's uppercased
+ // Windows is case-insensitive, but case-preserving
QVERIFY(e.contains("foo"));
QVERIFY(e.contains("FOO"));
QVERIFY(e.contains("FoO"));
@@ -223,8 +219,12 @@ void tst_QProcessEnvironment::caseSensitivity()
QCOMPARE(e.value("FOO"), QString("bar"));
QCOMPARE(e.value("FoO"), QString("bar"));
+ // Per Windows, this overwrites the value, but keeps the name's original capitalization
+ e.insert("Foo", "Bar");
+
QStringList list = e.toStringList();
- QCOMPARE(list.at(0), QString("FOO=bar"));
+ QCOMPARE(list.length(), 1);
+ QCOMPARE(list.at(0), QString("foo=Bar"));
#else
// otherwise, it's case sensitive
QVERIFY(e.contains("foo"));
@@ -236,6 +236,7 @@ void tst_QProcessEnvironment::caseSensitivity()
QCOMPARE(e.value("foo"), QString("bar"));
QStringList list = e.toStringList();
+ QCOMPARE(list.length(), 2);
QVERIFY(list.contains("foo=bar"));
QVERIFY(list.contains("FOO=baz"));
#endif