comparison 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
comparison
equal deleted inserted replaced
295:02df89a275a6 296:0b1453070561
96 QVERIFY(!otherList.isValid()); 96 QVERIFY(!otherList.isValid());
97 } 97 }
98 98
99 void CinstProcessTest::testNoList() { 99 void CinstProcessTest::testNoList() {
100 /* No list */ 100 /* No list */
101 QProcess* installerProcess = startCinstProcess(); 101 QTemporaryFile emptyFile;
102 QVERIFY(installerProcess->state() == QProcess::Running); 102 emptyFile.open();
103 emptyFile.close();
103 104
105 QStringList args;
106 args << "list=" + emptyFile.fileName();
107
108 QTemporaryFile instructions;
109 instructions.open();
104 foreach (const Certificate &cert, validList.getCertificates()) { 110 foreach (const Certificate &cert, validList.getCertificates()) {
105 installerProcess->write(cert.base64Line().toLatin1()); 111 instructions.write(cert.base64Line().toLatin1());
106 installerProcess->write("\r\n"); 112 instructions.write("\n");
107 } 113 }
114 instructions.close();
115
116 args << "instructions=" + instructions.fileName();
117
118 QProcess* installerProcess = startCinstProcess(args);
108 finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST); 119 finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST);
109 } 120 }
110 121
111 void CinstProcessTest::testGarbageInput() { 122 void CinstProcessTest::testGarbageInput() {
112 QProcess* installerProcess = startCinstProcess(); 123 QProcess* installerProcess = startCinstProcess();

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