mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix 32-bit failure of ext-zip oo_setcompression.phpt (GH-20511)
This commit is contained in:
@@ -34,24 +34,12 @@ try {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
try {
|
||||
$zip->setCompressionName('entry5.txt', PHP_INT_MAX);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
try {
|
||||
$zip->setCompressionIndex(4, PHP_INT_MIN);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
try {
|
||||
$zip->setCompressionIndex(4, PHP_INT_MAX);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
var_dump($zip->setCompressionIndex(4, ZipArchive::CM_STORE));
|
||||
var_dump($zip->setCompressionIndex(5, ZipArchive::CM_DEFLATE));
|
||||
var_dump($zip->setCompressionIndex(6, ZipArchive::CM_DEFAULT));
|
||||
@@ -82,8 +70,6 @@ bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d
|
||||
ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d
|
||||
ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d
|
||||
ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
29
ext/zip/tests/oo_setcompression_64bit.phpt
Normal file
29
ext/zip/tests/oo_setcompression_64bit.phpt
Normal file
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
setCompressionName and setCompressionIndex methods
|
||||
--EXTENSIONS--
|
||||
zip
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$zip = new ZipArchive;
|
||||
|
||||
try {
|
||||
$zip->setCompressionName('entry5.txt', PHP_INT_MAX);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
try {
|
||||
$zip->setCompressionIndex(4, PHP_INT_MAX);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d
|
||||
ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d
|
||||
Reference in New Issue
Block a user