"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libgnucash/engine/test/gtest-gnc-numeric.cpp" between
gnucash-3.6.tar.bz2 and gnucash-3.7.tar.bz2

About: GnuCash is personal and small-business financial-accounting software.

gtest-gnc-numeric.cpp  (gnucash-3.6.tar.bz2):gtest-gnc-numeric.cpp  (gnucash-3.7.tar.bz2)
skipping to change at line 182 skipping to change at line 182
EXPECT_THROW(GncNumeric overflow("12345678987654321.123456"), EXPECT_THROW(GncNumeric overflow("12345678987654321.123456"),
std::overflow_error); std::overflow_error);
EXPECT_NO_THROW(GncNumeric overflow("12345678987654321.123456", true)); EXPECT_NO_THROW(GncNumeric overflow("12345678987654321.123456", true));
GncNumeric overflow("12345678987654321.123456", true); GncNumeric overflow("12345678987654321.123456", true);
EXPECT_EQ(6028163568190586486, overflow.num()); EXPECT_EQ(6028163568190586486, overflow.num());
EXPECT_EQ(488, overflow.denom()); EXPECT_EQ(488, overflow.denom());
EXPECT_THROW(GncNumeric auto_round("12345678987654321234/256", true), EXPECT_THROW(GncNumeric auto_round("12345678987654321234/256", true),
std::out_of_range); std::out_of_range);
EXPECT_THROW(GncNumeric bad_string("Four score and seven"), EXPECT_THROW(GncNumeric bad_string("Four score and seven"),
std::invalid_argument); std::invalid_argument);
GncNumeric neg_decimal_frac("-0.12345");
EXPECT_EQ(-12345, neg_decimal_frac.num());
EXPECT_EQ(100000, neg_decimal_frac.denom());
GncNumeric neg_decimal_frac_nozero("-.12345");
EXPECT_EQ(-12345, neg_decimal_frac_nozero.num());
EXPECT_EQ(100000, neg_decimal_frac_nozero.denom());
} }
TEST(gncnumeric_output, string_output) TEST(gncnumeric_output, string_output)
{ {
GncNumeric simple_int(123456, 1); GncNumeric simple_int(123456, 1);
EXPECT_EQ("123456", simple_int.to_string()); EXPECT_EQ("123456", simple_int.to_string());
GncNumeric neg_simple_int(-123456, 1); GncNumeric neg_simple_int(-123456, 1);
EXPECT_EQ("-123456", neg_simple_int.to_string()); EXPECT_EQ("-123456", neg_simple_int.to_string());
GncNumeric decimal_string(123456, 1000); GncNumeric decimal_string(123456, 1000);
EXPECT_EQ("123.456", decimal_string.to_string()); EXPECT_EQ("123.456", decimal_string.to_string());
 End of changes. 1 change blocks. 
0 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)