MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / TEST

Function TEST

source/test/json_test.cpp:10–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace Star;
9
10TEST(JsonTest, ImplicitSharing) {
11 Json map1 = JsonObject{{"foo", 1}, {"bar", 10}};
12
13 Json map2 = JsonObject{{"foo", 5}, {"bar", 50}};
14
15 std::swap(map1, map2);
16 Json map3 = map1;
17 map1 = map2;
18 map2 = map3;
19
20 EXPECT_EQ(map1.get("foo"), 1);
21 EXPECT_EQ(map2.get("bar"), 50);
22}
23
24TEST(JsonTest, Defaults) {
25 Json obj = JsonObject{{"null", Json()}};

Callers

nothing calls this directly

Calls 15

JsonClass · 0.85
StringClass · 0.85
finallyFunction · 0.85
jsonPatchFunction · 0.85
jsonMergeQueryFunction · 0.85
getIntMethod · 0.80
setAllMethod · 0.80
erasePathMethod · 0.80
getStringMethod · 0.80
toArrayMethod · 0.80
jsonMergeFunction · 0.50
parseFunction · 0.50

Tested by

no test coverage detected