summaryrefslogtreecommitdiff
path: root/test/unit/util
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2012-11-30 22:28:46 +0000
committerTim King <taking@cs.nyu.edu>2012-11-30 22:28:46 +0000
commit3a49733d841b7f2a1c13c430b83a4c5d5d3a7a53 (patch)
treeca9dd6b3019c9d6e9fb9dec77329617deb0c76d6 /test/unit/util
parent94484dda2d3fa6595ea3f82583f33f9106403e3e (diff)
Committing tests to potentially discover an obscure CLN library issue on 32 bit platforms. The issue is discussed here: http://www.ginac.de/CLN/cln_3.html#SEC15.
Diffstat (limited to 'test/unit/util')
-rw-r--r--test/unit/util/integer_white.h12
-rw-r--r--test/unit/util/rational_white.h11
2 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/util/integer_white.h b/test/unit/util/integer_white.h
index 5a6e43782..19281d745 100644
--- a/test/unit/util/integer_white.h
+++ b/test/unit/util/integer_white.h
@@ -24,6 +24,7 @@ using namespace std;
const char* largeVal = "4547897890548754897897897897890789078907890";
+
class IntegerWhite : public CxxTest::TestSuite {
public:
@@ -39,4 +40,15 @@ public:
TS_ASSERT_THROWS_NOTHING(fits_in_16_bytes.hash());
TS_ASSERT_THROWS_NOTHING(large.hash());
}
+
+ //Make sure we can properly handle:
+ //http://www.ginac.de/CLN/cln_3.html#SEC15
+ const int i_above2tothe29 = (1 << 29) + 1;
+ const unsigned int u_above2tothe29 = (1 << 29) + 1;
+ void testConstruction(){
+ TS_ASSERT_EQUALS(Integer(i_above2tothe29), Integer((long)i_above2tothe29));
+ TS_ASSERT_EQUALS(Integer(u_above2tothe29),
+ Integer((unsigned long)u_above2tothe29));
+
+ }
};
diff --git a/test/unit/util/rational_white.h b/test/unit/util/rational_white.h
index bcd3d56e4..63b4e1843 100644
--- a/test/unit/util/rational_white.h
+++ b/test/unit/util/rational_white.h
@@ -430,4 +430,15 @@ public:
// TS_ASSERT_EQUALS(large.hash(),
// (large.getNumerator().hash()) xor (large.getDenominator().hash()));
// }
+
+ //Make sure we can properly handle:
+ //http://www.ginac.de/CLN/cln_3.html#SEC15
+ const int i_above2tothe29 = (1 << 29) + 1;
+ const unsigned int u_above2tothe29 = (1 << 29) + 1;
+ void testConstruction(){
+ TS_ASSERT_EQUALS(Rational(i_above2tothe29), Rational((long)i_above2tothe29));
+ TS_ASSERT_EQUALS(Rational(u_above2tothe29),
+ Rational((unsigned long)u_above2tothe29));
+
+ }
};
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback