MCPcopy Create free account
hub / github.com/pboettch/json-schema-validator / main

Function main

test/json-patch.cpp:28–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 } while (0)
27
28int main(void)
29{
30 OK(json_patch p1(R"([{"op":"add","path":"/0/renderable/bg","value":"Black"}])"_json));
31 OK(json_patch p1(R"([{"op":"replace","path":"/0/renderable/bg","value":"Black"}])"_json));
32 OK(json_patch p1(R"([{"op":"remove","path":"/0/renderable/bg"}])"_json));
33
34 // value not needed
35 KO(json_patch p1(R"([{"op":"remove","path":"/0/renderable/bg", "value":"Black"}])"_json));
36 // value missing
37 KO(json_patch p1(R"([{"op":"add","path":"/0/renderable/bg"}])"_json));
38 // value missing
39 KO(json_patch p1(R"([{"op":"replace","path":"/0/renderable/bg"}])"_json));
40
41 // wrong op
42 KO(json_patch p1(R"([{"op":"ad","path":"/0/renderable/bg","value":"Black"}])"_json));
43
44 // invalid json-pointer
45 KO(json_patch p1(R"([{"op":"add","path":"0/renderable/bg","value":"Black"}])"_json));
46
47 return 0;
48}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected