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

Function TEST

tests/analysis/TestTypeAnalysisReport.cpp:7–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace ftg;
6
7TEST(TestTypeAnalysisReport, constructP) {
8 auto Report1 = std::make_unique<TypeAnalysisReport>();
9 auto Json1 = util::strToJson(R"(
10 {
11 "typeanalysis": {
12 "enums": null
13 }
14 }
15 )");
16 ASSERT_EQ(Json1, Report1->toJson());
17
18 std::string Str1 = R"(
19 {
20 "typeanalysis": {
21 "enums": {
22 "E1": {
23 "Enumerators": [
24 {"Name": "M1","Value": 1},
25 {"Name": "M2","Value": 2},
26 {"Name": "M3","Value": 3}
27 ],
28 "Name": "E1"
29 }
30 }
31 }
32 }
33 )";
34 auto Json2 = util::strToJson(Str1);
35 auto Report2 = std::make_unique<TypeAnalysisReport>();
36 ASSERT_TRUE(Report2->fromJson(Json2));
37
38 Report1 = std::make_unique<TypeAnalysisReport>(Report2.get());
39 ASSERT_EQ(Report1->toJson(), Report2->toJson());
40}
41
42TEST(TestTypeAnalysisReport, constructN) {
43 auto Report1 = std::make_unique<TypeAnalysisReport>();

Callers

nothing calls this directly

Calls 5

strToJsonFunction · 0.85
ASSERT_DEATHFunction · 0.85
toJsonMethod · 0.45
fromJsonMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected