From 34ef08c297801761f5466da9d9047504f332fd87 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 13 Dec 2016 12:55:46 -0700 Subject: Fixed up some unit tests. Added new ones for a recently discovered bug, brought back others for bugs that were already fixed. --- src/unitnumber.cpp | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'src') 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() "divide1", Bu::UnitSuite::expectPass ); add( static_cast(&UnitNumber::number1), "number1", Bu::UnitSuite::expectPass ); + add( static_cast(&UnitNumber::number2), + "number2", Bu::UnitSuite::expectPass ); add( static_cast(&UnitNumber::compare1), "compare1", Bu::UnitSuite::expectPass ); add( static_cast(&UnitNumber::radix1), @@ -144,38 +146,12 @@ void UnitNumber::number1() void UnitNumber::number2() { mathTest("55", +, "-100", 0, "-45"); - mathTest("30.01", +, "-31.21", 2, "-1.20"); + mathTest("30.01", +, "-31.21", 2, "-1.2"); mathTest("55", -, "100", 0, "-45"); - mathTest("30.01", -, "31.21", 2, "-1.20"); -// mathTest( "1", /, "17", 10, "0.0588235294" ); -// mathTest( "1", /, "177", 10, "0.0056497175" ); + mathTest("30.01", -, "31.21", 2, "-1.2"); + mathTest( "1", /, "17", 10, "0.0588235294" ); + mathTest( "1", /, "177", 10, "0.0056497175" ); } - - -/* -// clic - 1/17 -0.0588235294 -1/177 -0.0005649717 - - -// bc -1/17 -.0588235294 -1/177 -.0056497175 - - -1/17 -bc: .0588235294 -clic: 0.0588235294 - -1/177 -bc: .0056497175 -clic: 0.0005649717 -*/ -//} #undef mathTest #define compcheck( anum, op, bnum ) \ -- cgit v1.2.3