diff options
author | 0xFFFC0000 <0xFFFC0000@proton.me> | 2024-04-30 23:20:10 +0000 |
---|---|---|
committer | 0xFFFC0000 <0xFFFC0000@proton.me> | 2024-04-30 23:20:10 +0000 |
commit | de9c461a98f5e1fe3d428222f4917991a74c4b8f (patch) | |
tree | d99a457d423670f7e080243bfd802ef0a713df9f /tests | |
parent | Merge pull request #9243 (diff) | |
download | monero-de9c461a98f5e1fe3d428222f4917991a74c4b8f.tar.xz |
common: support boost filesystem copy_options.
Co-authored-by: selsta <selsta@sent.at>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core_tests/chaingen_serialization.h | 3 | ||||
-rw-r--r-- | tests/unit_tests/wallet_storage.cpp | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/tests/core_tests/chaingen_serialization.h b/tests/core_tests/chaingen_serialization.h index 7eac3987f..5a43e970e 100644 --- a/tests/core_tests/chaingen_serialization.h +++ b/tests/core_tests/chaingen_serialization.h @@ -35,6 +35,7 @@ #include <boost/archive/portable_binary_iarchive.hpp> #include <boost/filesystem/operations.hpp> +#include "common/util.h" namespace tools { @@ -110,7 +111,7 @@ namespace tools catch(...) { // if failed, try reading in unportable mode - boost::filesystem::copy_file(file_path, file_path + ".unportable", boost::filesystem::copy_option::overwrite_if_exists); + tools::copy_file(file_path, file_path + ".unportable"); data_file.close(); data_file.open( file_path, std::ios_base::binary | std::ios_base::in); if(data_file.fail()) diff --git a/tests/unit_tests/wallet_storage.cpp b/tests/unit_tests/wallet_storage.cpp index ff01e452c..c38839a1c 100644 --- a/tests/unit_tests/wallet_storage.cpp +++ b/tests/unit_tests/wallet_storage.cpp @@ -33,6 +33,7 @@ #include "file_io_utils.h" #include "wallet/wallet2.h" +#include "common/util.h" using namespace boost::filesystem; using namespace epee::file_io_utils; @@ -52,8 +53,8 @@ TEST(wallet_storage, store_to_file2file) ASSERT_TRUE(is_file_exist(source_wallet_file.string())); ASSERT_TRUE(is_file_exist(source_wallet_file.string() + ".keys")); - copy_file(source_wallet_file, interm_wallet_file, copy_option::overwrite_if_exists); - copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys", copy_option::overwrite_if_exists); + tools::copy_file(source_wallet_file.string(), interm_wallet_file.string()); + tools::copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys"); ASSERT_TRUE(is_file_exist(interm_wallet_file.string())); ASSERT_TRUE(is_file_exist(interm_wallet_file.string() + ".keys")); @@ -143,8 +144,8 @@ TEST(wallet_storage, change_password_same_file) ASSERT_TRUE(is_file_exist(source_wallet_file.string())); ASSERT_TRUE(is_file_exist(source_wallet_file.string() + ".keys")); - copy_file(source_wallet_file, interm_wallet_file, copy_option::overwrite_if_exists); - copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys", copy_option::overwrite_if_exists); + tools::copy_file(source_wallet_file.string(), interm_wallet_file.string()); + tools::copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys"); ASSERT_TRUE(is_file_exist(interm_wallet_file.string())); ASSERT_TRUE(is_file_exist(interm_wallet_file.string() + ".keys")); @@ -182,8 +183,8 @@ TEST(wallet_storage, change_password_different_file) ASSERT_TRUE(is_file_exist(source_wallet_file.string())); ASSERT_TRUE(is_file_exist(source_wallet_file.string() + ".keys")); - copy_file(source_wallet_file, interm_wallet_file, copy_option::overwrite_if_exists); - copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys", copy_option::overwrite_if_exists); + tools::copy_file(source_wallet_file.string(), interm_wallet_file.string()); + tools::copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys"); ASSERT_TRUE(is_file_exist(interm_wallet_file.string())); ASSERT_TRUE(is_file_exist(interm_wallet_file.string() + ".keys")); |