summaryrefslogtreecommitdiff
path: root/test/storage/directory_reading.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-02-16 18:30:19 -0800
committerKonstantin Käfer <mail@kkaefer.com>2015-02-16 18:30:19 -0800
commitfe0baffe0dfbf369f422e175c0fcf3dda9055118 (patch)
treed404bd67ec2b338f37e4de958c74c44c841a77b5 /test/storage/directory_reading.cpp
parent8d3c2b3d303adaf2c9caa91356183d9b40cdfeab (diff)
downloadqtlocation-mapboxgl-fe0baffe0dfbf369f422e175c0fcf3dda9055118.tar.gz
update uv_zip and add tests
Diffstat (limited to 'test/storage/directory_reading.cpp')
-rw-r--r--test/storage/directory_reading.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/storage/directory_reading.cpp b/test/storage/directory_reading.cpp
index bf472b5c79..3ee4dd1721 100644
--- a/test/storage/directory_reading.cpp
+++ b/test/storage/directory_reading.cpp
@@ -4,12 +4,16 @@
#include <mbgl/storage/default_file_source.hpp>
-TEST_F(Storage, ReadDirectory) {
+TEST_F(Storage, AssetReadDirectory) {
SCOPED_TEST(ReadDirectory)
using namespace mbgl;
+#ifdef MBGL_ASSET_ZIP
+ DefaultFileSource fs(nullptr, uv_default_loop(), "test/fixtures/storage/assets.zip");
+#else
DefaultFileSource fs(nullptr, uv_default_loop());
+#endif
fs.request({ Resource::Unknown, "asset://TEST_DATA/fixtures/storage" }, uv_default_loop(), [&](const Response &res) {
EXPECT_EQ(Response::Error, res.status);
@@ -17,7 +21,11 @@ TEST_F(Storage, ReadDirectory) {
EXPECT_EQ(0, res.expires);
EXPECT_EQ(0, res.modified);
EXPECT_EQ("", res.etag);
+#ifdef MBGL_ASSET_ZIP
+ EXPECT_EQ("No such file", res.message);
+#elif MBGL_ASSET_FS
EXPECT_EQ("illegal operation on a directory", res.message);
+#endif
ReadDirectory.finish();
});