From 30dc4055ca5ee8336bb98d60e4142b197bf0765c Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 17:35:30 -0400 Subject: [PATCH] add line-width and bad colors fixtures --- test/fixtures/style_parser/colors.info.json | 6 +++ test/fixtures/style_parser/colors.style.json | 40 +++++++++++++++++++ .../style_parser/line-width.info.json | 7 ++++ .../style_parser/line-width.style.json | 20 ++++++++++ test/style_parser.cpp | 2 +- 5 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/style_parser/colors.info.json create mode 100644 test/fixtures/style_parser/colors.style.json create mode 100644 test/fixtures/style_parser/line-width.info.json create mode 100644 test/fixtures/style_parser/line-width.style.json diff --git a/test/fixtures/style_parser/colors.info.json b/test/fixtures/style_parser/colors.info.json new file mode 100644 index 000000000..9c25a2f48 --- /dev/null +++ b/test/fixtures/style_parser/colors.info.json @@ -0,0 +1,6 @@ +{ + "default": { + "log": [ + ] + } +} diff --git a/test/fixtures/style_parser/colors.style.json b/test/fixtures/style_parser/colors.style.json new file mode 100644 index 000000000..c3e94d637 --- /dev/null +++ b/test/fixtures/style_parser/colors.style.json @@ -0,0 +1,40 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "constants": { + "@land":"r44,239,225)", + "@snow":"f4f8foNGbjf#", + "@crop":"#eerLznieed4" + }, + "layers": [{ + "id": "background", + "type": "background", + "style": { + "background-color": "@land" + } + }, { + "id": "landcover_snow", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "snow" }, + "type": "fill", + "style": { + "fill-color": "@snow" + } + }, { + "id": "landcover_crop", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "crop" }, + "type": "fill", + "style": { + "fill-color": "@crop" + } + }] +} diff --git a/test/fixtures/style_parser/line-width.info.json b/test/fixtures/style_parser/line-width.info.json new file mode 100644 index 000000000..af2f9b284 --- /dev/null +++ b/test/fixtures/style_parser/line-width.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "value of 'line-width' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/line-width.style.json b/test/fixtures/style_parser/line-width.style.json new file mode 100644 index 000000000..83c66065d --- /dev/null +++ b/test/fixtures/style_parser/line-width.style.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "layers": [{ + "id": "waterway_river_canal", + "source": "mapbox", + "source-layer": "waterway", + "filter": { "type": ["river", "canal"] }, + "type": "line", + "style": { + "line-width": null + } + }] +} diff --git a/test/style_parser.cpp b/test/style_parser.cpp index d8d5907a2..53113ad53 100644 --- a/test/style_parser.cpp +++ b/test/style_parser.cpp @@ -75,7 +75,7 @@ TEST_P(StyleParserTest, ParseStyle) { std::cerr << "Unchecked Log Messages (" << base << "/" << name << "): " << std::endl << unchecked; } - // ASSERT_EQ(0, unchecked.size()); + ASSERT_EQ(0, unchecked.size()); } }