Bug #70579 [Opn->Csd]: Test ext/gmp/tests/gmp_random_seed.phpt broken

From: Date: Fri, 11 Dec 2015 19:52:05 +0000
Subject: Bug #70579 [Opn->Csd]: Test ext/gmp/tests/gmp_random_seed.phpt broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197811@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70579&edit=1 ID: 70579 Updated by: nikic@php.net Reported by: rainer dot jung at kippdata dot de Summary: Test ext/gmp/tests/gmp_random_seed.phpt broken -Status: Open +Status: Closed Type: Bug Package: GNU MP related PHP Version: 7.0.0RC3 -Assigned To: +Assigned To: nikic Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2015-12-11 19:50:12] rainer dot jung at kippdata dot de The test now passes (PHP 7.0.0). Thanks a bunch! I can close the issue if you like, but I guess you prefer doing it yourself. ------------------------------------------------------------------------ [2015-12-11 18:52:56] nikic@php.net Could you check if the test is still failing? Unless there is something Solaris specific about it, https://github.com/php/php-src/commit/424a26d5d436a36a91ceb8b67dccedaeee42753d should have fixed the issue. ------------------------------------------------------------------------ [2015-09-25 10:17:05] rainer dot jung at kippdata dot de 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 this bug report at https://bugs.php.net/bug.php?id=70579&edit=1

« previous php.bugs (#197811) next »