aboutsummaryrefslogtreecommitdiff
path: root/tests/libwallet_api_tests
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-08-23 13:46:51 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-08-23 13:47:21 +0300
commitbcf7b67cd6f85cdf8bf7799aa3890a56ea58ddc8 (patch)
tree6e969682e0d529723e21f6cb2f6a1b1c589d3116 /tests/libwallet_api_tests
parentlibwallet_api: helper method to return maximumAllowedAmount (diff)
downloadmonero-bcf7b67cd6f85cdf8bf7799aa3890a56ea58ddc8.tar.xz
libwallet_api: Wallet::amountFromString fixed
Diffstat (limited to 'tests/libwallet_api_tests')
-rw-r--r--tests/libwallet_api_tests/main.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp
index f4ef5dbe1..4d09ffb1b 100644
--- a/tests/libwallet_api_tests/main.cpp
+++ b/tests/libwallet_api_tests/main.cpp
@@ -213,6 +213,26 @@ TEST_F(WalletManagerTest, WalletManagerOpensWallet)
}
+TEST_F(WalletManagerTest, WalletMaxAmountAsString)
+{
+ LOG_PRINT_L3("max amount: " << Bitmonero::Wallet::displayAmount(
+ Bitmonero::Wallet::maximumAllowedAmount()));
+
+}
+
+TEST_F(WalletManagerTest, WalletAmountFromString)
+{
+ uint64_t amount = Bitmonero::Wallet::amountFromString("18446740");
+ ASSERT_TRUE(amount > 0);
+ amount = Bitmonero::Wallet::amountFromString("11000000000000");
+ ASSERT_FALSE(amount > 0);
+ amount = Bitmonero::Wallet::amountFromString("0.0");
+ ASSERT_FALSE(amount > 0);
+ amount = Bitmonero::Wallet::amountFromString("10.1");
+ ASSERT_TRUE(amount > 0);
+
+}
+
void open_wallet(Bitmonero::WalletManager *wmgr, Bitmonero::Wallet **wallet, const std::string &pass, std::mutex *mutex)
{
if (mutex)
@@ -226,6 +246,9 @@ void open_wallet(Bitmonero::WalletManager *wmgr, Bitmonero::Wallet **wallet, con
mutex->unlock();
}
+
+
+
//TEST_F(WalletManagerTest, WalletManagerOpensWalletWithPasswordAndReopenMultiThreaded)
//{
// // create password protected wallet