summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-02-13 10:54:36 -0800
committerKonstantin Käfer <mail@kkaefer.com>2015-02-13 13:28:40 -0800
commitaecef6da1a7903ef318e02f62d1cdd97a2e3e53b (patch)
treeb64f944169db25800f6f09de8227cb98564bf65f /test
parent5d2ed0326ed27f32c4a8ec5e95ec9fc57139c7ec (diff)
downloadqtlocation-mapboxgl-aecef6da1a7903ef318e02f62d1cdd97a2e3e53b.tar.gz
make sure that the async handle always gets closed
Diffstat (limited to 'test')
-rw-r--r--test/storage/http_reading.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/storage/http_reading.cpp b/test/storage/http_reading.cpp
index 3aa57cd805..ad87db15ff 100644
--- a/test/storage/http_reading.cpp
+++ b/test/storage/http_reading.cpp
@@ -37,3 +37,31 @@ TEST_F(Storage, HTTPReading) {
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
}
+
+TEST_F(Storage, HTTPNoCallback) {
+ SCOPED_TEST(HTTPTest)
+
+ using namespace mbgl;
+
+ DefaultFileSource fs(nullptr, uv_default_loop());
+
+ fs.request({ Resource::Unknown, "http://127.0.0.1:3000/test" }, uv_default_loop(), nullptr);
+
+ uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+
+ HTTPTest.finish();
+}
+
+TEST_F(Storage, HTTPNoCallbackNoLoop) {
+ SCOPED_TEST(HTTPTest)
+
+ using namespace mbgl;
+
+ DefaultFileSource fs(nullptr, uv_default_loop());
+
+ fs.request({ Resource::Unknown, "http://127.0.0.1:3000/test" }, nullptr);
+
+ uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+
+ HTTPTest.finish();
+}