# HG changeset patch # User Andre Heinecke # Date 1396531825 -7200 # Node ID 9c5e6b142611e6f5cb37618ade9b6f65354d28cb # Parent 4a3febc6d80617e50bf3d042669e4e50a599084a Set the home directory to a temporary location to avoid writing into real nss stores diff -r 4a3febc6d806 -r 9c5e6b142611 ui/tests/cinstprocesstest.cpp --- a/ui/tests/cinstprocesstest.cpp Thu Apr 03 15:29:58 2014 +0200 +++ b/ui/tests/cinstprocesstest.cpp Thu Apr 03 15:30:25 2014 +0200 @@ -96,6 +96,14 @@ otherList = CertificateList(otherListFile.fileName().toLocal8Bit().data()); QVERIFY(!otherList.isValid()); + +/* Set HOME or APPDATA so that nss stores are not touched + * see nsstest for the real test of that code */ +#ifdef WIN32 + QVERIFY(!setenv ("APPDATA", fakeHome.path().toLocal8Bit().constData(), 1)); +#else + QVERIFY(!setenv ("HOME", fakeHome.path().toLocal8Bit().constData(), 1)); +#endif } void CinstProcessTest::testNoList() { diff -r 4a3febc6d806 -r 9c5e6b142611 ui/tests/cinstprocesstest.h --- a/ui/tests/cinstprocesstest.h Thu Apr 03 15:29:58 2014 +0200 +++ b/ui/tests/cinstprocesstest.h Thu Apr 03 15:30:25 2014 +0200 @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "certificatelist.h" @@ -21,6 +22,7 @@ QTemporaryFile validListFile; QTemporaryFile otherListFile; QTemporaryFile invalidListFile; + QTemporaryDir fakeHome; CertificateList validList; CertificateList otherList; CertificateList invalidList;