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

Function TEST_F

test/unit/test_factory.cpp:2273–2328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2271// ---------------------------------------------------------------------------
2272
2273TEST_F(FactoryWithTmpDatabase, AuthorityFactory_test_with_fake_EPSG_database) {
2274 createStructure();
2275 populateWithFakeEPSG();
2276
2277 auto factory =
2278 AuthorityFactory::create(DatabaseContext::create(m_ctxt), "EPSG");
2279
2280 EXPECT_TRUE(nn_dynamic_pointer_cast<UnitOfMeasure>(
2281 factory->createObject("9001")) != nullptr);
2282
2283 EXPECT_TRUE(nn_dynamic_pointer_cast<Extent>(
2284 factory->createObject("1262")) != nullptr);
2285
2286 EXPECT_TRUE(nn_dynamic_pointer_cast<PrimeMeridian>(
2287 factory->createObject("8901")) != nullptr);
2288
2289 EXPECT_TRUE(nn_dynamic_pointer_cast<Ellipsoid>(
2290 factory->createObject("7030")) != nullptr);
2291
2292 auto grf = nn_dynamic_pointer_cast<GeodeticReferenceFrame>(
2293 factory->createObject("6326"));
2294 ASSERT_TRUE(grf != nullptr);
2295 EXPECT_EQ(*grf->anchorDefinition(), "my anchor");
2296
2297 auto vrf = nn_dynamic_pointer_cast<VerticalReferenceFrame>(
2298 factory->createObject("1027"));
2299 ASSERT_TRUE(vrf != nullptr);
2300 EXPECT_EQ(*vrf->anchorDefinition(), "my anchor");
2301
2302 EXPECT_TRUE(nn_dynamic_pointer_cast<GeographicCRS>(
2303 factory->createObject("4326")) != nullptr);
2304
2305 EXPECT_TRUE(nn_dynamic_pointer_cast<VerticalCRS>(
2306 factory->createObject("3855")) != nullptr);
2307
2308 EXPECT_TRUE(nn_dynamic_pointer_cast<Conversion>(
2309 factory->createObject("16031")) != nullptr);
2310
2311 EXPECT_TRUE(nn_dynamic_pointer_cast<ProjectedCRS>(
2312 factory->createObject("32631")) != nullptr);
2313
2314 EXPECT_TRUE(nn_dynamic_pointer_cast<CompoundCRS>(
2315 factory->createObject("MY_COMPOUND")) != nullptr);
2316
2317 EXPECT_TRUE(nn_dynamic_pointer_cast<Transformation>(
2318 factory->createObject("DUMMY_HELMERT")) != nullptr);
2319
2320 EXPECT_TRUE(nn_dynamic_pointer_cast<Transformation>(factory->createObject(
2321 "DUMMY_GRID_TRANSFORMATION")) != nullptr);
2322
2323 EXPECT_TRUE(nn_dynamic_pointer_cast<Transformation>(factory->createObject(
2324 "DUMMY_OTHER_TRANSFORMATION")) != nullptr);
2325
2326 EXPECT_TRUE(nn_dynamic_pointer_cast<ConcatenatedOperation>(
2327 factory->createObject("DUMMY_CONCATENATED")) != nullptr);
2328}
2329
2330// ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 15

LengthClass · 0.85
ScaleClass · 0.85
createFromUserInputFunction · 0.85
createObjectMethod · 0.80
sizeMethod · 0.80
getAuthoritiesMethod · 0.80
endMethod · 0.80
lookForGridInfoMethod · 0.80
createGeodeticCRSMethod · 0.80
targetCRSMethod · 0.80

Tested by

no test coverage detected