aboutsummaryrefslogtreecommitdiff
path: root/tests/libwallet_api_tests/main.cpp
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-06-10 12:51:09 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-06-10 12:51:09 +0300
commitc554055ce435ae2752820ba317d801f143804b3c (patch)
tree56e99bdd4f3e5d6760ae47cc06e8f5a6ee23e55d /tests/libwallet_api_tests/main.cpp
parentremoved unused "using" (diff)
downloadmonero-c554055ce435ae2752820ba317d801f143804b3c.tar.xz
Wallet::filename, Wallet::keysFilename, tests for move wallet
Diffstat (limited to 'tests/libwallet_api_tests/main.cpp')
-rw-r--r--tests/libwallet_api_tests/main.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp
index 91636d522..595e3ccfb 100644
--- a/tests/libwallet_api_tests/main.cpp
+++ b/tests/libwallet_api_tests/main.cpp
@@ -210,6 +210,35 @@ TEST_F(WalletManagerTest, WalletManagerOpensWallet)
std::cout << "** seed: " << wallet2->seed() << std::endl;
}
+TEST_F(WalletManagerTest, WalletManagerStoresWallet)
+{
+
+ Bitmonero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG);
+ std::string seed1 = wallet1->seed();
+ wallet1->store("");
+ ASSERT_TRUE(wmgr->closeWallet(wallet1));
+ Bitmonero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME, WALLET_PASS);
+ ASSERT_TRUE(wallet2->status() == Bitmonero::Wallet::Status_Ok);
+ ASSERT_TRUE(wallet2->seed() == seed1);
+}
+
+
+TEST_F(WalletManagerTest, WalletManagerMovesWallet)
+{
+
+ Bitmonero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG);
+ std::string WALLET_NAME_MOVED = std::string("/tmp/") + WALLET_NAME + ".moved";
+ std::string seed1 = wallet1->seed();
+ ASSERT_TRUE(wallet1->store(WALLET_NAME_MOVED));
+
+ Bitmonero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME_MOVED, WALLET_PASS);
+ ASSERT_TRUE(wallet2->filename() == WALLET_NAME_MOVED);
+ ASSERT_TRUE(wallet2->keysFilename() == WALLET_NAME_MOVED + ".keys");
+ ASSERT_TRUE(wallet2->status() == Bitmonero::Wallet::Status_Ok);
+ ASSERT_TRUE(wallet2->seed() == seed1);
+}
+
+
/*
TEST_F(WalletManagerTest, WalletManagerChangesPassword)
{