From 3c8d03713512d33632a6bd794ba936dd8826877d Mon Sep 17 00:00:00 2001 From: cataphract Date: Wed, 21 Apr 2010 14:13:43 +0000 Subject: [PATCH] Added test for files when unpacked size bigger than 2 GiB (it will take 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 --- tests/012.phpt | 5 ++--- tests/040.phpt | 26 ++++++++++++++++++++++++++ tests/041.phpt | 26 ++++++++++++++++++++++++++ tests/sparsefiles_rar.rar | Bin 0 -> 5698 bytes 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 tests/040.phpt create mode 100644 tests/041.phpt create mode 100644 tests/sparsefiles_rar.rar diff --git a/tests/012.phpt b/tests/012.phpt index ae2326c..9afe48b 100644 --- a/tests/012.phpt +++ b/tests/012.phpt @@ -20,7 +20,7 @@ foreach ($entries as $e) { echo "Could not get stream.\n\n"; continue; } - while (!feof($stream)) { + while (!feof($stream) && $i != 2) { echo fread($stream, 8192); } fclose($stream); @@ -37,6 +37,5 @@ test%s: The great battle of Gunprex versus Optiter!!!!!1 Gunprex, Fire! So long, Optiter! -test%s: it,greIater! -%s +test%s: Done diff --git a/tests/040.phpt b/tests/040.phpt new file mode 100644 index 0000000..53b3844 --- /dev/null +++ b/tests/040.phpt @@ -0,0 +1,26 @@ +--TEST-- +RarEntry::getUnpackedSize() on platforms with 32-bit longs +--SKIPIF-- +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-- +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-- +c6=fr^x> zmXef{Axo6tT|u_CNJb~4&X~nHacvp1xSf=Q{w_09*r3Ye8|?n8^8Ec=T^{iT(ZaRs z@4V1?5r6GL;YN~_42>)-#c%l`6rfAPJSKYz=M9gBT`{mjFHy1eVw zJMVt2*|&b}@jIt#c(ji^udCkkH+SFvrN1){KS+#!yz*7vpI!F)%HMyQBz`bhckcfT zsTzr@x*E=(AJm^8m_MIslsOs>gEtW{r_aB3=i2Ref8)+Ai}<{9_cVEC`SsFs@7;Rv z{=@SpKh%RC_?>T@{rQ3a`9^y?mOnp)N13DHFkp#5{)6JfxOa8Jn;*=b&s0{!dGmvM z`hj7?EO+@KymSBT2Xha9hU3GV2Rg&Coi|_mtM-=deg7L@e?>>K8O*A$500L>aqIP` zPmiDOec&AK{rYLqj=KD@%-<>rN(AZF=B1U^5zFH z?narEg~RfLR`c0phfT5{Joz~I!Ce2QQgAB$Jeo?Wlv`JR@B<~-;a6PKJ>6dU0jljT z+OfQ<5nlNr@#gTV{pcQ?Sb`5!1F!txoBy+M^JpiIlpZYqpCvZh`^0)SfRiW@nZ4Zn zbB*whIyjan8|^2L_LFJYPv*J5c6pO5CJpq