MCPcopy Create free account
hub / github.com/apache/impala / TestSkip

Method TestSkip

be/src/exec/json/json-parser-test.cc:86–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 };
85
86 void TestSkip(const char* v, JsonValueType t, ParseErrorCode e = kParseErrorNone) {
87 SimpleStream ss(v);
88 JsonSkipper<SimpleStream> js(ss);
89 bool res;
90 switch (t) {
91 case TYPE_NULL: res = js.SkipNull(); break;
92 case TYPE_TRUE: res = js.SkipTrue(); break;
93 case TYPE_FALSE: res = js.SkipFalse(); break;
94 case TYPE_STRING: res = js.SkipString(); break;
95 case TYPE_NUMBER: res = js.SkipNumber(); break;
96 case TYPE_OBJECT: res = js.SkipObject(); break;
97 case TYPE_ARRAY: res = js.SkipArray(); break;
98 case TYPE_VALUE: res = js.SkipValue(); break;
99 default: ASSERT_TRUE(false);
100 }
101 if (e == kParseErrorNone) {
102 EXPECT_TRUE(res) << v;
103 EXPECT_TRUE(ss.Eos());
104 } else {
105 EXPECT_FALSE(res) << v;
106 EXPECT_EQ(js.GetErrorCode(), e) << v;
107 }
108 }
109
110 private:
111 size_t repeats_ = 0;

Callers

nothing calls this directly

Calls 10

SkipNullMethod · 0.80
SkipTrueMethod · 0.80
SkipFalseMethod · 0.80
SkipStringMethod · 0.80
SkipNumberMethod · 0.80
SkipObjectMethod · 0.80
SkipArrayMethod · 0.80
SkipValueMethod · 0.80
GetErrorCodeMethod · 0.80
EosMethod · 0.45

Tested by

no test coverage detected