diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-07-02 14:53:45 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-07-02 23:21:42 +0300 |
commit | f74bc9d8ceff754200d4e8d922a1a0107403db2b (patch) | |
tree | e4f0c2cf0b115a935a7751185d5c625c36a01289 /test/style | |
parent | e4cc06b798d74cf353f641c833941fd864582a22 (diff) | |
download | qtlocation-mapboxgl-f74bc9d8ceff754200d4e8d922a1a0107403db2b.tar.gz |
Update the unit tests to check for raster tiles failures
Diffstat (limited to 'test/style')
-rw-r--r-- | test/style/pending_resources.cpp | 13 | ||||
-rw-r--r-- | test/style/resource_loading.cpp | 15 |
2 files changed, 23 insertions, 5 deletions
diff --git a/test/style/pending_resources.cpp b/test/style/pending_resources.cpp index 5d13d49a7c..4614c187b7 100644 --- a/test/style/pending_resources.cpp +++ b/test/style/pending_resources.cpp @@ -55,7 +55,16 @@ TEST_P(PendingResources, DeleteMapObjectWithPendingRequest) { // In the test data below, "sprite" will match both "sprite.json" and "sprite.png" and cause two // requests to be canceled. "resources" will match everything but in practice will only test the -// cancellation of the sprites and "source.json" because we only load the rest after "source.json" +// cancellation of the sprites and "source_*.json" because we only load the rest after "source_*.json" // gets parsed. INSTANTIATE_TEST_CASE_P(Style, PendingResources, - ::testing::Values("source.json", "sprite.json", "sprite.png", "sprite", "vector.pbf", "glyphs.pbf", "resources")); + ::testing::Values( + "source_raster.json", + "source_vector.json", + "sprite.json", + "sprite.png", + "sprite", + "raster.png", + "vector.pbf", + "glyphs.pbf", + "resources")); diff --git a/test/style/resource_loading.cpp b/test/style/resource_loading.cpp index 700a42c42f..f65c9c1f97 100644 --- a/test/style/resource_loading.cpp +++ b/test/style/resource_loading.cpp @@ -98,11 +98,11 @@ void runTestCase(MockFileSource::Type type, } catch (const util::GlyphRangeLoadingException&) { EXPECT_EQ(param, "glyphs.pbf"); } catch (const util::SourceLoadingException&) { - EXPECT_EQ(param, "source.json"); + EXPECT_TRUE(param == "source_raster.json" || param == "source_vector.json"); } catch (const util::SpriteLoadingException&) { EXPECT_TRUE(param == "sprite.png" || param == "sprite.json"); } catch (const util::TileLoadingException&) { - EXPECT_EQ(param, "vector.pbf"); + EXPECT_TRUE(param == "raster.png" || param == "vector.pbf"); } catch (const std::exception&) { EXPECT_TRUE(false) << "Unhandled exception."; } @@ -160,6 +160,8 @@ TEST_P(ResourceLoading, RequestWithCorruptedData) { if (param == "vector.pbf") { message << "\\[1(5|6)\\/1638(3|4)\\/1638(3|4)\\]\\: pbf unknown field type exception"; + } else if (param == "raster.png") { + message << "\\[17\\/6553(4|5|6|7)\\/6553(4|5|6|7)\\]\\: error parsing raster image"; } else { message << "\\[test\\/fixtures\\/resources\\/" << param << "\\]"; } @@ -172,4 +174,11 @@ TEST_P(ResourceLoading, RequestWithCorruptedData) { } INSTANTIATE_TEST_CASE_P(Style, ResourceLoading, - ::testing::Values("source.json", "sprite.json", "sprite.png", "vector.pbf", "glyphs.pbf")); + ::testing::Values( + "source_raster.json", + "source_vector.json", + "sprite.json", + "sprite.png", + "raster.png", + "vector.pbf", + "glyphs.pbf")); |