From ffd2cb3437e802aa471544589bace2e59bbf0459 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 20 Oct 2016 16:45:02 -0700 Subject: [PATCH] Closes #1583 by setting up the datadir for the wallet gtest. --- src/wallet/gtest/test_wallet.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wallet/gtest/test_wallet.cpp b/src/wallet/gtest/test_wallet.cpp index c1bf5d34c..021de7c05 100644 --- a/src/wallet/gtest/test_wallet.cpp +++ b/src/wallet/gtest/test_wallet.cpp @@ -11,6 +11,8 @@ #include "zcash/Note.hpp" #include "zcash/NoteEncryption.hpp" +#include + using ::testing::Return; ZCJoinSplit* params = ZCJoinSplit::Unopened(); @@ -178,6 +180,13 @@ CWalletTx GetValidSpend(const libzcash::SpendingKey& sk, return wtx; } +TEST(wallet_tests, setup_datadir_location_run_as_first_test) { + // Get temporary and unique path for file. + boost::filesystem::path pathTemp = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path(); + boost::filesystem::create_directories(pathTemp); + mapArgs["-datadir"] = pathTemp.string(); +} + TEST(wallet_tests, note_data_serialisation) { auto sk = libzcash::SpendingKey::random(); auto wtx = GetValidReceive(sk, 10, true);