MCPcopy Create free account
hub / github.com/OSGeo/PROJ / check_axis_is_height

Function check_axis_is_height

test/unit/test_c_api.cpp:5000–5034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4998// ---------------------------------------------------------------------------
4999
5000static void check_axis_is_height(PJ_CONTEXT *ctx, PJ *cs, int axis_number,
5001 const char *unit_name = "metre",
5002 double unit_conv_factor = 1,
5003 const char *auth = "EPSG",
5004 const char *code = "9001") {
5005
5006 const char *name = nullptr;
5007 const char *abbrev = nullptr;
5008 const char *direction = nullptr;
5009 double unitConvFactor = 0.0;
5010 const char *unitName = nullptr;
5011 const char *unitAuthority = nullptr;
5012 const char *unitCode = nullptr;
5013
5014 EXPECT_TRUE(proj_cs_get_axis_info(ctx, cs, axis_number, &name, &abbrev,
5015 &direction, &unitConvFactor, &unitName,
5016 &unitAuthority, &unitCode));
5017 ASSERT_NE(name, nullptr);
5018 ASSERT_NE(abbrev, nullptr);
5019 ASSERT_NE(direction, nullptr);
5020 ASSERT_NE(unitName, nullptr);
5021 if (auth) {
5022 ASSERT_NE(unitAuthority, nullptr);
5023 ASSERT_NE(unitCode, nullptr);
5024 }
5025 EXPECT_EQ(std::string(name), "Ellipsoidal height");
5026 EXPECT_EQ(std::string(abbrev), "h");
5027 EXPECT_EQ(std::string(direction), "up");
5028 EXPECT_EQ(unitConvFactor, unit_conv_factor) << unitConvFactor;
5029 EXPECT_EQ(std::string(unitName), unit_name);
5030 if (auth) {
5031 EXPECT_EQ(std::string(unitAuthority), auth);
5032 EXPECT_EQ(std::string(unitCode), code);
5033 }
5034}
5035
5036// ---------------------------------------------------------------------------
5037

Callers 1

TEST_FFunction · 0.85

Calls 1

proj_cs_get_axis_infoFunction · 0.85

Tested by

no test coverage detected