diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/src/mbgl/test/fixture_log_observer.cpp | 6 | ||||
-rw-r--r-- | test/style/conversion/function.test.cpp | 14 | ||||
-rw-r--r-- | test/style/conversion/light.test.cpp | 14 | ||||
-rw-r--r-- | test/style/filter.test.cpp | 8 | ||||
-rw-r--r-- | test/style/source.test.cpp | 2 |
5 files changed, 22 insertions, 22 deletions
diff --git a/test/src/mbgl/test/fixture_log_observer.cpp b/test/src/mbgl/test/fixture_log_observer.cpp index db257d73cf..717d2da753 100644 --- a/test/src/mbgl/test/fixture_log_observer.cpp +++ b/test/src/mbgl/test/fixture_log_observer.cpp @@ -94,10 +94,10 @@ std::vector<FixtureLog::Message> FixtureLogObserver::unchecked() const { } ::std::ostream& operator<<(::std::ostream& os, const FixtureLog::Message& message) { - os << "[\"" << Enum<EventSeverity>::toString(message.severity) << "\", \""; - os << Enum<Event>::toString(message.event) << "\""; + os << R"([")" << Enum<EventSeverity>::toString(message.severity) << R"(", ")"; + os << Enum<Event>::toString(message.event) << R"(")"; os << ", " << message.code; - os << ", \"" << message.msg << "\""; + os << R"(, ")" << message.msg << R"(")"; return os << "]" << std::endl; } diff --git a/test/style/conversion/function.test.cpp b/test/style/conversion/function.test.cpp index 08637d40cb..1eff94d939 100644 --- a/test/style/conversion/function.test.cpp +++ b/test/style/conversion/function.test.cpp @@ -19,26 +19,26 @@ TEST(StyleConversion, Function) { return convert<CameraFunction<float>, JSValue>(doc, error); }; - auto fn1 = parseFunction("{\"stops\":[]}"); + auto fn1 = parseFunction(R"({"stops":[]})"); ASSERT_FALSE(fn1); ASSERT_EQ("function must have at least one stop", error.message); - auto fn2 = parseFunction("{\"stops\":[1]}"); + auto fn2 = parseFunction(R"({"stops":[1]})"); ASSERT_FALSE(fn2); ASSERT_EQ("function stop must be an array", error.message); - auto fn3 = parseFunction("{\"stops\":[[]]}"); + auto fn3 = parseFunction(R"({"stops":[[]]})"); ASSERT_FALSE(fn3); ASSERT_EQ("function stop must have two elements", error.message); - auto fn4 = parseFunction("{\"stops\":[[-1,-1]]}"); + auto fn4 = parseFunction(R"({"stops":[[-1,-1]]})"); ASSERT_TRUE(bool(fn4)); - auto fn5 = parseFunction("{\"stops\":[[0,1,2]]}"); + auto fn5 = parseFunction(R"({"stops":[[0,1,2]]})"); ASSERT_FALSE(fn5); ASSERT_EQ("function stop must have two elements", error.message); - auto fn6 = parseFunction("{\"stops\":[[0,\"x\"]]}"); + auto fn6 = parseFunction(R"({"stops":[[0,"x"]]})"); ASSERT_FALSE(fn6); ASSERT_EQ("value must be a number", error.message); @@ -50,7 +50,7 @@ TEST(StyleConversion, Function) { ASSERT_FALSE(fn8); ASSERT_EQ("function must be an object", error.message); - auto fn9 = parseFunction("{\"stops\":[[0,0]],\"base\":false}"); + auto fn9 = parseFunction(R"({"stops":[[0,0]],"base":false})"); ASSERT_FALSE(fn9); ASSERT_EQ("function base must be a number", error.message); } diff --git a/test/style/conversion/light.test.cpp b/test/style/conversion/light.test.cpp index a2185906d6..28e22b3550 100644 --- a/test/style/conversion/light.test.cpp +++ b/test/style/conversion/light.test.cpp @@ -30,7 +30,7 @@ TEST(StyleConversion, Light) { } { - auto light = parseLight("{\"color\":{\"stops\":[[14,\"blue\"],[16,\"red\"]]},\"intensity\":0.3,\"position\":[3,90,90]}"); + auto light = parseLight(R"({"color":{"stops":[[14,"blue"],[16,"red"]]},"intensity":0.3,"position":[3,90,90]})"); ASSERT_TRUE((bool) light); ASSERT_TRUE(light->getAnchor().isUndefined()); @@ -54,7 +54,7 @@ TEST(StyleConversion, Light) { } { - auto light = parseLight("{\"color\":\"blue\",\"intensity\":0.3,\"color-transition\":{\"duration\":1000}}"); + auto light = parseLight(R"({"color":"blue","intensity":0.3,"color-transition":{"duration":1000}})"); ASSERT_TRUE((bool) light); ASSERT_FALSE(light->getColor().isUndefined()); @@ -65,35 +65,35 @@ TEST(StyleConversion, Light) { } { - auto light = parseLight("{\"intensity\":false}"); + auto light = parseLight(R"({"intensity":false})"); ASSERT_FALSE((bool) light); ASSERT_EQ("value must be a number", error.message); } { - auto light = parseLight("{\"intensity\":{\"stops\":[[15,\"red\"],[17,\"blue\"]]}}"); + auto light = parseLight(R"({"intensity":{"stops":[[15,"red"],[17,"blue"]]}})"); ASSERT_FALSE((bool) light); ASSERT_EQ("value must be a number", error.message); } { - auto light = parseLight("{\"color\":5}"); + auto light = parseLight(R"({"color":5})"); ASSERT_FALSE((bool) light); ASSERT_EQ("value must be a string", error.message); } { - auto light = parseLight("{\"position\":[0,5]}"); + auto light = parseLight(R"({"position":[0,5]})"); ASSERT_FALSE((bool) light); ASSERT_EQ("value must be an array of 3 numbers", error.message); } { - auto light = parseLight("{\"anchor\":\"something\"}"); + auto light = parseLight(R"({"anchor":"something"})"); ASSERT_FALSE((bool) light); ASSERT_EQ("value must be a valid enumeration value", error.message); diff --git a/test/style/filter.test.cpp b/test/style/filter.test.cpp index c70792d8ef..96de125945 100644 --- a/test/style/filter.test.cpp +++ b/test/style/filter.test.cpp @@ -29,13 +29,13 @@ Feature feature(const PropertyMap& properties, const Geometry<double>& geometry } TEST(Filter, EqualsString) { - Filter f = parse("[\"==\", \"foo\", \"bar\"]"); + Filter f = parse(R"(["==", "foo", "bar"])"); ASSERT_TRUE(f(feature({{ "foo", std::string("bar") }}))); ASSERT_FALSE(f(feature({{ "foo", std::string("baz") }}))); } TEST(Filter, EqualsNumber) { - Filter f = parse("[\"==\", \"foo\", 0]"); + Filter f = parse(R"(["==", "foo", 0])"); ASSERT_TRUE(f(feature({{ "foo", int64_t(0) }}))); ASSERT_TRUE(f(feature({{ "foo", uint64_t(0) }}))); ASSERT_TRUE(f(feature({{ "foo", double(0) }}))); @@ -50,13 +50,13 @@ TEST(Filter, EqualsNumber) { } TEST(Filter, EqualsType) { - Filter f = parse("[\"==\", \"$type\", \"LineString\"]"); + Filter f = parse(R"(["==", "$type", "LineString"])"); ASSERT_FALSE(f(feature({{}}, Point<double>()))); ASSERT_TRUE(f(feature({{}}, LineString<double>()))); } TEST(Filter, InType) { - Filter f = parse("[\"in\", \"$type\", \"LineString\", \"Polygon\"]"); + Filter f = parse(R"(["in", "$type", "LineString", "Polygon"])"); ASSERT_FALSE(f(feature({{}}, Point<double>()))); ASSERT_TRUE(f(feature({{}}, LineString<double>()))); ASSERT_TRUE(f(feature({{}}, Polygon<double>()))); diff --git a/test/style/source.test.cpp b/test/style/source.test.cpp index c60a473589..9c0d914543 100644 --- a/test/style/source.test.cpp +++ b/test/style/source.test.cpp @@ -413,7 +413,7 @@ TEST(Source, GeoJSonSourceUrlUpdate) { test.fileSource.sourceResponse = [&] (const Resource& resource) { EXPECT_EQ("url", resource.url); Response response; - response.data = std::make_unique<std::string>("{\"geometry\": {\"type\": \"Point\", \"coordinates\": [1.1, 1.1]}, \"type\": \"Feature\", \"properties\": {}}"); + response.data = std::make_unique<std::string>(R"({"geometry": {"type": "Point", "coordinates": [1.1, 1.1]}, "type": "Feature", "properties": {}})"); return response; }; |