comparison ui/tests/cinstprocesstest.cpp @ 117:080660b2ce7d

Merged
author Sascha Wilde <wilde@intevation.de>
date Fri, 21 Mar 2014 17:46:09 +0100
parents 5ed770c41a73
children f5fa39347366
comparison
equal deleted inserted replaced
116:c602d8cfa619 117:080660b2ce7d
75 for (int i = 0; i < 1030; i++) { 75 for (int i = 0; i < 1030; i++) {
76 garbage[i] = (char) qrand() % 255; 76 garbage[i] = (char) qrand() % 255;
77 } 77 }
78 retval = installerProcess->write(garbage, 1030); 78 retval = installerProcess->write(garbage, 1030);
79 bytesWritten += retval; 79 bytesWritten += retval;
80 } while (retval != -1 && bytesWritten < 100 *1024 *1024 ); 80 } while (retval != -1 && bytesWritten < 15 *1024 *1024 );
81 81
82 QVERIFY (bytesWritten < 100 *1024 *1024); 82 finishVerify(installerProcess, ERR_INVALID_INPUT);
83
84 finishVerify(installerProcess, ERR_TOO_MUCH_INPUT);
85 } 83 }
86 84
87 void CinstProcessTest::testNoInput() { 85 void CinstProcessTest::testNoInput() {
88 QProcess* installerProcess = startCinstProcess(); 86 QProcess* installerProcess = startCinstProcess();
89 QVERIFY(installerProcess->state() == QProcess::Running); 87 QVERIFY(installerProcess->state() == QProcess::Running);
107 105
108 void CinstProcessTest::testInvalidInstruction() { 106 void CinstProcessTest::testInvalidInstruction() {
109 QProcess* installerProcess = startCinstProcess(); 107 QProcess* installerProcess = startCinstProcess();
110 QVERIFY(installerProcess->state() == QProcess::Running); 108 QVERIFY(installerProcess->state() == QProcess::Running);
111 109
112 /* foobar as instruction */ 110 /* I: as instruction */
113 installerProcess->write("-----BEGIN CERTIFICATE LIST-----\r\n"); 111 installerProcess->write("-----BEGIN CERTIFICATE LIST-----\r\n");
114 installerProcess->write(validList.rawData().toLatin1()); 112 installerProcess->write(validList.rawData().toLatin1());
115 installerProcess->write("-----END CERTIFICATE LIST-----\r\n"); 113 installerProcess->write("-----END CERTIFICATE LIST-----\r\n");
116 114
117 installerProcess->write("foobar"); 115 installerProcess->write("I:ABCDEF");
118 116
119 finishVerify(installerProcess, ERR_INVALID_INSTRUCTIONS); 117 finishVerify(installerProcess, ERR_INVALID_INSTRUCTIONS);
120 } 118 }
121 119
122 QTEST_GUILESS_MAIN (CinstProcessTest); 120 QTEST_GUILESS_MAIN (CinstProcessTest);

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