summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-09-30 16:59:01 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-10-01 11:40:47 -0700
commit2066295e358159ece5aa5717ad75567d0991a2b6 (patch)
tree7e408c8a512336bab07a4448adb38e9049a57604 /test
parent25cd2714e21044e2ee1120f621a626e9395ac0dd (diff)
downloadqtlocation-mapboxgl-2066295e358159ece5aa5717ad75567d0991a2b6.tar.gz
Install RapidJSON from mason
Diffstat (limited to 'test')
-rw-r--r--test/annotations/sprite_parser.cpp2
-rw-r--r--test/api/set_style.cpp2
-rw-r--r--test/miscellaneous/merge_lines.cpp52
-rw-r--r--test/style/resource_loading.cpp6
-rw-r--r--test/test.gypi1
5 files changed, 32 insertions, 31 deletions
diff --git a/test/annotations/sprite_parser.cpp b/test/annotations/sprite_parser.cpp
index 7033152581..d4c3f96d6a 100644
--- a/test/annotations/sprite_parser.cpp
+++ b/test/annotations/sprite_parser.cpp
@@ -216,7 +216,7 @@ TEST(Annotations, SpriteParsingInvalidJSON) {
const auto error = parseSprite(image_1x, json_1x).get<std::string>();
EXPECT_EQ(error,
- std::string("Failed to parse JSON: lacks ending quotation before the end of string at offset 10"));
+ std::string("Failed to parse JSON: Missing a closing quotation mark in string. at offset 13"));
}
TEST(Annotations, SpriteParsingEmptyImage) {
diff --git a/test/api/set_style.cpp b/test/api/set_style.cpp
index c3e62def20..23dff0152c 100644
--- a/test/api/set_style.cpp
+++ b/test/api/set_style.cpp
@@ -24,7 +24,7 @@ TEST(API, SetStyle) {
auto observer = Log::removeObserver();
auto flo = dynamic_cast<FixtureLogObserver*>(observer.get());
EXPECT_EQ(1ul, flo->count({ EventSeverity::Error, Event::ParseStyle, -1,
- "Error parsing style JSON at 0: Expect either an object or array at root" }));
+ "Error parsing style JSON at 0: Invalid value." }));
auto unchecked = flo->unchecked();
EXPECT_TRUE(unchecked.empty()) << unchecked;
}
diff --git a/test/miscellaneous/merge_lines.cpp b/test/miscellaneous/merge_lines.cpp
index 0e7328d195..90625e9e0a 100644
--- a/test/miscellaneous/merge_lines.cpp
+++ b/test/miscellaneous/merge_lines.cpp
@@ -2,27 +2,27 @@
#include <mbgl/util/merge_lines.hpp>
-const std::u32string a = U"a";
-const std::u32string b = U"b";
+const std::u32string aaa = U"a";
+const std::u32string bbb = U"b";
TEST(MergeLines, SameText) {
// merges lines with the same text
std::vector<mbgl::SymbolFeature> input1 = {
- { {{{0, 0}, {1, 0}, {2, 0}}}, a, "" },
- { {{{4, 0}, {5, 0}, {6, 0}}}, b, "" },
- { {{{8, 0}, {9, 0}}}, a, "" },
- { {{{2, 0}, {3, 0}, {4, 0}}}, a, "" },
- { {{{6, 0}, {7, 0}, {8, 0}}}, a, "" },
- { {{{5, 0}, {6, 0}}}, a, "" }
+ { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, "" },
+ { {{{4, 0}, {5, 0}, {6, 0}}}, bbb, "" },
+ { {{{8, 0}, {9, 0}}}, aaa, "" },
+ { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, "" },
+ { {{{6, 0}, {7, 0}, {8, 0}}}, aaa, "" },
+ { {{{5, 0}, {6, 0}}}, aaa, "" }
};
const std::vector<mbgl::SymbolFeature> expected1 = {
- { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}}, a, "" },
- { {{{4, 0}, {5, 0}, {6, 0}}}, b, "" },
- { {{{5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}}, a, "" },
- { {{}}, a, "" },
- { {{}}, a, "" },
- { {{}}, a, "" }
+ { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}}, aaa, "" },
+ { {{{4, 0}, {5, 0}, {6, 0}}}, bbb, "" },
+ { {{{5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}}, aaa, "" },
+ { {{}}, aaa, "" },
+ { {{}}, aaa, "" },
+ { {{}}, aaa, "" }
};
mbgl::util::mergeLines(input1);
@@ -35,15 +35,15 @@ TEST(MergeLines, SameText) {
TEST(MergeLines, BothEnds) {
// mergeLines handles merge from both ends
std::vector<mbgl::SymbolFeature> input2 = {
- { {{{0, 0}, {1, 0}, {2, 0}}}, a, "" },
- { {{{4, 0}, {5, 0}, {6, 0}}}, a, "" },
- { {{{2, 0}, {3, 0}, {4, 0}}}, a, "" }
+ { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, "" },
+ { {{{4, 0}, {5, 0}, {6, 0}}}, aaa, "" },
+ { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, "" }
};
const std::vector<mbgl::SymbolFeature> expected2 = {
- { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}}, a, "" },
- { {{}}, a, "" },
- { {{}}, a, "" }
+ { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}}, aaa, "" },
+ { {{}}, aaa, "" },
+ { {{}}, aaa, "" }
};
mbgl::util::mergeLines(input2);
@@ -56,15 +56,15 @@ TEST(MergeLines, BothEnds) {
TEST(MergeLines, CircularLines) {
// mergeLines handles circular lines
std::vector<mbgl::SymbolFeature> input3 = {
- { {{{0, 0}, {1, 0}, {2, 0}}}, a, "" },
- { {{{2, 0}, {3, 0}, {4, 0}}}, a, "" },
- { {{{4, 0}, {0, 0}}}, a, "" }
+ { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, "" },
+ { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, "" },
+ { {{{4, 0}, {0, 0}}}, aaa, "" }
};
const std::vector<mbgl::SymbolFeature> expected3 = {
- { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {0, 0}}}, a, "" },
- { {{}}, a, "" },
- { {{}}, a, "" }
+ { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {0, 0}}}, aaa, "" },
+ { {{}}, aaa, "" },
+ { {{}}, aaa, "" }
};
mbgl::util::mergeLines(input3);
diff --git a/test/style/resource_loading.cpp b/test/style/resource_loading.cpp
index 0562434586..d4cb929196 100644
--- a/test/style/resource_loading.cpp
+++ b/test/style/resource_loading.cpp
@@ -158,9 +158,9 @@ TEST_P(ResourceLoading, RequestWithCorruptedData) {
INSTANTIATE_TEST_CASE_P(Style, ResourceLoading,
::testing::Values(
- std::make_pair("source_raster.json", "Failed to parse \\[test\\/fixtures\\/resources\\/source_raster.json\\]: 0 - Expect either an object or array at root"),
- std::make_pair("source_vector.json", "Failed to parse \\[test\\/fixtures\\/resources\\/source_vector.json\\]: 0 - Expect either an object or array at root"),
- std::make_pair("sprite.json", "Failed to parse JSON: Expect either an object or array at root at offset 0"),
+ std::make_pair("source_raster.json", "Failed to parse \\[test\\/fixtures\\/resources\\/source_raster.json\\]: 0 - Invalid value."),
+ std::make_pair("source_vector.json", "Failed to parse \\[test\\/fixtures\\/resources\\/source_vector.json\\]: 0 - Invalid value."),
+ std::make_pair("sprite.json", "Failed to parse JSON: Invalid value. at offset 0"),
std::make_pair("sprite.png", "Could not parse sprite image"),
std::make_pair("raster.png", "Failed to parse \\[17\\/6553(4|5|6|7)\\/6553(4|5|6|7)\\]\\: error parsing raster image"),
std::make_pair("vector.pbf", "Failed to parse \\[1(5|6)\\/1638(3|4)\\/1638(3|4)\\]\\: pbf unknown field type exception"),
diff --git a/test/test.gypi b/test/test.gypi
index 1e3e2e0901..81302c874f 100644
--- a/test/test.gypi
+++ b/test/test.gypi
@@ -103,6 +103,7 @@
'<@(boost_cflags)',
'<@(sqlite_cflags)',
'<@(variant_cflags)',
+ '<@(rapidjson_cflags)',
],
'ldflags': [
'<@(libuv_ldflags)',