aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-06-10 12:51:09 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-06-23 16:01:41 +0300
commita5374897f89837d1373f6dcc4c92053320e5b9db (patch)
treecbd91c0749e1d0f2a7bdc8e017677010461fccdc /tests
parentremoved unused "using" (diff)
downloadmonero-a5374897f89837d1373f6dcc4c92053320e5b9db.tar.xz
Wallet::filename, Wallet::keysFilename, tests for move wallet
Diffstat (limited to '')
-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)
{