summaryrefslogtreecommitdiff
path: root/src/unitnumber.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/unitnumber.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/unitnumber.cpp b/src/unitnumber.cpp
index d4bc7a8..79797c9 100644
--- a/src/unitnumber.cpp
+++ b/src/unitnumber.cpp
@@ -5,6 +5,8 @@
5UnitNumber::UnitNumber() 5UnitNumber::UnitNumber()
6{ 6{
7 setName("Number"); 7 setName("Number");
8 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::parse1),
9 "parse1", Bu::UnitSuite::expectPass );
8 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::multiply1), 10 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::multiply1),
9 "multiply1", Bu::UnitSuite::expectPass ); 11 "multiply1", Bu::UnitSuite::expectPass );
10} 12}
@@ -13,10 +15,18 @@ UnitNumber::~UnitNumber()
13{ 15{
14} 16}
15 17
18void UnitNumber::parse1()
19{
20 unitTest( Number("121932631356500531347203169112635269").toString() ==
21 "121932631356500531347203169112635269" );
22}
23
16void UnitNumber::multiply1() 24void UnitNumber::multiply1()
17{ 25{
26 unitTest(Number("123456789") * Number("987654321") == "121932631112635269");
18 unitTest( 27 unitTest(
19 (Number("123456789123456789") * Number("987654321987654321")).toString() 28 Number("123456789123456789") * Number("987654321987654321") ==
20 == "121932631356500531347203169112635269" ); 29 "121932631356500531347203169112635269"
30 );
21} 31}
22 32