MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

unit_tests/extractor/string_table.cpp:63–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63BOOST_AUTO_TEST_CASE(check_string_table_fill)
64{
65 std::vector<std::string> expected_names = {
66 "", "A", "check_name", "ccc", "dDDd", "E", "ff", "ggg", "hhhh", "I", "jj", "", "kkk",
67 "llll", "M", "nn", "ooo", "pppp", "q", "r", "S", "T", "", "u", "V", "W",
68 "X", "Y", "Z", "", "", "", "", "", "", "", "0", ""};
69
70 auto data = PrepareStringTableData(expected_names, true);
71 StringTable string_table{data};
72
73 for (std::size_t index = 0; index < expected_names.size(); ++index)
74 {
75 const StringViewID id = 5 * index;
76 BOOST_CHECK_EQUAL(string_table.GetNameForID(id), expected_names[index]);
77 BOOST_CHECK_EQUAL(string_table.GetRefForID(id), expected_names[index] + "_ref");
78 BOOST_CHECK_EQUAL(string_table.GetDestinationsForID(id), expected_names[index] + "_des");
79 BOOST_CHECK_EQUAL(string_table.GetPronunciationForID(id), expected_names[index] + "_pro");
80 BOOST_CHECK_EQUAL(string_table.GetExitsForID(id), expected_names[index] + "_ext");
81 }
82}
83
84BOOST_AUTO_TEST_CASE(check_string_table_nofill)
85{

Callers

nothing calls this directly

Calls 8

PrepareStringTableDataFunction · 0.85
sizeMethod · 0.45
GetNameForIDMethod · 0.45
GetRefForIDMethod · 0.45
GetDestinationsForIDMethod · 0.45
GetPronunciationForIDMethod · 0.45
GetExitsForIDMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected