summaryrefslogtreecommitdiff
path: root/src/unitnumber.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unitnumber.cpp')
-rw-r--r--src/unitnumber.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/unitnumber.cpp b/src/unitnumber.cpp
index 1d63682..4846a07 100644
--- a/src/unitnumber.cpp
+++ b/src/unitnumber.cpp
@@ -15,6 +15,8 @@ UnitNumber::UnitNumber()
15 "parse1", Bu::UnitSuite::expectPass ); 15 "parse1", Bu::UnitSuite::expectPass );
16 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::multiply1), 16 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::multiply1),
17 "multiply1", Bu::UnitSuite::expectPass ); 17 "multiply1", Bu::UnitSuite::expectPass );
18 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::divide1),
19 "divide1", Bu::UnitSuite::expectPass );
18 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::number1), 20 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::number1),
19 "number1", Bu::UnitSuite::expectPass ); 21 "number1", Bu::UnitSuite::expectPass );
20 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::compare1), 22 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::compare1),
@@ -68,6 +70,12 @@ void UnitNumber::multiply1()
68 ); 70 );
69} 71}
70 72
73void UnitNumber::divide1()
74{
75 unitTest(Number("4") / Number("10") == "0");
76 unitTest(Number("4") % Number("10") == "4");
77}
78
71#define mathTest( anum, op, bnum, answ ) \ 79#define mathTest( anum, op, bnum, answ ) \
72 unitTest( (Number(anum) op Number(bnum)).toString() == answ ) 80 unitTest( (Number(anum) op Number(bnum)).toString() == answ )
73 81