Annotation of embedaddon/php/ext/gmp/tests/020.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: gmp_prob_prime() basic tests
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: var_dump(gmp_prob_prime(10));
! 9: var_dump(gmp_prob_prime("7"));
! 10: var_dump(gmp_prob_prime(17));
! 11: var_dump(gmp_prob_prime(-31));
! 12: var_dump(gmp_prob_prime("172368715471481723"));
! 13:
! 14: var_dump(gmp_prob_prime(10));
! 15: var_dump(gmp_prob_prime("7"));
! 16: var_dump(gmp_prob_prime(17));
! 17: var_dump(gmp_prob_prime(-31));
! 18: var_dump(gmp_prob_prime("172368715471481723"));
! 19:
! 20: for ($i = -1; $i < 12; $i++) {
! 21: var_dump(gmp_prob_prime((773*$i)-($i*7)-1, $i));
! 22: $n = gmp_init("23476812735411");
! 23: var_dump(gmp_prob_prime(gmp_add($n, $i-1), $i));
! 24: }
! 25:
! 26: $n = gmp_init("19481923");
! 27: var_dump(gmp_prob_prime($n));
! 28: $n = gmp_init(0);
! 29: var_dump(gmp_prob_prime($n));
! 30:
! 31: var_dump(gmp_prob_prime());
! 32: var_dump(gmp_prob_prime(array()));
! 33:
! 34: echo "Done\n";
! 35: ?>
! 36: --EXPECTF--
! 37: int(0)
! 38: int(2)
! 39: int(2)
! 40: int(2)
! 41: int(0)
! 42: int(0)
! 43: int(2)
! 44: int(2)
! 45: int(2)
! 46: int(0)
! 47: int(0)
! 48: int(0)
! 49: int(0)
! 50: int(0)
! 51: int(0)
! 52: int(0)
! 53: int(2)
! 54: int(0)
! 55: int(2)
! 56: int(0)
! 57: int(0)
! 58: int(0)
! 59: int(0)
! 60: int(0)
! 61: int(0)
! 62: int(0)
! 63: int(0)
! 64: int(0)
! 65: int(0)
! 66: int(0)
! 67: int(0)
! 68: int(0)
! 69: int(0)
! 70: int(0)
! 71: int(0)
! 72: int(0)
! 73: int(0)
! 74: int(0)
! 75:
! 76: Warning: gmp_prob_prime() expects at least 1 parameter, 0 given in %s on line %d
! 77: NULL
! 78:
! 79: Warning: gmp_prob_prime(): Unable to convert variable to GMP - wrong type in %s on line %d
! 80: bool(false)
! 81: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>