Mercurial > trustbridge
comparison ui/tests/cinstprocesstest.cpp @ 439:c88090a15ae4
Fix cinstprocesstest for new arguments. Handle errno on write errors
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Tue, 22 Apr 2014 13:27:23 +0000 |
parents | 17e1c8f37d72 |
children | f89b41fa7048 |
comparison
equal
deleted
inserted
replaced
438:8f50533027af | 439:c88090a15ae4 |
---|---|
67 instructions.write(cert.base64Line().toLatin1()); | 67 instructions.write(cert.base64Line().toLatin1()); |
68 instructions.write("\n"); | 68 instructions.write("\n"); |
69 } | 69 } |
70 instructions.close(); | 70 instructions.close(); |
71 | 71 |
72 args << "instructions=" + instructions.fileName(); | 72 args << "choices=" + instructions.fileName(); |
73 | 73 |
74 QProcess* installerProcess = startCinstProcess(args); | 74 QProcess* installerProcess = startCinstProcess(args); |
75 finishVerify(installerProcess, ERR_NO_ERROR); | 75 finishVerify(installerProcess, ERR_NO_ERROR); |
76 } | 76 } |
77 | 77 |
135 instructions.write(cert.base64Line().toLatin1()); | 135 instructions.write(cert.base64Line().toLatin1()); |
136 instructions.write("\n"); | 136 instructions.write("\n"); |
137 } | 137 } |
138 instructions.close(); | 138 instructions.close(); |
139 | 139 |
140 args << "instructions=" + instructions.fileName(); | 140 args << "choices=" + instructions.fileName(); |
141 | 141 |
142 QProcess* installerProcess = startCinstProcess(args); | 142 QProcess* installerProcess = startCinstProcess(args); |
143 finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST); | 143 finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST); |
144 } | 144 } |
145 | 145 |
155 instructions.write(cert.base64Line().toLatin1()); | 155 instructions.write(cert.base64Line().toLatin1()); |
156 instructions.write("\n"); | 156 instructions.write("\n"); |
157 } | 157 } |
158 instructions.close(); | 158 instructions.close(); |
159 | 159 |
160 args << "instructions=" + instructions.fileName(); | 160 args << "choices=" + instructions.fileName(); |
161 | 161 |
162 QProcess* installerProcess = startCinstProcess(args); | 162 QProcess* installerProcess = startCinstProcess(args); |
163 /* If the following failed there may be leftovers in /tmp */ | 163 /* If the following failed there may be leftovers in /tmp */ |
164 finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST); | 164 finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST); |
165 QVERIFY(QFile::remove(garbage)); | 165 QVERIFY(QFile::remove(garbage)); |
166 } | 166 } |
167 | 167 |
168 void CinstProcessTest::testNoInput() { | 168 void CinstProcessTest::testNoInput() { |
169 QStringList args; | 169 QStringList args; |
170 args << "list=foobazbuf"; | 170 args << "list=foobazbuf"; |
171 args << "instructions=bazbuffoo"; | 171 args << "choices=bazbuffoo"; |
172 QProcess* installerProcess; | 172 QProcess* installerProcess; |
173 installerProcess = startCinstProcess(args); | 173 installerProcess = startCinstProcess(args); |
174 finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST); | 174 finishVerify(installerProcess, ERR_INVALID_INPUT_NO_LIST); |
175 } | 175 } |
176 | 176 |
181 emptyFile.open(); | 181 emptyFile.open(); |
182 emptyFile.close(); | 182 emptyFile.close(); |
183 | 183 |
184 QStringList args; | 184 QStringList args; |
185 args << "list=" + validListFile.fileName(); | 185 args << "list=" + validListFile.fileName(); |
186 args << "instructions=" + emptyFile.fileName(); | 186 args << "choices=" + emptyFile.fileName(); |
187 | 187 |
188 QProcess* installerProcess = startCinstProcess(args); | 188 QProcess* installerProcess = startCinstProcess(args); |
189 finishVerify(installerProcess, ERR_NO_INSTRUCTIONS); | 189 finishVerify(installerProcess, ERR_NO_INSTRUCTIONS); |
190 } | 190 } |
191 | 191 |
200 instructions.write("\n"); | 200 instructions.write("\n"); |
201 } | 201 } |
202 instructions.write("I:ABCDEF\n"); | 202 instructions.write("I:ABCDEF\n"); |
203 instructions.close(); | 203 instructions.close(); |
204 | 204 |
205 args << "instructions=" + instructions.fileName(); | 205 args << "choices=" + instructions.fileName(); |
206 | 206 |
207 QProcess* installerProcess = startCinstProcess(args); | 207 QProcess* installerProcess = startCinstProcess(args); |
208 | 208 |
209 finishVerify(installerProcess, ERR_INVALID_INSTRUCTIONS); | 209 finishVerify(installerProcess, ERR_INVALID_INSTRUCTIONS); |
210 } | 210 } |
211 | 211 |
212 void CinstProcessTest::testUninstall() { | 212 void CinstProcessTest::testUninstall() { |
213 QStringList args; | 213 QStringList args; |
214 args << "list=" + validListFile.fileName(); | 214 args << "list=" + validListFile.fileName(); |
215 args << "instructions=uninstall"; | 215 args << "choices=uninstall"; |
216 | 216 |
217 QProcess* installerProcess = startCinstProcess(args); | 217 QProcess* installerProcess = startCinstProcess(args); |
218 | 218 |
219 finishVerify(installerProcess, ERR_NO_ERROR); | 219 finishVerify(installerProcess, ERR_NO_ERROR); |
220 } | 220 } |