aboutsummaryrefslogtreecommitdiff
path: root/tests/libwallet_api_tests/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libwallet_api_tests/main.cpp')
-rw-r--r--tests/libwallet_api_tests/main.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp
index 9f8913c39..fe6cd556f 100644
--- a/tests/libwallet_api_tests/main.cpp
+++ b/tests/libwallet_api_tests/main.cpp
@@ -48,6 +48,7 @@ struct WalletManagerTest : public testing::Test
const char * WALLET_NAME = "testwallet";
const char * WALLET_PASS = "password";
+ const char * WALLET_PASS2 = "password22";
const char * WALLET_LANG = "English";
@@ -93,19 +94,36 @@ TEST_F(WalletManagerTest, WalletManagerCreatesWallet)
TEST_F(WalletManagerTest, WalletManagerOpensWallet)
{
+
Bitmonero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG);
std::string seed1 = wallet1->seed();
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);
- std::vector<std::string> words;
- std::string seed = wallet2->seed();
- boost::split(words, seed, boost::is_any_of(" "), boost::token_compress_on);
- ASSERT_TRUE(words.size() == 25);
std::cout << "** seed: " << wallet2->seed() << std::endl;
}
+
+TEST_F(WalletManagerTest, WalletManagerChangesPassword)
+{
+
+ Bitmonero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG);
+ std::string seed1 = wallet1->seed();
+ ASSERT_TRUE(wallet1->setPassword(WALLET_PASS2));
+ ASSERT_TRUE(wmgr->closeWallet(wallet1));
+ Bitmonero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME, WALLET_PASS2);
+ ASSERT_TRUE(wallet2->status() == Bitmonero::Wallet::Status_Ok);
+ ASSERT_TRUE(wallet2->seed() == seed1);
+ ASSERT_TRUE(wmgr->closeWallet(wallet2));
+ Bitmonero::Wallet * wallet3 = wmgr->openWallet(WALLET_NAME, WALLET_PASS);
+ ASSERT_FALSE(wallet3->status() == Bitmonero::Wallet::Status_Ok);
+
+}
+
+
+
+
int main(int argc, char** argv)
{
//epee::debug::get_set_enable_assert(true, false);