MCPcopy Create free account
hub / github.com/Samsung/UTopia / TEST

Function TEST

tests/type/TestArrayInfo.cpp:8–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace ftg {
7
8TEST(TestArrayInfo, ToJsonP) {
9 std::string ExpectedJsonStr = R"(
10 {
11 "Incomplete" : false,
12 "LengthType" : 2,
13 "MaxLength" : 20
14 })";
15 Json::Value ExpectedJson = util::strToJson(ExpectedJsonStr);
16
17 std::unique_ptr<ArrayInfo> ArrInfo = std::make_unique<ArrayInfo>();
18 ArrInfo->setIncomplete(false);
19 ArrInfo->setLengthType(ArrayInfo::FIXED);
20 ArrInfo->setMaxLength(20);
21
22 auto ArrInfoJson = ArrInfo->toJson();
23 ASSERT_EQ(ArrInfoJson.toStyledString(), ExpectedJson.toStyledString());
24}
25
26TEST(TestArrayInfo, ToJsonWithUnsetN) {
27 std::string ExpectedJsonStr = R"(

Callers

nothing calls this directly

Calls 10

strToJsonFunction · 0.85
setIncompleteMethod · 0.80
setLengthTypeMethod · 0.80
setMaxLengthMethod · 0.80
toStyledStringMethod · 0.80
isIncompleteMethod · 0.80
getLengthTypeMethod · 0.80
getMaxLengthMethod · 0.80
toJsonMethod · 0.45
fromJsonMethod · 0.45

Tested by

no test coverage detected