summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/t_amount.cc42
-rw-r--r--test/unit/t_commodity.cc10
-rw-r--r--test/unit/t_expr.cc8
-rw-r--r--test/unit/t_times.cc4
4 files changed, 32 insertions, 32 deletions
diff --git a/test/unit/t_amount.cc b/test/unit/t_amount.cc
index 63d82675..b1c7b837 100644
--- a/test/unit/t_amount.cc
+++ b/test/unit/t_amount.cc
@@ -249,7 +249,7 @@ void AmountTestCase::testAssignment()
assertEqual(x10, x9);
assertFalse(x1.is_null());
- x1 = x0; // sets x1 back to uninitialized state
+ x1 = x0; // sets x1 back to uninitialized state
assertTrue(x0.is_null());
assertTrue(x1.is_null());
@@ -699,11 +699,11 @@ void AmountTestCase::testCommoditySubtraction()
assertEqual(internalAmount("$123454434148472090.138858329277476789"), x7 - x8);
assertEqual(string("$123454434148472090.138858329277476789"), (x7 - x8).to_string());
assertEqual(string("$123454434148472090.14"),
- (amount_t("$1.00") * (x7 - x8)).to_string());
+ (amount_t("$1.00") * (x7 - x8)).to_string());
assertEqual(internalAmount("$-123454434148472090.138858329277476789"), x8 - x7);
assertEqual(string("$-123454434148472090.138858329277476789"), (x8 - x7).to_string());
assertEqual(string("$-123454434148472090.14"),
- (amount_t("$1.00") * (x8 - x7)).to_string());
+ (amount_t("$1.00") * (x8 - x7)).to_string());
assertValid(x1);
assertValid(x2);
@@ -743,7 +743,7 @@ void AmountTestCase::testIntegerMultiplication()
amount_t x4("123456789123456789123456789");
assertEqual(amount_t("15241578780673678546105778281054720515622620750190521"),
- x4 * x4);
+ x4 * x4);
assertValid(x1);
assertValid(y1);
@@ -780,7 +780,7 @@ void AmountTestCase::testFractionalMultiplication()
amount_t x2("123456789123456789.123456789123456789");
assertEqual(amount_t("15241578780673678546105778311537878.046486820281054720515622620750190521"),
- x2 * x2);
+ x2 * x2);
assertValid(x1);
assertValid(y1);
@@ -835,7 +835,7 @@ void AmountTestCase::testCommodityMultiplication()
amount_t x7(internalAmount("$123456789123456789.123456789123456789"));
assertEqual(internalAmount("$15241578780673678546105778311537878.046486820281054720515622620750190521"),
- x7 * x7);
+ x7 * x7);
assertValid(x1);
assertValid(x2);
@@ -877,7 +877,7 @@ void AmountTestCase::testIntegerDivision()
assertEqual(string("2204585520061728377204585.517857"), (x4 / y4).to_string());
assertEqual(amount_t("0.000000000000000000000000000001"),
- amount_t("10") / amount_t("10000000000000000000000000000000"));
+ amount_t("10") / amount_t("10000000000000000000000000000000"));
assertValid(x1);
assertValid(y1);
@@ -973,9 +973,9 @@ void AmountTestCase::testCommodityDivision()
assertEqual(amount_t("$1"), x7 / x7);
assertEqual(string("$0.0019216115121765559608381226612019501"),
- (x6 / x7).to_fullstring());
+ (x6 / x7).to_fullstring());
assertEqual(string("$520.39654928343335571379527154924040947272"),
- (x7 / x6).to_fullstring());
+ (x7 / x6).to_fullstring());
assertValid(x1);
assertValid(x2);
@@ -1110,14 +1110,14 @@ void AmountTestCase::testReduction()
amount_t x2("600s");
amount_t x3("6000s");
amount_t x4("360000s");
- amount_t x5("10m"); // 600s
- amount_t x6("100m"); // 6000s
- amount_t x7("1000m"); // 60000s
- amount_t x8("10000m"); // 600000s
- amount_t x9("10h"); // 36000s
- amount_t x10("100h"); // 360000s
- amount_t x11("1000h"); // 3600000s
- amount_t x12("10000h"); // 36000000s
+ amount_t x5("10m"); // 600s
+ amount_t x6("100m"); // 6000s
+ amount_t x7("1000m"); // 60000s
+ amount_t x8("10000m"); // 600000s
+ amount_t x9("10h"); // 36000s
+ amount_t x10("100h"); // 360000s
+ amount_t x11("1000h"); // 3600000s
+ amount_t x12("10000h"); // 36000000s
assertThrow(x0.reduce(), amount_error);
assertThrow(x0.unreduce(), amount_error);
@@ -1220,7 +1220,7 @@ void AmountTestCase::testCommodityForZero()
{
amount_t x1(internalAmount("$0.000000000000000000001"));
- assertTrue(x1); // an internal amount never betrays its precision
+ assertTrue(x1); // an internal amount never betrays its precision
assertFalse(x1.is_zero());
assertFalse(x1.is_realzero());
@@ -1287,7 +1287,7 @@ void AmountTestCase::testPrinting()
x1.print(bufstr);
assertEqual(std::string("982340823.380238098235098235098235098"),
- bufstr.str());
+ bufstr.str());
}
assertValid(x0);
@@ -1304,7 +1304,7 @@ void AmountTestCase::testCommodityPrinting()
x1.print(bufstr);
assertEqual(std::string("$982340823.386238098235098235098235098"),
- bufstr.str());
+ bufstr.str());
}
{
@@ -1312,7 +1312,7 @@ void AmountTestCase::testCommodityPrinting()
(x1 * x2).print(bufstr);
assertEqual(std::string("$964993493285024293.18099172508158508135413499124"),
- bufstr.str());
+ bufstr.str());
}
{
diff --git a/test/unit/t_commodity.cc b/test/unit/t_commodity.cc
index 3d84ead6..b8555202 100644
--- a/test/unit/t_commodity.cc
+++ b/test/unit/t_commodity.cc
@@ -73,11 +73,11 @@ void CommodityTestCase::testPriceHistory()
cad.add_price(jan17_06, amount_t("$1.11"));
#ifndef NOT_FOR_PYTHON
- optional<amount_t> amt = x1.value(false, feb28_07sbm);
+ optional<amount_t> amt = x1.value(feb28_07sbm);
assertTrue(amt);
assertEqual(amount_t("$1831.83"), *amt);
- amt = x1.value(false, CURRENT_TIME());
+ amt = x1.value(CURRENT_TIME());
assertTrue(amt);
assertEqual(string("$2124.12"), amt->to_string());
#ifdef INTEGER_MATH
@@ -86,18 +86,18 @@ void CommodityTestCase::testPriceHistory()
assertEqual(string("$2124.122"), amt->to_fullstring());
#endif
- amt = x1.value(false, CURRENT_TIME(), euro);
+ amt = x1.value(CURRENT_TIME(), euro);
assertTrue(amt);
assertEqual(string("EUR 1366.87"), amt->rounded().to_string());
// Add a newer Euro pricing
aapl.add_price(jan17_07, amount_t("EUR 23.00"));
- amt = x1.value(false, CURRENT_TIME(), euro);
+ amt = x1.value(CURRENT_TIME(), euro);
assertTrue(amt);
assertEqual(string("EUR 2302.30"), amt->to_string());
- amt = x1.value(false, CURRENT_TIME(), cad);
+ amt = x1.value(CURRENT_TIME(), cad);
assertTrue(amt);
assertEqual(string("CAD 3223.22"), amt->to_string());
#endif // NOT_FOR_PYTHON
diff --git a/test/unit/t_expr.cc b/test/unit/t_expr.cc
index 0d88be9e..d9dc1f1f 100644
--- a/test/unit/t_expr.cc
+++ b/test/unit/t_expr.cc
@@ -63,7 +63,7 @@ void ValueExprTestCase::testPredicateTokenizer2()
args.push_back(string_value("foo and bar"));
#ifndef NOT_FOR_PYTHON
- query_t::lexer_t tokens(args.begin(), args.end());
+ query_t::lexer_t tokens(args.begin(), args.end(), false);
assertEqual(query_t::lexer_t::token_t::TERM, tokens.next_token().kind);
assertEqual(query_t::lexer_t::token_t::TOK_AND, tokens.next_token().kind);
@@ -119,7 +119,7 @@ void ValueExprTestCase::testPredicateTokenizer5()
args.push_back(string_value("bar)"));
#ifndef NOT_FOR_PYTHON
- query_t::lexer_t tokens(args.begin(), args.end());
+ query_t::lexer_t tokens(args.begin(), args.end(), false);
assertEqual(query_t::lexer_t::token_t::LPAREN, tokens.next_token().kind);
assertEqual(query_t::lexer_t::token_t::TERM, tokens.next_token().kind);
@@ -168,7 +168,7 @@ void ValueExprTestCase::testPredicateTokenizer8()
args.push_back(string_value("expr 'foo and bar'"));
#ifndef NOT_FOR_PYTHON
- query_t::lexer_t tokens(args.begin(), args.end());
+ query_t::lexer_t tokens(args.begin(), args.end(), false);
assertEqual(query_t::lexer_t::token_t::TOK_EXPR, tokens.next_token().kind);
assertEqual(query_t::lexer_t::token_t::TERM, tokens.next_token().kind);
@@ -318,7 +318,7 @@ void ValueExprTestCase::testPredicateTokenizer16()
args.push_back(string_value("and bar|baz"));
#ifndef NOT_FOR_PYTHON
- query_t::lexer_t tokens(args.begin(), args.end());
+ query_t::lexer_t tokens(args.begin(), args.end(), false);
assertEqual(query_t::lexer_t::token_t::TERM, tokens.next_token().kind);
assertEqual(query_t::lexer_t::token_t::TOK_AND, tokens.next_token().kind);
diff --git a/test/unit/t_times.cc b/test/unit/t_times.cc
index d8a67b43..aaf31263 100644
--- a/test/unit/t_times.cc
+++ b/test/unit/t_times.cc
@@ -22,8 +22,8 @@ void DateTimeTestCase::tearDown()
void DateTimeTestCase::testConstructors()
{
#ifndef NOT_FOR_PYTHON
- std::time_t now = std::time(NULL);
- struct tm * moment = std::localtime(&now);
+ std::time_t now = std::time(NULL);
+ struct tm * moment = std::localtime(&now);
std::time_t localMoment = std::mktime(moment);
#endif // NOT_FOR_PYTHON