diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2013-02-14 12:12:32 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2013-02-14 12:12:32 +0100 |
commit | 657a1cfe102e6b9b84f6637f943ef49c95fd22ee (patch) | |
tree | 2b9c79882119e766d091c51e72b9a1c89ed3e75e /tests/mpq | |
parent | c7cab1b4558e57cf734daeecf208718808c7537c (diff) | |
download | gmp-657a1cfe102e6b9b84f6637f943ef49c95fd22ee.tar.gz |
tests/mpq/t-cmp_ui.c: Test special comparisons: 0/1, 1/1.
Diffstat (limited to 'tests/mpq')
-rw-r--r-- | tests/mpq/t-cmp_ui.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/mpq/t-cmp_ui.c b/tests/mpq/t-cmp_ui.c index fec46c384..5b606f7bf 100644 --- a/tests/mpq/t-cmp_ui.c +++ b/tests/mpq/t-cmp_ui.c @@ -87,6 +87,18 @@ main (int argc, char **argv) mpq_canonicalize (a); mpq_canonicalize (b); + ccref = ref_mpq_cmp_ui (a, 1, 1); + cc = mpq_cmp_ui (a, 1, 1); + + if (SGN (ccref) != SGN (cc)) + abort (); + + ccref = ref_mpq_cmp_ui (a, 0, 1); + cc = mpq_cmp_ui (a, 0, 1); + + if (SGN (ccref) != SGN (cc)) + abort (); + bn = mpz_get_ui (NUM (b)); bd = mpz_get_ui (DEN (b)); |