Fix GMP tests/crashes
commit948ba6498f6afd8d981e8cbd9a30610e80ed0e0a
authormaide <ian@maide.ca>
Sun, 7 Sep 2014 22:35:37 +0000 (7 15:35 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Sun, 7 Sep 2014 23:00:18 +0000 (7 16:00 -0700)
tree3ebd7a782d50078938418487a3d526466dd651a3
parent6c1a4661b5b5c37a7c78a8af99ee7ba8a4fa917d
Fix GMP tests/crashes

Summary: This should fix some crashes and all bad tests other than 014, and 028.

I marked test 014 as flakey, as it is checking for wrong return values due to a bug in PHP.  It appears as though PHP is using the resource number as the factorial rather than the resource's value, giving unpridictable results (depends on how many resources have been used thus far)

Test 028 still fails as gmp_random is not implemented.
Closes https://github.com/facebook/hhvm/pull/3639

Reviewed By: @sgolemon

Differential Revision: D1530781
95 files changed:
hphp/runtime/ext/gmp/ext_gmp.cpp
hphp/runtime/ext/gmp/ext_gmp.h [new file with mode: 0644]
hphp/runtime/ext/gmp/ext_gmp.php
hphp/test/slow/ext_gmp/003.php [deleted file]
hphp/test/slow/ext_gmp/003.php.expectf [deleted file]
hphp/test/slow/ext_gmp/004.php [deleted file]
hphp/test/slow/ext_gmp/004.php.expectf [deleted file]
hphp/test/slow/ext_gmp/005.php [deleted file]
hphp/test/slow/ext_gmp/005.php.expectf [deleted file]
hphp/test/slow/ext_gmp/007.php [deleted file]
hphp/test/slow/ext_gmp/007.php.expectf [deleted file]
hphp/test/slow/ext_gmp/implicit_hex_conversion.php [deleted file]
hphp/test/slow/ext_gmp/implicit_hex_conversion.php.expectf [deleted file]
hphp/test/slow/ext_gmp/mostInOne.php.expectf
hphp/test/zend/flaky/ext/gmp/tests/014.php [moved from hphp/test/zend/bad/ext/gmp/tests/014.php with 100% similarity]
hphp/test/zend/flaky/ext/gmp/tests/014.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/014.php.expectf with 100% similarity]
hphp/test/zend/flaky/ext/gmp/tests/014.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/014.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/003.php [moved from hphp/test/zend/bad/ext/gmp/tests/003.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/003.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/003.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/003.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/003.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/004.php [moved from hphp/test/zend/bad/ext/gmp/tests/004.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/004.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/004.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/004.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/004.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/005.php [moved from hphp/test/zend/bad/ext/gmp/tests/005.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/005.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/005.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/005.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/005.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/006.php [moved from hphp/test/zend/bad/ext/gmp/tests/006.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/006.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/006.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/006.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/006.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/007.php [moved from hphp/test/zend/bad/ext/gmp/tests/007.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/007.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/007.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/007.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/007.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/008.php [moved from hphp/test/zend/bad/ext/gmp/tests/008.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/008.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/008.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/008.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/008.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/009.php [moved from hphp/test/zend/bad/ext/gmp/tests/009.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/009.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/009.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/009.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/009.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/010.php [moved from hphp/test/zend/bad/ext/gmp/tests/010.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/010.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/010.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/010.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/010.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/011.php [moved from hphp/test/zend/bad/ext/gmp/tests/011.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/011.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/011.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/011.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/011.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/013.php [moved from hphp/test/zend/bad/ext/gmp/tests/013.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/013.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/013.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/013.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/013.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/017.php [moved from hphp/test/zend/bad/ext/gmp/tests/017.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/017.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/017.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/017.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/017.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/018.php [moved from hphp/test/zend/bad/ext/gmp/tests/018.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/018.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/018.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/018.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/018.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/027.php [moved from hphp/test/zend/bad/ext/gmp/tests/027.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/027.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/027.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/027.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/027.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/029.php [moved from hphp/test/zend/bad/ext/gmp/tests/029.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/029.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/029.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/029.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/029.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/030.php [moved from hphp/test/zend/bad/ext/gmp/tests/030.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/030.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/030.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/030.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/030.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/031.php [moved from hphp/test/zend/bad/ext/gmp/tests/031.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/031.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/031.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/031.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/031.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/032.php [moved from hphp/test/zend/bad/ext/gmp/tests/032.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/032.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/032.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/032.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/032.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/033.php [moved from hphp/test/zend/bad/ext/gmp/tests/033.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/033.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/033.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/033.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/033.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/034.php [moved from hphp/test/zend/bad/ext/gmp/tests/034.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/034.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/034.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/034.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/034.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/036.php [moved from hphp/test/zend/bad/ext/gmp/tests/036.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/036.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/036.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/036.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/036.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/037.php [moved from hphp/test/zend/bad/ext/gmp/tests/037.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/037.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/037.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/037.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/037.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/038.php [moved from hphp/test/zend/bad/ext/gmp/tests/038.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/038.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/038.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/038.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/038.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/040.php [moved from hphp/test/zend/bad/ext/gmp/tests/040.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/040.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/040.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/040.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/040.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/bug50175.php [new file with mode: 0644]
hphp/test/zend/good/ext/gmp/tests/bug50175.php.expect [new file with mode: 0644]
hphp/test/zend/good/ext/gmp/tests/bug50175.php.skipif [copied from hphp/test/zend/bad/ext/gmp/tests/bug50283.php.skipif with 94% similarity]
hphp/test/zend/good/ext/gmp/tests/bug50283.php [moved from hphp/test/zend/bad/ext/gmp/tests/bug50283.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/bug50283.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/bug50283.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/bug50283.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/bug50283.php.skipif with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/gmp_nextprime.php [moved from hphp/test/zend/bad/ext/gmp/tests/gmp_nextprime.php with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/gmp_nextprime.php.expectf [moved from hphp/test/zend/bad/ext/gmp/tests/gmp_nextprime.php.expectf with 100% similarity]
hphp/test/zend/good/ext/gmp/tests/gmp_nextprime.php.skipif [moved from hphp/test/zend/bad/ext/gmp/tests/gmp_nextprime.php.skipif with 100% similarity]