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

Function UNIT_TEST

generator/address_parser/address_parser_tests/parser_tests.cpp:19–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17{
18
19UNIT_TEST(TigerParser_Smoke)
20{
21 double constexpr kEpsLL = 1.0E-6;
22
23 tiger::AddressEntry e;
24 TEST(!tiger::ParseLine("from;to;interpolation;street;city;state;postcode;geometry", e), ());
25
26 e = {};
27 TEST(tiger::ParseLine("9587;9619;all;;Platte;MO;64152;LINESTRING(-94.691917 39.210393,-94.692370 39.210351)", e), ());
28
29 e = {};
30 TEST(tiger::ParseLine("698;600;all;Boston St;Berkeley;WV;25401;LINESTRING(-77.970484 39.464604,-77.970540 39.464630)",
31 e),
32 ());
33 TEST_EQUAL(e.m_from, "600", ());
34 TEST_EQUAL(e.m_to, "698", ());
35 TEST_EQUAL(e.m_street, "Boston St", ());
36 TEST_EQUAL(e.m_postcode, "25401", ());
37 TEST_EQUAL(e.m_interpol, feature::InterpolType::Any, ());
38 TEST_EQUAL(e.m_geom.size(), 1, ());
39
40 TEST(ms::LatLon((39.464604 + 39.464630) / 2.0, (-77.970484 - 77.970540) / 2.0).EqualDxDy(e.m_geom.back(), kEpsLL),
41 ());
42
43 e = {};
44 TEST(tiger::ParseLine("798;700;all;Boston St;Berkeley;WV;25401;LINESTRING(-77.968929 39.463906,-77.969118 "
45 "39.463990,-77.969427 39.464129,-77.969946 39.464353,-77.970027 39.464389)",
46 e),
47 ());
48 TEST_EQUAL(e.m_from, "700", ());
49 TEST_EQUAL(e.m_to, "798", ());
50 TEST_EQUAL(e.m_street, "Boston St", ());
51 TEST_EQUAL(e.m_postcode, "25401", ());
52 TEST_EQUAL(e.m_interpol, feature::InterpolType::Any, ());
53 TEST_EQUAL(e.m_geom.size(), 4, ());
54
55 TEST(ms::LatLon(39.463906, -77.968929).EqualDxDy(e.m_geom.back(), kEpsLL), ());
56 TEST(ms::LatLon(39.464389, -77.970027).EqualDxDy(e.m_geom.front(), kEpsLL), ());
57
58 TEST(tiger::ParseLine("0;98;even;Austin Ln;Mifflin;PA;17044;LINESTRING(-77.634119 40.597239,-77.634200 "
59 "40.597288,-77.634679 40.598169,-77.634835 40.598393,-77.635116 40.598738,-77.635518 "
60 "40.599388,-77.635718 40.599719,-77.635833 40.599871,-77.635856 40.599920)",
61 e),
62 ());
63 TEST_EQUAL(e.m_from, "0", ());
64 TEST_EQUAL(e.m_to, "98", ());
65}
66
67class TmpDir
68{

Callers

nothing calls this directly

Calls 10

TESTFunction · 0.85
ParseLineFunction · 0.85
DeleteFileXFunction · 0.85
backMethod · 0.80
frontMethod · 0.80
LatLonClass · 0.50
sizeMethod · 0.45
EqualDxDyMethod · 0.45
GetMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected