diff options
| author | MarcoFalke <[email protected]> | 2019-12-03 11:06:56 -0500 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2019-12-03 11:06:59 -0500 |
| commit | 1fdaa04cebaac61a1106ed52a35486039413a0cb (patch) | |
| tree | 275c10c7a62f55d7053d5c39bd2eb8020c86dc0f /src/test/dbwrapper_tests.cpp | |
| parent | Merge #17549: ci: misc cleanups (diff) | |
| parent | Add unit test for DB creation with unicode path (diff) | |
| download | discoin-1fdaa04cebaac61a1106ed52a35486039413a0cb.tar.xz discoin-1fdaa04cebaac61a1106ed52a35486039413a0cb.zip | |
Merge #17641: Add unit test for leveldb creation with unicode path
70ed2ab7ef9e7ebf56f77b7c410a345ff455938f Add unit test for DB creation with unicode path (Aaron Clauson)
Pull request description:
An issue arose when attempting to switch back to the main repo version of leveldb when the bitcoin data directory uses a unicode path. The leveldb windows file IO wrapper was using the *A ANSI win32 calls instead of the Unicode *W ones. This unit test will catch if the path created by leveldb doesn't match what we're expecting. For more info see https://github.com/google/leveldb/issues/755.
ACKs for top commit:
laanwj:
ACK 70ed2ab7ef9e7ebf56f77b7c410a345ff455938f
Tree-SHA512: fc6dbd3aa26a439016e63e8d4d931f218ce99094fc7887a13b54562ad4133047020288ecbcd622a8309f422ee1eda5df50bcb8c8e44442af36ed57b22c069004
Diffstat (limited to 'src/test/dbwrapper_tests.cpp')
| -rw-r--r-- | src/test/dbwrapper_tests.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/dbwrapper_tests.cpp b/src/test/dbwrapper_tests.cpp index 57d5b2bb5..b647c0f70 100644 --- a/src/test/dbwrapper_tests.cpp +++ b/src/test/dbwrapper_tests.cpp @@ -397,6 +397,18 @@ BOOST_AUTO_TEST_CASE(iterator_string_ordering) } } +BOOST_AUTO_TEST_CASE(unicodepath) +{ + // Attempt to create a database with a utf8 character in the path. + // On Windows this test will fail if the directory is created using + // the ANSI CreateDirectoryA call and the code page isn't UTF8. + // It will succeed if the created with CreateDirectoryW. + fs::path ph = GetDataDir() / "test_runner_₿_🏃_20191128_104644"; + CDBWrapper dbw(ph, (1 << 20)); + + fs::path lockPath = ph / "LOCK"; + BOOST_CHECK(boost::filesystem::exists(lockPath)); +} BOOST_AUTO_TEST_SUITE_END() |