Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for files when unpacked size bigger than 2 GiB (it will ta…
…ke some effort to do the same for packed size > 2 GiB). Relaxed test #12 (changes to the unpacking algorithm in unrar 3.9.10 have apparently changed the output stream for corrupted entries). git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298254 c90b9560-bf6c-de11-be94-00142212c4b1
- Loading branch information
cataphract
committed
Apr 21, 2010
1 parent
2fb18b2
commit 3c8d037
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
RarEntry::getUnpackedSize() on platforms with 32-bit longs | ||
--SKIPIF-- | ||
<?php | ||
if(!extension_loaded("rar")) die("skip"); | ||
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); | ||
--FILE-- | ||
<?php | ||
$fn1 = dirname(__FILE__) . '/sparsefiles_rar.rar'; | ||
$fn2 = dirname(__FILE__) . '/sparsefiles.tmp.rar'; | ||
$rarF = RarArchive::open($fn1); | ||
$t = $rarF->getEntries(); | ||
reset($t)->extract(false, $fn2); | ||
$rarF2 = RarArchive::open($fn2); | ||
$t = $rarF2->getEntries(); | ||
var_dump($t[0]->getUnpackedSize()); | ||
var_dump($t[1]->getUnpackedSize()); | ||
echo "Done.\n"; | ||
--CLEAN-- | ||
<?php | ||
$fn2 = dirname(__FILE__) . '/sparsefiles.tmp.rar'; | ||
@unlink($fn2); | ||
--EXPECTF-- | ||
int(2147483647) | ||
int(2147483647) | ||
Done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
RarEntry::getUnpackedSize() on platforms with 64-bit longs | ||
--SKIPIF-- | ||
<?php | ||
if(!extension_loaded("rar")) die("skip"); | ||
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); | ||
--FILE-- | ||
<?php | ||
$fn1 = dirname(__FILE__) . '/sparsefiles_rar.rar'; | ||
$fn2 = dirname(__FILE__) . '/sparsefiles.tmp.rar'; | ||
$rarF = RarArchive::open($fn1); | ||
$t = $rarF->getEntries(); | ||
reset($t)->extract(false, $fn2); | ||
$rarF2 = RarArchive::open($fn2); | ||
$t = $rarF2->getEntries(); | ||
var_dump($t[0]->getUnpackedSize()); | ||
var_dump($t[1]->getUnpackedSize()); | ||
echo "Done.\n"; | ||
--CLEAN-- | ||
<?php | ||
$fn2 = dirname(__FILE__) . '/sparsefiles.tmp.rar'; | ||
@unlink($fn2); | ||
--EXPECTF-- | ||
int(2621440000) | ||
int(5368709120) | ||
Done. |
Binary file not shown.