comparison ui/tests/cinstprocesstest.cpp @ 314:5e4ae994a320

Make buffer size for fakeHome environment variable dynamic. %TMP% can get ridicoulously long on windows.
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 04 Apr 2014 11:05:44 +0000
parents f17226aa2e09
children 17e1c8f37d72
comparison
equal deleted inserted replaced
313:f17226aa2e09 314:5e4ae994a320
101 101
102 /* Set HOME or APPDATA so that nss stores are not touched 102 /* Set HOME or APPDATA so that nss stores are not touched
103 * see nsstest for the real test of that code */ 103 * see nsstest for the real test of that code */
104 #ifdef WIN32 104 #ifdef WIN32
105 { 105 {
106 char buf[255]; 106 char buf[fakeHome.path().toLocal8Bit().size() + 9];
107 snprintf(buf, 255, "APPDATA=%s",fakeHome.path().toLocal8Bit().constData()); 107 snprintf(buf, fakeHome.path().toLocal8Bit().size() + 9,
108 "APPDATA=%s",fakeHome.path().toLocal8Bit().constData());
108 QVERIFY(_putenv (buf) != -1); 109 QVERIFY(_putenv (buf) != -1);
109 } 110 }
110 #else 111 #else
111 QVERIFY(!setenv ("HOME", fakeHome.path().toLocal8Bit().constData(), 1)); 112 QVERIFY(!setenv ("HOME", fakeHome.path().toLocal8Bit().constData(), 1));
112 #endif 113 #endif

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