diff options
author | tege <tege@gmplib.org> | 2002-04-14 03:29:09 +0200 |
---|---|---|
committer | tege <tege@gmplib.org> | 2002-04-14 03:29:09 +0200 |
commit | a72a5f7dd3b43c9781d2f88418131827e9808397 (patch) | |
tree | ee34cbad2dd572068c818f0b2e3db9132db53b56 /tests/mpz | |
parent | 488004d7ca3f1969e1d5351a56190c296607e1fc (diff) | |
download | gmp-a72a5f7dd3b43c9781d2f88418131827e9808397.tar.gz |
Actually test _ui routines. Add some more test values.
Diffstat (limited to 'tests/mpz')
-rw-r--r-- | tests/mpz/t-mul_i.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/tests/mpz/t-mul_i.c b/tests/mpz/t-mul_i.c index 0d8804349..75d53c136 100644 --- a/tests/mpz/t-mul_i.c +++ b/tests/mpz/t-mul_i.c @@ -1,6 +1,6 @@ /* Test mpz_mul_ui and mpz_mul_si. -Copyright 2001 Free Software Foundation, Inc. +Copyright 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -64,6 +64,24 @@ check_samples (void) long y; mpz_set_ui (x, 1L); + y = 0; + mpz_mul_si (got, x, y); + mpz_set_si (want, y); + compare_si (y); + + mpz_set_ui (x, 1L); + y = 1; + mpz_mul_si (got, x, y); + mpz_set_si (want, y); + compare_si (y); + + mpz_set_ui (x, 1L); + y = -1; + mpz_mul_si (got, x, y); + mpz_set_si (want, y); + compare_si (y); + + mpz_set_ui (x, 1L); y = LONG_MIN; mpz_mul_si (got, x, y); mpz_set_si (want, y); @@ -80,9 +98,21 @@ check_samples (void) unsigned long y; mpz_set_ui (x, 1L); + y = 0; + mpz_mul_ui (got, x, y); + mpz_set_ui (want, y); + compare_ui (y); + + mpz_set_ui (x, 1L); + y = 1; + mpz_mul_ui (got, x, y); + mpz_set_ui (want, y); + compare_ui (y); + + mpz_set_ui (x, 1L); y = ULONG_MAX; - mpz_mul_si (got, x, y); - mpz_set_si (want, y); + mpz_mul_ui (got, x, y); + mpz_set_ui (want, y); compare_ui (y); } } |