changeset 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 4033c16beb04
children 5e4ae994a320 b832231640ab
files cinst/main.c ui/tests/cinstprocesstest.cpp
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cinst/main.c	Fri Apr 04 12:20:19 2014 +0200
+++ b/cinst/main.c	Fri Apr 04 11:02:02 2014 +0000
@@ -262,7 +262,9 @@
           ERRORPRINTF ("Failed to write windows stores retval: %i\n", ret);
         }
 #endif
+#ifndef WIN32 /* TODO Remove ifdef once it is implemented */
       ret = write_stores_nss (NULL, all_valid_certs);
+#endif
       return ret;
     }
 
@@ -305,8 +307,9 @@
       ERRORPRINTF ("Failed to write windows stores retval: %i\n", ret);
     }
 #endif
+#ifndef WIN32 /* TODO Remove ifdef once it is implemented */
   ret = write_stores_nss (to_install, to_remove);
-
+#endif
   if (ret != 0)
     {
       ERRORPRINTF ("Failed to write nss stores");
--- 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/