summaryrefslogtreecommitdiff
path: root/src/unitnumber.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2016-12-13 12:55:46 -0700
committerMike Buland <eichlan@xagasoft.com>2016-12-13 12:55:46 -0700
commit34ef08c297801761f5466da9d9047504f332fd87 (patch)
tree6d3b19e6a24e23d892e8c21e9df317087629c540 /src/unitnumber.cpp
parent7e0edb6c2db17c87415fbd041ef7add9dfb467e5 (diff)
downloadclic-34ef08c297801761f5466da9d9047504f332fd87.tar.gz
clic-34ef08c297801761f5466da9d9047504f332fd87.tar.bz2
clic-34ef08c297801761f5466da9d9047504f332fd87.tar.xz
clic-34ef08c297801761f5466da9d9047504f332fd87.zip
Fixed up some unit tests.
Added new ones for a recently discovered bug, brought back others for bugs that were already fixed.
Diffstat (limited to '')
-rw-r--r--src/unitnumber.cpp36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/unitnumber.cpp b/src/unitnumber.cpp
index c316d4b..4f80538 100644
--- a/src/unitnumber.cpp
+++ b/src/unitnumber.cpp
@@ -19,6 +19,8 @@ UnitNumber::UnitNumber()
19 "divide1", Bu::UnitSuite::expectPass ); 19 "divide1", Bu::UnitSuite::expectPass );
20 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::number1), 20 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::number1),
21 "number1", Bu::UnitSuite::expectPass ); 21 "number1", Bu::UnitSuite::expectPass );
22 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::number2),
23 "number2", Bu::UnitSuite::expectPass );
22 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::compare1), 24 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::compare1),
23 "compare1", Bu::UnitSuite::expectPass ); 25 "compare1", Bu::UnitSuite::expectPass );
24 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::radix1), 26 add( static_cast<Bu::UnitSuite::Test>(&UnitNumber::radix1),
@@ -144,38 +146,12 @@ void UnitNumber::number1()
144void UnitNumber::number2() 146void UnitNumber::number2()
145{ 147{
146 mathTest("55", +, "-100", 0, "-45"); 148 mathTest("55", +, "-100", 0, "-45");
147 mathTest("30.01", +, "-31.21", 2, "-1.20"); 149 mathTest("30.01", +, "-31.21", 2, "-1.2");
148 mathTest("55", -, "100", 0, "-45"); 150 mathTest("55", -, "100", 0, "-45");
149 mathTest("30.01", -, "31.21", 2, "-1.20"); 151 mathTest("30.01", -, "31.21", 2, "-1.2");
150// mathTest( "1", /, "17", 10, "0.0588235294" ); 152 mathTest( "1", /, "17", 10, "0.0588235294" );
151// mathTest( "1", /, "177", 10, "0.0056497175" ); 153 mathTest( "1", /, "177", 10, "0.0056497175" );
152} 154}
153
154
155/*
156// clic
157 1/17
1580.0588235294
1591/177
1600.0005649717
161
162
163// bc
1641/17
165.0588235294
1661/177
167.0056497175
168
169
1701/17
171bc: .0588235294
172clic: 0.0588235294
173
1741/177
175bc: .0056497175
176clic: 0.0005649717
177*/
178//}
179#undef mathTest 155#undef mathTest
180 156
181#define compcheck( anum, op, bnum ) \ 157#define compcheck( anum, op, bnum ) \