| 5 | using namespace ftg; |
| 6 | |
| 7 | TEST(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 | |
| 42 | TEST(TestTypeAnalysisReport, constructN) { |
| 43 | auto Report1 = std::make_unique<TypeAnalysisReport>(); |
nothing calls this directly
no test coverage detected