Added KMB V9MM multi-geometry test case.

Signed-off-by: Sergiy Kozyr <s.trump@gmail.com>
This commit is contained in:
Sergiy Kozyr 2024-08-14 21:53:55 +03:00
parent a7233ac166
commit 07df47bf66
2 changed files with 53 additions and 0 deletions

View file

@ -910,6 +910,34 @@ UNIT_TEST(Kml_Deserialization_From_KMB_V8_And_V9MM)
TEST_EQUAL(dataFromBinV8.m_tracksData, dataFromBinV9MM.m_tracksData, ());
}
UNIT_TEST(Kml_Deserialization_From_KMB_V9MM_With_MultiGeometry)
{
kml::FileData dataFromBinV9MM;
try
{
MemReader reader(kBinKmlMultiGeometryV9MM.data(), kBinKmlMultiGeometryV9MM.size());
kml::binary::DeserializerKml des(dataFromBinV9MM);
des.Deserialize(reader);
}
catch (kml::binary::DeserializerKml::DeserializeException const & exc)
{
TEST(false, ("Failed to deserialize data from KMB V9MM", exc.what()));
}
TEST_EQUAL(dataFromBinV9MM.m_tracksData.size(), 1, ());
// Verify that geometry has two lines
auto lines = dataFromBinV9MM.m_tracksData[0].m_geometry.m_lines;
TEST_EQUAL(lines.size(), 2, ());
// Verify that each line has 3 points
auto line1 = lines[0];
auto line2 = lines[1];
TEST_EQUAL(line1.size(), 3, ());
TEST_EQUAL(line2.size(), 3, ());
}
UNIT_TEST(Kml_Ver_2_3)
{
std::string_view constexpr data = R"(<?xml version="1.0" encoding="UTF-8"?>

View file

@ -1706,3 +1706,28 @@ std::vector<uint8_t> const kBinKmlV9MM = {
0xe8, 0xfd, 0x26, 0x13, 0x8b, 0x1c, 0xc8, 0xc3, 0x06, 0xa4, 0xac, 0xb4, 0x49, 0x06, 0x01, 0x00,
0x29
};
// kBinKmlMultiGeometryV9MM contains the track with two lines in geometry
std::vector<uint8_t> const kBinKmlMultiGeometryV9MM = {
0x09, 0x26, 0x41, 0x3a, 0x33, 0x39, 0x37, 0x33, 0x65, 0x66, 0x34, 0x64, 0x2d, 0x66, 0x35, 0x31,
0x65, 0x2d, 0x34, 0x61, 0x37, 0x31, 0x2d, 0x38, 0x65, 0x64, 0x34, 0x2d, 0x64, 0x65, 0x61, 0x33,
0x63, 0x31, 0x39, 0x30, 0x64, 0x61, 0x63, 0x35, 0x00, 0x1e, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0xd3, 0xd0, 0xc3, 0x90, 0x95, 0x32, 0x00, 0x00, 0x09, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02,
0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x13, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xb3, 0xe6, 0xcc, 0x19, 0x00, 0xff, 0xc7, 0x6e,
0x00, 0x00, 0x02, 0x03, 0x84, 0x92, 0xe7, 0x90, 0x04, 0xe2, 0x85, 0x84, 0x9f, 0x05, 0xf5, 0x02,
0xad, 0x05, 0xa3, 0x01, 0x85, 0x02, 0xff, 0xff, 0x03, 0x00, 0x00, 0x03, 0xa0, 0x8a, 0xe9, 0x90,
0x04, 0xdc, 0x89, 0x87, 0x9f, 0x05, 0x0c, 0xe9, 0x02, 0x9b, 0x02, 0x09, 0xff, 0xff, 0x03, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0b, 0x11, 0x06, 0x1d, 0x00, 0x04, 0x01, 0x01, 0x05, 0x0b,
0x02, 0x04, 0x6d, 0x03, 0x05, 0x3c, 0x04, 0x06, 0x03, 0x05, 0x04, 0x10, 0x06, 0x04, 0x71, 0x07,
0x05, 0x66, 0x08, 0x04, 0x75, 0x09, 0x05, 0x0f, 0x0a, 0x05, 0x73, 0x0b, 0x05, 0x57, 0x0c, 0x05,
0x06, 0x0d, 0x05, 0x32, 0x0e, 0x05, 0x77, 0x0f, 0x05, 0x6c, 0x11, 0x05, 0x0d, 0x13, 0x05, 0x4e,
0x14, 0x06, 0x05, 0x17, 0x05, 0x69, 0x19, 0x05, 0x2f, 0x1a, 0x05, 0x74, 0x1b, 0x05, 0x5d, 0x1c,
0x05, 0x08, 0x1d, 0x05, 0x37, 0x1e, 0x05, 0x79, 0x1f, 0x05, 0x6e, 0x24, 0x06, 0x04, 0x34, 0x06,
0x0a, 0x28, 0xfe, 0xa0, 0xf5, 0xf6, 0xc1, 0xf4, 0xbb, 0x38, 0xe8, 0x29, 0x99, 0xe0, 0x0b, 0xa4,
0x4a, 0x99, 0x03, 0xce, 0x28, 0x46, 0x46, 0xc0, 0x90, 0x36, 0x01, 0x00, 0x04
};