Skip to content

Commit 6b8ce18

Browse files
committed
Fix tests
1 parent 4e326d2 commit 6b8ce18

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

Zend/tests/zend_ini_parse_quantity_overflow.phpt

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ function decrement(string $s): string {
2828
$tests = [
2929
'No overflow 001' => '0',
3030
'No overflow 002' => '1',
31-
'No overflow 002' => '100',
32-
'No overflow 003' => strval(PHP_INT_MAX),
33-
'No overflow 004' => strval(PHP_INT_MIN),
34-
'No overflow 005' => '2K',
35-
'No overflow 006' => '-2K',
31+
'No overflow 003' => '100',
32+
'No overflow 004' => strval(PHP_INT_MAX),
33+
'No overflow 005' => strval(PHP_INT_MIN),
34+
'No overflow 006' => '2K',
35+
'No overflow 007' => '-2K',
3636
'Subject overflow 001' => increment(strval(PHP_INT_MAX)),
3737
'Subject overflow 002' => decrement(strval(PHP_INT_MIN)),
3838
'Multiplier overflow 001' => strval(PHP_INT_MAX).'K',
@@ -41,45 +41,48 @@ $tests = [
4141

4242
foreach ($tests as $name => $value) {
4343
printf("# %s: \"%s\"\n", $name, $value);
44-
printf("%u\n", zend_test_zend_ini_parse_quantity($value));
44+
printf("%d\n", zend_test_zend_ini_parse_quantity($value));
4545
print "\n";
4646
}
4747

4848
--EXPECTF--
4949
# No overflow 001: "0"
5050
0
5151

52-
# No overflow 002: "100"
52+
# No overflow 002: "1"
53+
1
54+
55+
# No overflow 003: "100"
5356
100
5457

55-
# No overflow 003: "%d"
58+
# No overflow 004: "%d"
5659
%d
5760

58-
# No overflow 004: "-%d"
59-
%d
61+
# No overflow 005: "-%d"
62+
-%d
6063

61-
# No overflow 005: "2K"
64+
# No overflow 006: "2K"
6265
2048
6366

64-
# No overflow 006: "-2K"
65-
%d
67+
# No overflow 007: "-2K"
68+
-2048
6669

6770
# Subject overflow 001: "%d"
6871

6972
Warning: Invalid quantity "%d": value is out of range, using overflow result for backwards compatibility in %s on line %d
70-
%d
73+
%s
7174

7275
# Subject overflow 002: "-%d"
7376

7477
Warning: Invalid quantity "-%d": value is out of range, using overflow result for backwards compatibility in %s on line %d
75-
%d
78+
%s
7679

7780
# Multiplier overflow 001: "%dK"
7881

7982
Warning: Invalid quantity "%dK": value is out of range, using overflow result for backwards compatibility in %s on line %d
80-
%d
83+
%s
8184

8285
# Multiplier overflow 002: "-%dK"
8386

8487
Warning: Invalid quantity "-%dK": value is out of range, using overflow result for backwards compatibility in %s on line %d
85-
0
88+
%s

ext/opcache/tests/bug71843.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bug #71843 (null ptr deref ZEND_RETURN_SPEC_CONST_HANDLER (zend_vm_execute.h:347
33
--INI--
44
opcache.enable=1
55
opcache.enable_cli=1
6-
opcache.optimization_level=0xFFFFBFFF
6+
opcache.optimization_level=0x7FFFBFFF
77
--EXTENSIONS--
88
opcache
99
--FILE--

ext/opcache/tests/bug74431.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bug #74431 - foreach infinite loop
33
--INI--
44
opcache.enable=1
55
opcache.enable_cli=1
6-
opcache.optimization_level=0xffffffff
6+
opcache.optimization_level=0x7fffffff
77
--EXTENSIONS--
88
opcache
99
--FILE--

0 commit comments

Comments
 (0)