summaryrefslogtreecommitdiff
path: root/test/unit/t_value.cc
diff options
context:
space:
mode:
authortripun <tripun@gmail.com>2014-08-18 23:28:18 +0530
committertripun <tripun@gmail.com>2014-08-18 23:28:18 +0530
commit9a9d55499ea1a4ca5c2b9efe48d149b8cd2e01df (patch)
treeedae51f23abe738861a440c195b1c38c70f9d7c8 /test/unit/t_value.cc
parentb2bd337c31b1bf2481f643967b6670ada9d3cb2e (diff)
downloadfork-ledger-9a9d55499ea1a4ca5c2b9efe48d149b8cd2e01df.tar.gz
fork-ledger-9a9d55499ea1a4ca5c2b9efe48d149b8cd2e01df.tar.bz2
fork-ledger-9a9d55499ea1a4ca5c2b9efe48d149b8cd2e01df.zip
fix minor issues
Diffstat (limited to 'test/unit/t_value.cc')
-rw-r--r--test/unit/t_value.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/unit/t_value.cc b/test/unit/t_value.cc
index ad400daa..e8367bbe 100644
--- a/test/unit/t_value.cc
+++ b/test/unit/t_value.cc
@@ -83,10 +83,10 @@ BOOST_AUTO_TEST_CASE(testAssignment)
value_t v9 = balance_t("3 EUR");
value_t v10 = mask_t("regex");
value_t v11 = s1;
- value_t v12 = new value_t(string("$1"));
- value_t v13 = new value_t("2 CAD");
- value_t v14 = new value_t("comment",true);
- value_t v15 = new value_t(string("tag"),true);
+ value_t v12 = value_t(string("$1"));
+ value_t v13 = value_t("2 CAD");
+ value_t v14 = value_t("comment", true);
+ value_t v15 = value_t(string("tag"), true);
BOOST_CHECK(v1.valid());
BOOST_CHECK(v2.valid());
@@ -181,12 +181,15 @@ BOOST_AUTO_TEST_CASE(testSequence)
value_t v2("3 GBP");
value_t seq(v1);
const value_t v3(seq);
+
value_t::sequence_t::iterator i = std::find(seq.begin(), seq.end(), v2);
if (i != seq.end())
BOOST_CHECK(v2 == *i);
+
value_t::sequence_t::const_iterator j = std::find(v3.begin(), v3.end(), v2);
if (j != v3.end())
BOOST_CHECK(v2 == *j);
+
BOOST_CHECK(v2 == seq[1]);
BOOST_CHECK(v2 == v3[1]);
v1.pop_back();
@@ -468,7 +471,7 @@ BOOST_AUTO_TEST_CASE(testMultiplication)
v11 *= value_t(2L);
BOOST_CHECK_EQUAL(v11 ,v20);
- BOOST_CHECK_THROW(v10 += v8, value_error);
+ BOOST_CHECK_THROW(v10 *= v8, value_error);
BOOST_CHECK(v1.valid());
BOOST_CHECK(v2.valid());
BOOST_CHECK(v3.valid());