diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-03-13 16:29:44 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-03-15 16:16:32 +0100 |
| commit | 80ef9cee87be3df8eb293e53a91992d6c19178bb (patch) | |
| tree | 8bd8068795d0f0d3f0708fa546c1eae2b1a83a86 /test/unit/test_factory.cpp | |
| parent | 7293d657a658c2f2930326246d739fb7802b1115 (diff) | |
| download | PROJ-80ef9cee87be3df8eb293e53a91992d6c19178bb.tar.gz PROJ-80ef9cee87be3df8eb293e53a91992d6c19178bb.zip | |
Add proj_context_get_database_structure() to dump structure of empty valid auxiliary DB
Diffstat (limited to 'test/unit/test_factory.cpp')
| -rw-r--r-- | test/unit/test_factory.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 5d336d0c..e0616baa 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -2828,10 +2828,12 @@ TEST(factory, attachExtraDatabases_auxiliary) { ASSERT_TRUE(dbAux != nullptr); ASSERT_TRUE(sqlite3_exec(dbAux, "BEGIN", nullptr, nullptr, nullptr) == SQLITE_OK); + + std::vector<std::string> tableStructureBefore; { auto ctxt = DatabaseContext::create(); - const auto dbStructure = ctxt->getDatabaseStructure(); - for (const auto &sql : dbStructure) { + tableStructureBefore = ctxt->getDatabaseStructure(); + for (const auto &sql : tableStructureBefore) { if (sql.find("CREATE TRIGGER") == std::string::npos) { ASSERT_TRUE(sqlite3_exec(dbAux, sql.c_str(), nullptr, nullptr, nullptr) == SQLITE_OK); @@ -2864,6 +2866,9 @@ TEST(factory, attachExtraDatabases_auxiliary) { auto gcrs = nn_dynamic_pointer_cast<GeographicCRS>(crs); EXPECT_TRUE(gcrs != nullptr); } + + const auto dbStructure = ctxt->getDatabaseStructure(); + EXPECT_EQ(dbStructure, tableStructureBefore); } { |
