summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-07-02 12:51:39 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-07-07 05:22:28 +0000
commit6aa89ddf5e30bf3a0b3814140872b71cfbae9796 (patch)
tree1a29ff404d0222063c50e0280966804ecfd341e6 /tests
parentef0778d097037bad887b3d3038a436b6f1dc983b (diff)
QProcessEnvironment: add a check for inserting into self
Wasn't checked, and with all the mutex locking going on under the hood, we better rule out that there's a deadlock. Change-Id: I5a2ef1a524fb42b7840c9f3c18395cde05b7ef28 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
index be9a38c499..fb64a48362 100644
--- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
+++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
@@ -196,6 +196,15 @@ void tst_QProcessEnvironment::insertEnv()
QCOMPARE(e.value("Hello"), QString("Another World"));
QCOMPARE(e.value("FOO2"), QString("bar2"));
QCOMPARE(e.value("A2"), QString("bc2"));
+
+ QProcessEnvironment e3;
+ e3.insert("FOO2", "bar2");
+ e3.insert("A2", "bc2");
+ e3.insert("Hello", "Another World");
+
+ e3.insert(e3); // mustn't deadlock
+
+ QVERIFY(e3 == e2);
}
void tst_QProcessEnvironment::caseSensitivity()