diff 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
line wrap: on
line diff
--- a/ui/tests/cinstprocesstest.cpp	Fri Apr 04 12:20:19 2014 +0200
+++ b/ui/tests/cinstprocesstest.cpp	Fri Apr 04 11:02:02 2014 +0000
@@ -8,6 +8,8 @@
 #include <QFile>
 #include <QProcess>
 
+#include <stdlib.h>
+
 #define CINST_PATH_CANDIDATES "../../cinst/cinst" << \
     "cinst" << "../../cinst/cinst.exe" << "cinst.exe";
 
@@ -100,7 +102,11 @@
 /* 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));
+    {
+        char buf[255];
+        snprintf(buf, 255, "APPDATA=%s",fakeHome.path().toLocal8Bit().constData());
+        QVERIFY(_putenv (buf) != -1);
+    }
 #else
     QVERIFY(!setenv ("HOME", fakeHome.path().toLocal8Bit().constData(), 1));
 #endif

http://wald.intevation.org/projects/trustbridge/