aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_c_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-22 14:09:14 +0100
committerGitHub <noreply@github.com>2020-01-22 14:09:14 +0100
commitc5fb54168665d41503ef3a08f0534da58949b632 (patch)
tree19e2adc8809290881a6a13ec6001013d03170c7d /test/unit/test_c_api.cpp
parenta6390b59ae2bad2a763e7ab3341ee4c80e708b3d (diff)
parent66fd99a8831955034cb25c8468ecfe1f9d3a7d62 (diff)
downloadPROJ-c5fb54168665d41503ef3a08f0534da58949b632.tar.gz
PROJ-c5fb54168665d41503ef3a08f0534da58949b632.zip
Merge pull request #1839 from rouault/rfc4_utf8
[RFC4_dev] Use Win32 Unicode APIs and expect all strings to be UTF-8 (fixes #1765)
Diffstat (limited to 'test/unit/test_c_api.cpp')
-rw-r--r--test/unit/test_c_api.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index f87f6589..8871f679 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -4434,4 +4434,26 @@ TEST_F(CApi, proj_create_derived_geographic_crs) {
"+o_lat_p=-2 +lon_0=3 +datum=WGS84 +no_defs "
"+type=crs"));
}
+
+// ---------------------------------------------------------------------------
+
+TEST_F(CApi, proj_context_set_sqlite3_vfs_name) {
+
+ PJ_CONTEXT *ctx = proj_context_create();
+ proj_log_func(ctx, nullptr, [](void *, int, const char *) -> void {});
+
+ // Set a dummy VFS and check it is taken into account
+ // (failure to open proj.db)
+ proj_context_set_sqlite3_vfs_name(ctx, "dummy_vfs_name");
+ ASSERT_EQ(proj_create(ctx, "EPSG:4326"), nullptr);
+
+ // Restore default VFS
+ proj_context_set_sqlite3_vfs_name(ctx, nullptr);
+ PJ *crs_4326 = proj_create(ctx, "EPSG:4326");
+ ASSERT_NE(crs_4326, nullptr);
+ proj_destroy(crs_4326);
+
+ proj_context_destroy(ctx);
+}
+
} // namespace