aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMark Friedenbach <mark@friedenbach.org>2014-04-22 15:46:19 -0700
committerMark Friedenbach <mark@blockstream.io>2014-09-26 15:42:04 -0700
commita372168e77a8a195613a02983f2589252698bf0f (patch)
treeb300a5f7aa007645c6ba2bd708e7a962fab2894b /src/test
parent64cfaf891fe539b36f6be37dac6c28a712d70b96 (diff)
Use a typedef for monetary values
Diffstat (limited to 'src/test')
-rw-r--r--src/test/accounting_tests.cpp4
-rw-r--r--src/test/main_tests.cpp4
-rw-r--r--src/test/util_tests.cpp2
-rw-r--r--src/test/wallet_tests.cpp4
4 files changed, 7 insertions, 7 deletions
diff --git a/src/test/accounting_tests.cpp b/src/test/accounting_tests.cpp
index 4bee0f6b6e..af2a9a214f 100644
--- a/src/test/accounting_tests.cpp
+++ b/src/test/accounting_tests.cpp
@@ -15,7 +15,7 @@ extern CWallet* pwalletMain;
BOOST_AUTO_TEST_SUITE(accounting_tests)
static void
-GetResults(CWalletDB& walletdb, std::map<int64_t, CAccountingEntry>& results)
+GetResults(CWalletDB& walletdb, std::map<CAmount, CAccountingEntry>& results)
{
std::list<CAccountingEntry> aes;
@@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade)
std::vector<CWalletTx*> vpwtx;
CWalletTx wtx;
CAccountingEntry ae;
- std::map<int64_t, CAccountingEntry> results;
+ std::map<CAmount, CAccountingEntry> results;
LOCK(pwalletMain->cs_wallet);
diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp
index 8863ba4004..70a800af51 100644
--- a/src/test/main_tests.cpp
+++ b/src/test/main_tests.cpp
@@ -11,9 +11,9 @@ BOOST_AUTO_TEST_SUITE(main_tests)
BOOST_AUTO_TEST_CASE(subsidy_limit_test)
{
- uint64_t nSum = 0;
+ CAmount nSum = 0;
for (int nHeight = 0; nHeight < 14000000; nHeight += 1000) {
- uint64_t nSubsidy = GetBlockValue(nHeight, 0);
+ CAmount nSubsidy = GetBlockValue(nHeight, 0);
BOOST_CHECK(nSubsidy <= 50 * COIN);
nSum += nSubsidy * 1000;
BOOST_CHECK(MoneyRange(nSum));
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp
index e077c9de3b..6378bd0941 100644
--- a/src/test/util_tests.cpp
+++ b/src/test/util_tests.cpp
@@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(util_FormatMoney)
BOOST_AUTO_TEST_CASE(util_ParseMoney)
{
- int64_t ret = 0;
+ CAmount ret = 0;
BOOST_CHECK(ParseMoney("0.0", ret));
BOOST_CHECK_EQUAL(ret, 0);
diff --git a/src/test/wallet_tests.cpp b/src/test/wallet_tests.cpp
index 3887efbd0d..90fc470e06 100644
--- a/src/test/wallet_tests.cpp
+++ b/src/test/wallet_tests.cpp
@@ -28,7 +28,7 @@ BOOST_AUTO_TEST_SUITE(wallet_tests)
static CWallet wallet;
static vector<COutput> vCoins;
-static void add_coin(int64_t nValue, int nAge = 6*24, bool fIsFromMe = false, int nInput=0)
+static void add_coin(const CAmount& nValue, int nAge = 6*24, bool fIsFromMe = false, int nInput=0)
{
static int nextLockTime = 0;
CMutableTransaction tx;
@@ -66,7 +66,7 @@ static bool equal_sets(CoinSet a, CoinSet b)
BOOST_AUTO_TEST_CASE(coin_selection_tests)
{
CoinSet setCoinsRet, setCoinsRet2;
- int64_t nValueRet;
+ CAmount nValueRet;
LOCK(wallet.cs_wallet);