Commit graph

8 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
f18b915b67 Fix the "x = a + b" allocation failure test. Since a and b were
equal, mpi_sub_abs() would return early and the test would never
exercise the mpi_grow() call which is intended to fail.
2014-12-30 16:46:44 +00:00
Dag-Erling Smørgrav
2027ce33e7 Add tests for the off-by-one bug we just fixed in mpi_cmp_abs(). 2014-12-30 16:38:47 +00:00
Dag-Erling Smørgrav
e21452d0c7 Add a few tests for subtraction. They're not particularly well thought
out, because currently subtraction does not work at all, but they work
well enough in the sense that they fail with the current implementation.
2014-12-30 11:19:02 +00:00
Dag-Erling Smørgrav
03867777c6 Add numerous tests, mostly for allocation failures and edge conditions.
Add a t_compare_mpi() predicate which checks that two MPIs have the same
value (but not necessarily the exact same representation).
Clean up and improve existing tests.
2014-12-29 23:54:02 +00:00
Dag-Erling Smørgrav
1fbf2cf156 It appears that gcc does not accept partial struct initialization. Add
a CRYB_MPI_ZERO macro that expands to an all-zeroes initializer.
2014-10-30 12:46:01 +00:00
Dag-Erling Smørgrav
3be915b8d7 Previous commit was incomplete. Add missing prototypes and a test case. 2014-08-14 18:42:52 +00:00
Dag-Erling Smørgrav
885c586ce9 Add a test function for comparison operators (but no test cases yet).
Consistently destroy MPIs after use.
2014-08-14 18:26:06 +00:00
Dag-Erling Smørgrav
be31515f5e Start of a multiple-precision integer arithmetic library. 2014-08-12 07:30:31 +00:00