Bug #70579 [NEW]: Test ext/gmp/tests/gmp_random_seed.phpt broken
| From: | rainer dot jung at kippdata dot de | Date: | Fri, 25 Sep 2015 10:17:06 +0000 |
| Subject: | Bug #70579 [NEW]: Test ext/gmp/tests/gmp_random_seed.phpt broken | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-196232@lists.php.net to get a copy of this message | ||
From: rainer dot jung at kippdata dot de
Operating system:
PHP version: 7.0.0RC3
Package: GNU MP related
Bug Type: Bug
Bug description:Test ext/gmp/tests/gmp_random_seed.phpt broken
Description:
------------
The test ext/gmp/tests/gmp_random_seed.phpt assumes the same responses
on every platform. That is not true. The calls to gmp_random() in that
test will return different values depending on "number of bits per
limb". For a 64 Bit Linux system, the results will always be the same,
but e.g. for a 32 Bit Solaris Sparc the results are different (and must
be). Probably also for a 32 Bit Linux system (haven't checked that
part).
Possible solutions:
- Remove gmp_random() from the test
- Only check for numbers as return, or check for changes of the number
between different calls to gmp_random()
- Resolve https://bugs.php.net/bug.php?id=62375
and add different tests
for different limb sizes (I don't know how to do a platform specific
switch in the test framework)
- Try to detect limb size from the return value of gmp_random(1) and
correct arguments of other gmp_random() with a corresponding correction
factor. That will not work for gmp_random() without arguments, so drop
these calls.
- Use Regexp expectation values to allow all different possible values
(at least for limb size 32 and 64).
--
Edit bug report at https://bugs.php.net/bug.php?id=70579&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70579&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70579&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70579&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70579&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70579&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70579&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70579&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70579&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70579&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70579&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70579&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70579&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70579&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70579&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70579&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70579&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70579&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70579&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70579&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70579&r=mysqlcfg