|
|
|
@ -26,7 +26,7 @@ BOOST_AUTO_TEST_CASE(dbwrapper)
|
|
|
|
|
{
|
|
|
|
|
// Perform tests both obfuscated and non-obfuscated.
|
|
|
|
|
for (const bool obfuscate : {false, true}) {
|
|
|
|
|
fs::path ph = GetDataDir() / (obfuscate ? "dbwrapper_obfuscate_true" : "dbwrapper_obfuscate_false");
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / (obfuscate ? "dbwrapper_obfuscate_true" : "dbwrapper_obfuscate_false");
|
|
|
|
|
CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
|
|
|
|
|
char key = 'k';
|
|
|
|
|
uint256 in = InsecureRand256();
|
|
|
|
@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE(dbwrapper_basic_data)
|
|
|
|
|
{
|
|
|
|
|
// Perform tests both obfuscated and non-obfuscated.
|
|
|
|
|
for (bool obfuscate : {false, true}) {
|
|
|
|
|
fs::path ph = GetDataDir() / (obfuscate ? "dbwrapper_1_obfuscate_true" : "dbwrapper_1_obfuscate_false");
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / (obfuscate ? "dbwrapper_1_obfuscate_true" : "dbwrapper_1_obfuscate_false");
|
|
|
|
|
CDBWrapper dbw(ph, (1 << 20), false, true, obfuscate);
|
|
|
|
|
|
|
|
|
|
uint256 res;
|
|
|
|
@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE(dbwrapper_batch)
|
|
|
|
|
{
|
|
|
|
|
// Perform tests both obfuscated and non-obfuscated.
|
|
|
|
|
for (const bool obfuscate : {false, true}) {
|
|
|
|
|
fs::path ph = GetDataDir() / (obfuscate ? "dbwrapper_batch_obfuscate_true" : "dbwrapper_batch_obfuscate_false");
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / (obfuscate ? "dbwrapper_batch_obfuscate_true" : "dbwrapper_batch_obfuscate_false");
|
|
|
|
|
CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
|
|
|
|
|
|
|
|
|
|
char key = 'i';
|
|
|
|
@ -162,7 +162,7 @@ BOOST_AUTO_TEST_CASE(dbwrapper_iterator)
|
|
|
|
|
{
|
|
|
|
|
// Perform tests both obfuscated and non-obfuscated.
|
|
|
|
|
for (const bool obfuscate : {false, true}) {
|
|
|
|
|
fs::path ph = GetDataDir() / (obfuscate ? "dbwrapper_iterator_obfuscate_true" : "dbwrapper_iterator_obfuscate_false");
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / (obfuscate ? "dbwrapper_iterator_obfuscate_true" : "dbwrapper_iterator_obfuscate_false");
|
|
|
|
|
CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
|
|
|
|
|
|
|
|
|
|
// The two keys are intentionally chosen for ordering
|
|
|
|
@ -202,7 +202,7 @@ BOOST_AUTO_TEST_CASE(dbwrapper_iterator)
|
|
|
|
|
BOOST_AUTO_TEST_CASE(existing_data_no_obfuscate)
|
|
|
|
|
{
|
|
|
|
|
// We're going to share this fs::path between two wrappers
|
|
|
|
|
fs::path ph = GetDataDir() / "existing_data_no_obfuscate";
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / "existing_data_no_obfuscate";
|
|
|
|
|
create_directories(ph);
|
|
|
|
|
|
|
|
|
|
// Set up a non-obfuscated wrapper to write some initial data.
|
|
|
|
@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(existing_data_no_obfuscate)
|
|
|
|
|
BOOST_AUTO_TEST_CASE(existing_data_reindex)
|
|
|
|
|
{
|
|
|
|
|
// We're going to share this fs::path between two wrappers
|
|
|
|
|
fs::path ph = GetDataDir() / "existing_data_reindex";
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / "existing_data_reindex";
|
|
|
|
|
create_directories(ph);
|
|
|
|
|
|
|
|
|
|
// Set up a non-obfuscated wrapper to write some initial data.
|
|
|
|
@ -278,7 +278,7 @@ BOOST_AUTO_TEST_CASE(existing_data_reindex)
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(iterator_ordering)
|
|
|
|
|
{
|
|
|
|
|
fs::path ph = GetDataDir() / "iterator_ordering";
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / "iterator_ordering";
|
|
|
|
|
CDBWrapper dbw(ph, (1 << 20), true, false, false);
|
|
|
|
|
for (int x=0x00; x<256; ++x) {
|
|
|
|
|
uint8_t key = x;
|
|
|
|
@ -358,7 +358,7 @@ BOOST_AUTO_TEST_CASE(iterator_string_ordering)
|
|
|
|
|
{
|
|
|
|
|
char buf[10];
|
|
|
|
|
|
|
|
|
|
fs::path ph = GetDataDir() / "iterator_string_ordering";
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / "iterator_string_ordering";
|
|
|
|
|
CDBWrapper dbw(ph, (1 << 20), true, false, false);
|
|
|
|
|
for (int x=0x00; x<10; ++x) {
|
|
|
|
|
for (int y = 0; y < 10; y++) {
|
|
|
|
@ -404,7 +404,7 @@ BOOST_AUTO_TEST_CASE(unicodepath)
|
|
|
|
|
// 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 created with CreateDirectoryW.
|
|
|
|
|
fs::path ph = GetDataDir() / "test_runner_₿_🏃_20191128_104644";
|
|
|
|
|
fs::path ph = m_args.GetDataDirPath() / "test_runner_₿_🏃_20191128_104644";
|
|
|
|
|
CDBWrapper dbw(ph, (1 << 20));
|
|
|
|
|
|
|
|
|
|
fs::path lockPath = ph / "LOCK";
|
|
|
|
|