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

Function TEST

test/unit/test_datum.cpp:61–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59// ---------------------------------------------------------------------------
60
61TEST(datum, ellipsoid_from_sphere) {
62
63 auto ellipsoid = Ellipsoid::createSphere(PropertyMap(), Length(6378137));
64 EXPECT_FALSE(ellipsoid->inverseFlattening().has_value());
65 EXPECT_FALSE(ellipsoid->semiMinorAxis().has_value());
66 EXPECT_FALSE(ellipsoid->semiMedianAxis().has_value());
67 EXPECT_TRUE(ellipsoid->isSphere());
68 EXPECT_EQ(ellipsoid->semiMajorAxis(), Length(6378137));
69 EXPECT_EQ(ellipsoid->celestialBody(), "Earth");
70
71 EXPECT_EQ(ellipsoid->computeSemiMinorAxis(), Length(6378137));
72 EXPECT_EQ(ellipsoid->computedInverseFlattening(), 0);
73
74 EXPECT_EQ(
75 ellipsoid->exportToPROJString(PROJStringFormatter::create().get()),
76 "+R=6378137");
77
78 EXPECT_TRUE(ellipsoid->isEquivalentTo(ellipsoid.get()));
79 EXPECT_FALSE(ellipsoid->isEquivalentTo(createUnrelatedObject().get()));
80}
81
82// ---------------------------------------------------------------------------
83

Callers

nothing calls this directly

Calls 15

PropertyMapClass · 0.85
LengthClass · 0.85
ScaleClass · 0.85
AngleClass · 0.85
MeasureClass · 0.85
has_valueMethod · 0.80
isSphereMethod · 0.80
computeSemiMinorAxisMethod · 0.80
isEquivalentToMethod · 0.80
valueMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected