diff --git a/xml_converter/integration_tests/run_tests.py b/xml_converter/integration_tests/run_tests.py index dd4ad715..64589d29 100755 --- a/xml_converter/integration_tests/run_tests.py +++ b/xml_converter/integration_tests/run_tests.py @@ -118,6 +118,7 @@ def rebuild_xml_converter_binary() -> None: ################################################################################ line_patterns_to_ignore = [ r"^Loading taco pack .*$", + r"^Loading waypoint pack .*$", r"^The taco parse function took [0-9]+ milliseconds to run$", r"^The xml write function took [0-9]+ milliseconds to run$", r"^The protobuf read function took [0-9]+ milliseconds to run$", @@ -170,6 +171,7 @@ def main() -> bool: rawstdout, rawstderr, returncode = run_xml_converter( input_xml=testcase.xml_input_paths, + input_proto=testcase.proto_input_paths, output_xml=[xml_output_dir_path], output_proto=[proto_output_dir_path], ) diff --git a/xml_converter/integration_tests/test_cases/display_name_valid/input/pack/xml_file.xml b/xml_converter/integration_tests/test_cases/display_name_valid/input/pack/xml_file.xml new file mode 100644 index 00000000..651af9cb --- /dev/null +++ b/xml_converter/integration_tests/test_cases/display_name_valid/input/pack/xml_file.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/display_name_valid/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/display_name_valid/output_proto/markers.bin new file mode 100644 index 00000000..478c3f29 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/display_name_valid/output_proto/markers.bin @@ -0,0 +1,7 @@ + +, + My Category 2B \Ï)Cf¦RC{ÔWCB(èÌ“^– +™ +Nested Level Onef +Nested Level Two3 +Nested Level Three 2B \Ï)Cf¦RC{ÔWCBp,Tԅ߈¤ 2B \Ï)Cf¦RC{ÔWCB¸šÜ¸·xjÏ 2B \Ï)Cf¦RC{ÔWCB,’§íj@: \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/display_name_valid/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/display_name_valid/output_xml/xml_file.xml new file mode 100644 index 00000000..78dbad1a --- /dev/null +++ b/xml_converter/integration_tests/test_cases/display_name_valid/output_xml/xml_file.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/display_name_valid/testcase.yaml b/xml_converter/integration_tests/test_cases/display_name_valid/testcase.yaml new file mode 100644 index 00000000..9510c793 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/display_name_valid/testcase.yaml @@ -0,0 +1,5 @@ +input_paths: + "pack": "xml" +expected_stdout: | +expected_stderr: | +expected_returncode: 0 diff --git a/xml_converter/integration_tests/test_cases/proto_type_valid/input/pack/markers.bin b/xml_converter/integration_tests/test_cases/proto_type_valid/input/pack/markers.bin new file mode 100644 index 00000000..478c3f29 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_type_valid/input/pack/markers.bin @@ -0,0 +1,7 @@ + +, + My Category 2B \Ï)Cf¦RC{ÔWCB(èÌ“^– +™ +Nested Level Onef +Nested Level Two3 +Nested Level Three 2B \Ï)Cf¦RC{ÔWCBp,Tԅ߈¤ 2B \Ï)Cf¦RC{ÔWCB¸šÜ¸·xjÏ 2B \Ï)Cf¦RC{ÔWCB,’§íj@: \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/proto_type_valid/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/proto_type_valid/output_proto/markers.bin new file mode 100644 index 00000000..478c3f29 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_type_valid/output_proto/markers.bin @@ -0,0 +1,7 @@ + +, + My Category 2B \Ï)Cf¦RC{ÔWCB(èÌ“^– +™ +Nested Level Onef +Nested Level Two3 +Nested Level Three 2B \Ï)Cf¦RC{ÔWCBp,Tԅ߈¤ 2B \Ï)Cf¦RC{ÔWCB¸šÜ¸·xjÏ 2B \Ï)Cf¦RC{ÔWCB,’§íj@: \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/proto_type_valid/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/proto_type_valid/output_xml/xml_file.xml new file mode 100644 index 00000000..5e25a018 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_type_valid/output_xml/xml_file.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/proto_type_valid/testcase.yaml b/xml_converter/integration_tests/test_cases/proto_type_valid/testcase.yaml new file mode 100644 index 00000000..d87f4066 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_type_valid/testcase.yaml @@ -0,0 +1,5 @@ +input_paths: + "pack": "proto" +expected_stdout: | +expected_stderr: | +expected_returncode: 0 diff --git a/xml_converter/src/packaging_protobin.cpp b/xml_converter/src/packaging_protobin.cpp index 94cd27f8..3fe1b03a 100644 --- a/xml_converter/src/packaging_protobin.cpp +++ b/xml_converter/src/packaging_protobin.cpp @@ -29,8 +29,9 @@ void parse_waypoint_categories( map* marker_categories, vector* parsed_pois, ProtoReaderState* state) { - full_category_name += proto_category.name(); - Category* this_category = &(*marker_categories)[full_category_name]; + string category_name = normalize(proto_category.name()); + full_category_name += category_name; + Category* this_category = &(*marker_categories)[category_name]; this_category->parse_protobuf(proto_category, state); @@ -40,6 +41,7 @@ void parse_waypoint_categories( // TODO: The field category in Icon is being deprciated // This overwrites any icon.category with its position in the heirarchy icon->category.category = full_category_name; + icon->category_is_set = true; parsed_pois->push_back(icon); } for (int i = 0; i < proto_category.trail_size(); i++) { @@ -48,6 +50,7 @@ void parse_waypoint_categories( // TODO: The field category in Trail is being deprciated // This overwrites any trail.category with its position in the heirarchy trail->category.category = full_category_name; + trail->category_is_set = true; parsed_pois->push_back(trail); } @@ -216,10 +219,12 @@ void write_protobuf_file( Parseable* parsed_poi = (*parsed_pois)[i]; if (parsed_poi->classname() == "POI") { Icon* icon = dynamic_cast(parsed_poi); + // TODO(331): This is the wrong place to lowercase() the category and is hiding some crimes elsewhere category_to_pois[lowercase(icon->category.category)].push_back(parsed_poi); } else if (parsed_poi->classname() == "Trail") { Trail* trail = dynamic_cast(parsed_poi); + // TODO(331): This is the wrong place to lowercase() the category and is hiding some crimes elsewhere category_to_pois[lowercase(trail->category.category)].push_back(parsed_poi); } else {