Mercurial > trustbridge
comparison ui/tests/cinstprocesstest.cpp @ 313:f17226aa2e09
Temporary build fix for windows. Also Use putenv in test
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 04 Apr 2014 11:02:02 +0000 |
parents | 9c5e6b142611 |
children | 5e4ae994a320 |
comparison
equal
deleted
inserted
replaced
312:4033c16beb04 | 313:f17226aa2e09 |
---|---|
5 | 5 |
6 #include <QDebug> | 6 #include <QDebug> |
7 #include <QDir> | 7 #include <QDir> |
8 #include <QFile> | 8 #include <QFile> |
9 #include <QProcess> | 9 #include <QProcess> |
10 | |
11 #include <stdlib.h> | |
10 | 12 |
11 #define CINST_PATH_CANDIDATES "../../cinst/cinst" << \ | 13 #define CINST_PATH_CANDIDATES "../../cinst/cinst" << \ |
12 "cinst" << "../../cinst/cinst.exe" << "cinst.exe"; | 14 "cinst" << "../../cinst/cinst.exe" << "cinst.exe"; |
13 | 15 |
14 QProcess *CinstProcessTest::startCinstProcess(const QStringList& args) { | 16 QProcess *CinstProcessTest::startCinstProcess(const QStringList& args) { |
98 QVERIFY(!otherList.isValid()); | 100 QVERIFY(!otherList.isValid()); |
99 | 101 |
100 /* Set HOME or APPDATA so that nss stores are not touched | 102 /* Set HOME or APPDATA so that nss stores are not touched |
101 * see nsstest for the real test of that code */ | 103 * see nsstest for the real test of that code */ |
102 #ifdef WIN32 | 104 #ifdef WIN32 |
103 QVERIFY(!setenv ("APPDATA", fakeHome.path().toLocal8Bit().constData(), 1)); | 105 { |
106 char buf[255]; | |
107 snprintf(buf, 255, "APPDATA=%s",fakeHome.path().toLocal8Bit().constData()); | |
108 QVERIFY(_putenv (buf) != -1); | |
109 } | |
104 #else | 110 #else |
105 QVERIFY(!setenv ("HOME", fakeHome.path().toLocal8Bit().constData(), 1)); | 111 QVERIFY(!setenv ("HOME", fakeHome.path().toLocal8Bit().constData(), 1)); |
106 #endif | 112 #endif |
107 } | 113 } |
108 | 114 |