Bacon / BaconQrCode

QR Code Generator for PHP
BSD 2-Clause "Simplified" License
1.83k stars 208 forks source link

32-bit architecture test suite failure and hang #31

Closed remicollet closed 6 years ago

remicollet commented 7 years ago

All tests but testFindMsbSet

# phpunit   --filter '(::test(?!FindMsbSet))'
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.

.....E..F.E..E.............EEEEEEE.............................  63 / 164 ( 38%)
............................................................... 126 / 164 ( 76%)
......................................                          164 / 164 (100%)

Time: 98 ms, Memory: 4.00MB

There were 10 errors:

1) BaconQrCode\Common\BitArrayTest::testGetNextSet5
mt_srand() expects parameter 1 to be integer, float given

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/BitArrayTest.php:98

2) BaconQrCode\Common\BitMatrixTest::testGetSet
ArithmeticError: Bit shift by negative number

/builddir/build/BUILDROOT/php-bacon-qr-code-1.0.1-2.fc26.remi.i386/usr/share/php/BaconQrCode/Common/BitUtils.php:35
/builddir/build/BUILDROOT/php-bacon-qr-code-1.0.1-2.fc26.remi.i386/usr/share/php/BaconQrCode/Common/BitMatrix.php:84
/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/BitMatrixTest.php:31

3) BaconQrCode\Common\BitMatrixTest::testRectangularSetRegion
ArithmeticError: Bit shift by negative number

/builddir/build/BUILDROOT/php-bacon-qr-code-1.0.1-2.fc26.remi.i386/usr/share/php/BaconQrCode/Common/BitUtils.php:35
/builddir/build/BUILDROOT/php-bacon-qr-code-1.0.1-2.fc26.remi.i386/usr/share/php/BaconQrCode/Common/BitMatrix.php:84
/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/BitMatrixTest.php:85

4) BaconQrCode\Common\ReedSolomonTest::testCodec with data set #0 (2, 7, 1, 1, 1)
mt_srand() expects parameter 1 to be integer, float given

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/ReedSolomonCodecTest.php:42

5) BaconQrCode\Common\ReedSolomonTest::testCodec with data set #1 (3, 11, 1, 1, 2)
mt_srand() expects parameter 1 to be integer, float given

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/ReedSolomonCodecTest.php:42

6) BaconQrCode\Common\ReedSolomonTest::testCodec with data set #2 (4, 19, 1, 1, 4)
mt_srand() expects parameter 1 to be integer, float given

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/ReedSolomonCodecTest.php:42

7) BaconQrCode\Common\ReedSolomonTest::testCodec with data set #3 (5, 37, 1, 1, 6)
mt_srand() expects parameter 1 to be integer, float given

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/ReedSolomonCodecTest.php:42

8) BaconQrCode\Common\ReedSolomonTest::testCodec with data set #4 (6, 67, 1, 1, 8)
mt_srand() expects parameter 1 to be integer, float given

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/ReedSolomonCodecTest.php:42

9) BaconQrCode\Common\ReedSolomonTest::testCodec with data set #5 (7, 137, 1, 1, 10)
mt_srand() expects parameter 1 to be integer, float given

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/ReedSolomonCodecTest.php:42

10) BaconQrCode\Common\ReedSolomonTest::testCodec with data set #6 (8, 285, 1, 1, 32)
mt_srand() expects parameter 1 to be integer, float given

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/ReedSolomonCodecTest.php:42

--

There was 1 failure:

1) BaconQrCode\Common\BitArrayTest::testGetArray
Failed asserting that -2147483648 matches expected 2147483648.0.

/builddir/build/BUILD/BaconQrCode-031a2ce68c5794064b49d11775b2daf45c96e21c/tests/BaconQrCode/Common/BitArrayTest.php:170

ERRORS!
Tests: 164, Assertions: 8559, Errors: 10, Failures: 1.

Only testFindMsbSet

# phpunit   --filter '(::testFindMsbSet)' --debug
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.

Starting test 'BaconQrCode\Encoder\MatrixUtilTest::testFindMsbSet'.

Process hangs forever

DASPRiD commented 7 years ago

Wow, I didn't expect that anyone would still be on a 32-bit architecture. Do you happen to have a solution for that problem?

remicollet commented 7 years ago

I didn't expect that anyone would still be on a 32-bit architecture.

At least, arm computer are quite common. An also people who keep using i386 on very small cloud image.

DASPRiD commented 7 years ago

That's true. I wonder if we can supply some fallback (which doesn't impact 64 bit architecture). Theoretically most stuff could be implemented via bcmath().

DASPRiD commented 6 years ago

Closing, as no further communication has happened.

remicollet commented 6 years ago

Please don't close this bug, the library have issue. No solution doesn't mean that issue is solved.