summaryrefslogtreecommitdiff
path: root/test/unit/util/rational_white.h
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2010-05-25 21:45:18 +0000
committerTim King <taking@cs.nyu.edu>2010-05-25 21:45:18 +0000
commit2635899db4a7622a206e2ec562d01e3337a92199 (patch)
tree43222be9c81680f93120e8e82100b8d46b821f2a /test/unit/util/rational_white.h
parente87c14798b99ccb586751d291b0eeb3208265bd8 (diff)
Added Rational constructors that only take a numerator. The const char* Rational and Integer constructors are now explicit. This means that 'Integer = 3;' and so on are no longer permitted. This closes bug 121.
Diffstat (limited to 'test/unit/util/rational_white.h')
-rw-r--r--test/unit/util/rational_white.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/util/rational_white.h b/test/unit/util/rational_white.h
index 8a7f04fd3..45f1301f3 100644
--- a/test/unit/util/rational_white.h
+++ b/test/unit/util/rational_white.h
@@ -32,6 +32,12 @@ public:
TS_ASSERT_THROWS_NOTHING( delete q );
}
+ void testCompareAgainstZero(){
+ Rational q(0);
+ TS_ASSERT_THROWS_NOTHING(q == 0;);
+ TS_ASSERT_EQUALS(q,0);
+ }
+
void testConstructors(){
Rational zero; //Default constructor
TS_ASSERT_EQUALS(0L, zero.getNumerator().getLong());
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback