@@ -139,7 +139,7 @@ void TestQgsFileDownloader::init()
139
139
mError = false ;
140
140
mCompleted = false ;
141
141
mExited = false ;
142
- mTempFile = new QTemporaryFile ();
142
+ mTempFile = new QTemporaryFile ( QDir::currentPath () + QDir::separator () + " qgs_filedownloader " );
143
143
Q_ASSERT ( mTempFile ->open () );
144
144
mTempFile ->close ();
145
145
}
@@ -153,6 +153,7 @@ void TestQgsFileDownloader::cleanup()
153
153
154
154
void TestQgsFileDownloader::testValidDownload ()
155
155
{
156
+ QVERIFY ( ! mTempFile ->fileName ().isEmpty () );
156
157
makeCall ( QUrl ( " http://www.qgis.org" ), mTempFile ->fileName () );
157
158
QVERIFY ( mExited );
158
159
QVERIFY ( mCompleted );
@@ -164,6 +165,7 @@ void TestQgsFileDownloader::testValidDownload()
164
165
165
166
void TestQgsFileDownloader::testInValidDownload ()
166
167
{
168
+ QVERIFY ( ! mTempFile ->fileName ().isEmpty () );
167
169
makeCall ( QUrl ( " http://www.doesnotexistofthatimsure.qgis" ), mTempFile ->fileName () );
168
170
QVERIFY ( mExited );
169
171
QVERIFY ( !mCompleted );
@@ -175,6 +177,7 @@ void TestQgsFileDownloader::testInValidDownload()
175
177
176
178
void TestQgsFileDownloader::testCanceledDownload ()
177
179
{
180
+ QVERIFY ( ! mTempFile ->fileName ().isEmpty () );
178
181
makeCall ( QUrl ( " https://github.com/qgis/QGIS/archive/master.zip" ), mTempFile ->fileName (), true );
179
182
QVERIFY ( mExited );
180
183
QVERIFY ( !mCompleted );
@@ -196,6 +199,7 @@ void TestQgsFileDownloader::testInvalidFile()
196
199
197
200
void TestQgsFileDownloader::testInvalidUrl ()
198
201
{
202
+ QVERIFY ( ! mTempFile ->fileName ().isEmpty () );
199
203
makeCall ( QUrl ( " xyz://www" ), mTempFile ->fileName () );
200
204
QVERIFY ( mExited );
201
205
QVERIFY ( !mCompleted );
@@ -206,6 +210,7 @@ void TestQgsFileDownloader::testInvalidUrl()
206
210
207
211
void TestQgsFileDownloader::testBlankUrl ()
208
212
{
213
+ QVERIFY ( ! mTempFile ->fileName ().isEmpty () );
209
214
makeCall ( QUrl ( " " ), mTempFile ->fileName () );
210
215
QVERIFY ( mExited );
211
216
QVERIFY ( !mCompleted );
@@ -229,6 +234,7 @@ void TestQgsFileDownloader::testSslError()
229
234
{
230
235
QFETCH ( QString, url );
231
236
QFETCH ( QString, result );
237
+ QVERIFY ( ! mTempFile ->fileName ().isEmpty () );
232
238
makeCall ( QUrl ( url ), mTempFile ->fileName () );
233
239
QCOMPARE ( mErrorMessage , result );
234
240
QVERIFY ( !mCompleted );
0 commit comments