MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_CLASS_TEST

Function UNIT_CLASS_TEST

generator/generator_tests/metadata_parser_test.cpp:75–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75UNIT_CLASS_TEST(TestWithClassificator, Metadata_ValidateAndFormat_operator)
76{
77 uint32_t const typeAtm = classif().GetTypeByPath({"amenity", "atm"});
78 uint32_t const typeFuel = classif().GetTypeByPath({"amenity", "fuel"});
79 uint32_t const typeCarSharing = classif().GetTypeByPath({"amenity", "car_sharing"});
80 uint32_t const typeCarRental = classif().GetTypeByPath({"amenity", "car_rental"});
81
82 FeatureBuilderParams params;
83 MetadataTagProcessor p(params);
84 Metadata & md = params.GetMetadata();
85
86 // Ignore tag 'operator' if feature have inappropriate type.
87 p("operator", "Some");
88 TEST(md.Empty(), ());
89
90 params.SetType(typeAtm);
91 p("operator", "Some1");
92 TEST_EQUAL(md.Get(Metadata::FMD_OPERATOR), "Some1", ());
93
94 params.SetType(typeFuel);
95 p("operator", "Some2");
96 TEST_EQUAL(md.Get(Metadata::FMD_OPERATOR), "Some2", ());
97
98 params.SetType(typeCarSharing);
99 params.AddType(typeCarRental);
100 p("operator", "Some3");
101 TEST_EQUAL(md.Get(Metadata::FMD_OPERATOR), "Some3", ());
102}
103
104UNIT_TEST(Metadata_ValidateAndFormat_height)
105{

Callers

nothing calls this directly

Calls 9

TESTFunction · 0.85
GetTypeByPathMethod · 0.80
GetMetadataMethod · 0.45
EmptyMethod · 0.45
SetTypeMethod · 0.45
GetMethod · 0.45
AddTypeMethod · 0.45
emptyMethod · 0.45
DropMethod · 0.45

Tested by

no test coverage detected