diff ui/tests/cinstprocesstest.cpp @ 296:0b1453070561

Fix test no list
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 02 Apr 2014 15:44:57 +0000
parents 02df89a275a6
children 56507c3d5f1e
line wrap: on
line diff
--- a/ui/tests/cinstprocesstest.cpp	Wed Apr 02 15:42:35 2014 +0000
+++ b/ui/tests/cinstprocesstest.cpp	Wed Apr 02 15:44:57 2014 +0000
@@ -98,13 +98,24 @@
 
 void CinstProcessTest::testNoList() {
     /* No list */
-    QProcess* installerProcess = startCinstProcess();
-    QVERIFY(installerProcess->state() == QProcess::Running);
+    QTemporaryFile emptyFile;
+    emptyFile.open();
+    emptyFile.close();
 
+    QStringList args;
+    args << "list=" + emptyFile.fileName();
+
+    QTemporaryFile instructions;
+    instructions.open();
     foreach (const Certificate &cert, validList.getCertificates()) {
-        installerProcess->write(cert.base64Line().toLatin1());
-        installerProcess->write("\r\n");
+        instructions.write(cert.base64Line().toLatin1());
+        instructions.write("\n");
     }
+    instructions.close();
+
+    args << "instructions=" + instructions.fileName();
+
+    QProcess* installerProcess = startCinstProcess(args);
     finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST);
 }
 

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