Skip to content

Commit a8d1955

Browse files
orlitzkypetk
authored andcommitted
ext/standard/tests: use %d instead of bytes in an overflow message
In strings/chunk_split_variation1_32bit.phpt, we have a test that is expected to fail on x32 with a possible integer overflow error. The message reports the exact number of bytes -- a number big enough to overflow an int on x32 -- stemming from a memory allocation in chunk_split(). This number appears unpredictable, and is not the point of the test. We replace it with %d to make the test independent of the allocation details.
1 parent 070779c commit a8d1955

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/tests/strings/chunk_split_variation1_32bit.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ var_dump(chunk_split($a,$b,$c));
1717
--EXPECTF--
1818
*** Testing chunk_split() : unexpected large 'end' string argument variation 1 ***
1919

20-
Fatal error: %rAllowed memory size of %d bytes exhausted%s\(tried to allocate %d bytes\)|Possible integer overflow in memory allocation \(4294901777 \+ 2097152\)%r in %s on line %d
20+
Fatal error: %rAllowed memory size of %d bytes exhausted%s\(tried to allocate %d bytes\)|Possible integer overflow in memory allocation \(4294901777 \+ %d\)%r in %s on line %d

0 commit comments

Comments
 (0)