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

Function UNIT_TEST

generator/generator_tests/srtm_parser_test.cpp:24–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24UNIT_TEST(SRTM_FilenameTest)
25{
26 auto name = GetBase({56.4566, 37.3467});
27 TEST_EQUAL(name, "N56E037", ());
28
29 name = GetBase({34.077433, -118.304569});
30 TEST_EQUAL(name, "N34W119", ());
31
32 name = GetBase({1.0, 1.0});
33 TEST_EQUAL(name, "N01E001", ());
34
35 name = GetBase({0.1, 0.1});
36 TEST_EQUAL(name, "N00E000", ());
37
38 TEST_NOT_EQUAL(GetKey({0.1, 0.1}), GetKey({1.0, 1.0}), ());
39
40 name = GetBase({-0.1, -0.1});
41 TEST_EQUAL(name, "S01W001", ());
42
43 TEST_NOT_EQUAL(GetKey({0.1, 0.1}), GetKey({-0.1, -0.1}), ());
44
45 name = GetBase({-0.9, -0.9});
46 TEST_EQUAL(name, "S01W001", ());
47
48 TEST_EQUAL(GetKey({-0.9, -0.9}), GetKey({-0.1, -0.1}), ());
49
50 name = GetBase({-1.0, -1.0});
51 TEST_EQUAL(name, "S01W001", ());
52
53 TEST_EQUAL(GetKey({-0.9, -0.9}), GetKey({-1.0, -1.0}), ());
54
55 name = GetBase({-1.9, -1.1});
56 TEST_EQUAL(name, "S02W002", ());
57
58 TEST_NOT_EQUAL(GetKey({-1.1, -1.1}), GetKey({-1.0, -1.0}), ());
59
60 name = GetBase({-35.35, -12.1});
61 TEST_EQUAL(name, "S36W013", ());
62
63 name = GetBase({-34.622358, -58.383654});
64 TEST_EQUAL(name, "S35W059", ());
65}
66
67UNIT_TEST(SRTM_TileTest)
68{

Callers

nothing calls this directly

Calls 8

GetBaseFunction · 0.85
ReverseByteOrderFunction · 0.85
TESTFunction · 0.85
DataForTestsMethod · 0.80
GetTriangleHeightMethod · 0.80
GetBilinearHeightMethod · 0.80
GetKeyFunction · 0.70
GetHeightMethod · 0.45

Tested by

no test coverage detected