Update the unit tests to check for raster tiles failures

This commit is contained in:
Thiago Marcos P. Santos
2015-07-02 14:53:45 +03:00
parent e4cc06b798
commit f74bc9d8ce
2 changed files with 23 additions and 5 deletions

View File

@@ -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"));

View File

@@ -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"));