diff options
author | Ilya Kitaev <mbg033@gmail.com> | 2016-08-23 14:13:30 +0300 |
---|---|---|
committer | Ilya Kitaev <mbg033@gmail.com> | 2016-08-23 14:13:30 +0300 |
commit | 99dd57258f8c8b0869d572cf4c728d7771499827 (patch) | |
tree | c2080124756ba7d1119ab629e9cf7c93a6438f39 /tests/libwallet_api_tests/main.cpp | |
parent | libwallet_api: Wallet::amountFromString fixed (diff) | |
download | monero-99dd57258f8c8b0869d572cf4c728d7771499827.tar.xz |
libwallet_api: tests: checking for result while opening wallet
Diffstat (limited to 'tests/libwallet_api_tests/main.cpp')
-rw-r--r-- | tests/libwallet_api_tests/main.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp index 4d09ffb1b..b4bc86f91 100644 --- a/tests/libwallet_api_tests/main.cpp +++ b/tests/libwallet_api_tests/main.cpp @@ -142,7 +142,7 @@ struct WalletManagerTest : public testing::Test { std::cout << __FUNCTION__ << std::endl; wmgr = Bitmonero::WalletManagerFactory::getWalletManager(); - Bitmonero::WalletManagerFactory::setLogLevel(Bitmonero::WalletManagerFactory::LogLevel_4); + // Bitmonero::WalletManagerFactory::setLogLevel(Bitmonero::WalletManagerFactory::LogLevel_4); Utils::deleteWallet(WALLET_NAME); Utils::deleteDir(boost::filesystem::path(WALLET_NAME_WITH_DIR).parent_path().string()); } @@ -233,7 +233,7 @@ TEST_F(WalletManagerTest, WalletAmountFromString) } -void open_wallet(Bitmonero::WalletManager *wmgr, Bitmonero::Wallet **wallet, const std::string &pass, std::mutex *mutex) +void open_wallet_helper(Bitmonero::WalletManager *wmgr, Bitmonero::Wallet **wallet, const std::string &pass, std::mutex *mutex) { if (mutex) mutex->lock(); @@ -288,11 +288,13 @@ TEST_F(WalletManagerTest, WalletManagerOpensWalletWithPasswordAndReopen) Bitmonero::Wallet *wallet3 = nullptr; std::mutex mutex; - open_wallet(wmgr, &wallet2, wrong_wallet_pass, nullptr); + open_wallet_helper(wmgr, &wallet2, wrong_wallet_pass, nullptr); + ASSERT_TRUE(wallet2 != nullptr); ASSERT_TRUE(wallet2->status() != Bitmonero::Wallet::Status_Ok); ASSERT_TRUE(wmgr->closeWallet(wallet2)); - open_wallet(wmgr, &wallet3, wallet_pass, nullptr); + open_wallet_helper(wmgr, &wallet3, wallet_pass, nullptr); + ASSERT_TRUE(wallet3 != nullptr); ASSERT_TRUE(wallet3->status() == Bitmonero::Wallet::Status_Ok); ASSERT_TRUE(wmgr->closeWallet(wallet3)); } |