[PHP-CVS] cvs: php-src /ext/xml/tests bug32001.phpt bug32001b.phpt
helly Fri Dec 23 20:03:31 2005 EDT Added files: /php-src/ext/xml/tests bug32001b.phpt Modified files: /php-src/ext/xml/tests bug32001.phpt Log: - Fix test by splitting it http://cvs.php.net/viewcvs.cgi/php-src/ext/xml/tests/bug32001.phpt?r1=1.9r2=1.10diff_format=u Index: php-src/ext/xml/tests/bug32001.phpt diff -u php-src/ext/xml/tests/bug32001.phpt:1.9 php-src/ext/xml/tests/bug32001.phpt:1.10 --- php-src/ext/xml/tests/bug32001.phpt:1.9 Wed Dec 21 10:50:10 2005 +++ php-src/ext/xml/tests/bug32001.phpt Fri Dec 23 20:03:31 2005 @@ -1,11 +1,9 @@ --TEST-- -Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect) +Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using UTF-* --SKIPIF-- ?php require_once(skipif.inc); - if (!extension_loaded('iconv')) { - die (skip iconv extension not available\n); - } +if (!extension_loaded('iconv')) die (skip iconv extension not available); ? --FILE-- ?php @@ -150,12 +148,6 @@ new testcase(UTF-16LE, 1, 0, 0), new testcase(UTF-16LE, 1, 1, 0), new testcase(UTF-16LE, 1, 1, 1), - new testcase(EUC-JP , 0), - new testcase(EUC-JP , 1), - new testcase(Shift_JIS, 0), - new testcase(Shift_JIS, 1), - new testcase(GB2312,0), - new testcase(GB2312,1), ); if (XML_SAX_IMPL == 'libxml') { @@ -414,75 +406,3 @@ [2]= string(42) e38386e382b9e383883ae38386e382b9e3838833: } -Encoding: EUC-JP -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]= - string(128) e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388 - [1]= - string(60) e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388 - [2]= - string(42) e38386e382b9e383883ae38386e382b9e3838833: -} -Encoding: EUC-JP -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]= - string(128) e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388 - [1]= - string(60) e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388 - [2]= - string(42) e38386e382b9e383883ae38386e382b9e3838833: -} -Encoding: Shift_JIS -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]= - string(128) e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388 - [1]= - string(60) e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388 - [2]= - string(42) e38386e382b9e383883ae38386e382b9e3838833: -} -Encoding: Shift_JIS -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]= - string(128) e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388 - [1]= - string(60) e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388 - [2]= - string(42) e38386e382b9e383883ae38386e382b9e3838833: -} -Encoding: GB2312 -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]= - string(128) e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388 - [1]= - string(60) e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388 - [2]= - string(42) e38386e382b9e383883ae38386e382b9e3838833: -} -Encoding: GB2312 -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]= - string(128) e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388 - [1]= - string(60) e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388 - [2]= - string(42) e38386e382b9e383883ae38386e382b9e3838833: -} http://cvs.php.net/viewcvs.cgi/php-src/ext/xml/tests/bug32001b.phpt?view=markuprev=1.1 Index: php-src/ext/xml/tests/bug32001b.phpt +++ php-src/ext/xml/tests/bug32001b.phpt --TEST-- Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using EUC-JP, Shift_JIS, GB2312 --SKIPIF-- ?php require_once(skipif.inc); if (!extension_loaded('iconv')) die (skip iconv extension not available); foreach(array('EUC-JP', 'Shift_JISP', 'GB2312') as $encoding) { if (@xml_parser_create($encoding) === false) die(skip libxml2 does not support $encoding encoding); } ? --FILE-- ?php class testcase { private $encoding; private $bom; private $prologue; private $tags; private $chunk_size; function testcase($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) { $this-encoding = $enc; $this-chunk_size = $chunk_size; $this-bom = $bom; $this-prologue = !$omit_prologue;
[PHP-CVS] cvs: php-src /ext/xml/tests bug32001.phpt
tony2001Wed Jun 29 07:52:19 2005 EDT Modified files: /php-src/ext/xml/tests bug32001.phpt Log: fix test http://cvs.php.net/diff.php/php-src/ext/xml/tests/bug32001.phpt?r1=1.5r2=1.6ty=u Index: php-src/ext/xml/tests/bug32001.phpt diff -u php-src/ext/xml/tests/bug32001.phpt:1.5 php-src/ext/xml/tests/bug32001.phpt:1.6 --- php-src/ext/xml/tests/bug32001.phpt:1.5 Fri Jun 3 19:13:23 2005 +++ php-src/ext/xml/tests/bug32001.phpt Wed Jun 29 07:52:18 2005 @@ -156,7 +156,8 @@ ); if (XML_SAX_IMPL == 'libxml') { - preg_match(/^libxml2 Version.*\$/im, `$_ENV[TEST_PHP_EXECUTABLE] -i`, $match); + $php = getenv('TEST_PHP_EXECUTABLE'); + preg_match(/^libxml2 Version.*\$/im, `$php -i`, $match); echo $match[0], \n; } else { echo libxml2 Version = NONE\n; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xml/tests bug32001.phpt
magnus Fri Jun 3 18:51:11 2005 EDT Modified files: /php-src/ext/xml/tests bug32001.phpt Log: Add skipif, test requires iconv. http://cvs.php.net/diff.php/php-src/ext/xml/tests/bug32001.phpt?r1=1.3r2=1.4ty=u Index: php-src/ext/xml/tests/bug32001.phpt diff -u php-src/ext/xml/tests/bug32001.phpt:1.3 php-src/ext/xml/tests/bug32001.phpt:1.4 --- php-src/ext/xml/tests/bug32001.phpt:1.3 Sat Apr 2 19:12:26 2005 +++ php-src/ext/xml/tests/bug32001.phpt Fri Jun 3 18:51:10 2005 @@ -1,5 +1,8 @@ --TEST-- Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect) +--SKIPIF-- +?php # vim:ft=php +if (!extension_loaded(iconv)) print skip; --FILE-- ?php class testcase { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xml/tests bug32001.phpt
sniper Fri Jun 3 19:13:23 2005 EDT Modified files: /php-src/ext/xml/tests bug32001.phpt Log: nuke crap, end scripts always with ? http://cvs.php.net/diff.php/php-src/ext/xml/tests/bug32001.phpt?r1=1.4r2=1.5ty=u Index: php-src/ext/xml/tests/bug32001.phpt diff -u php-src/ext/xml/tests/bug32001.phpt:1.4 php-src/ext/xml/tests/bug32001.phpt:1.5 --- php-src/ext/xml/tests/bug32001.phpt:1.4 Fri Jun 3 18:51:10 2005 +++ php-src/ext/xml/tests/bug32001.phpt Fri Jun 3 19:13:23 2005 @@ -1,8 +1,9 @@ --TEST-- Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect) --SKIPIF-- -?php # vim:ft=php -if (!extension_loaded(iconv)) print skip; +?php + if (!extension_loaded('iconv')) print 'skip'; +? --FILE-- ?php class testcase { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xml/tests bug32001.phpt
sniper Sat Apr 2 19:12:30 2005 EDT Modified files: /php-src/ext/xml/tests bug32001.phpt Log: Partial fix test: It is still possible to use expat libs with ext/xml.. http://cvs.php.net/diff.php/php-src/ext/xml/tests/bug32001.phpt?r1=1.2r2=1.3ty=u Index: php-src/ext/xml/tests/bug32001.phpt diff -u php-src/ext/xml/tests/bug32001.phpt:1.2 php-src/ext/xml/tests/bug32001.phpt:1.3 --- php-src/ext/xml/tests/bug32001.phpt:1.2 Sun Mar 13 20:11:54 2005 +++ php-src/ext/xml/tests/bug32001.phpt Sat Apr 2 19:12:26 2005 @@ -151,10 +151,12 @@ new testcase(GB2312,1), ); -preg_match(/^libxml2 Version.*\$/im, `$_ENV[TEST_PHP_EXECUTABLE] -i`, $match); - -echo $match[0], \n; - +if (XML_SAX_IMPL == 'libxml') { + preg_match(/^libxml2 Version.*\$/im, `$_ENV[TEST_PHP_EXECUTABLE] -i`, $match); + echo $match[0], \n; +} else { + echo libxml2 Version = NONE\n; +} foreach ($suite as $testcase) { $testcase-run(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xml/tests bug32001.phpt
moriyoshi Sun Mar 13 20:11:54 2005 EDT Modified files: /php-src/ext/xml/tests bug32001.phpt Log: - Turn off incorrect case folding to let test over. http://cvs.php.net/diff.php/php-src/ext/xml/tests/bug32001.phpt?r1=1.1r2=1.2ty=u Index: php-src/ext/xml/tests/bug32001.phpt diff -u php-src/ext/xml/tests/bug32001.phpt:1.1 php-src/ext/xml/tests/bug32001.phpt:1.2 --- php-src/ext/xml/tests/bug32001.phpt:1.1 Wed Mar 2 14:27:37 2005 +++ php-src/ext/xml/tests/bug32001.phpt Sun Mar 13 20:11:54 2005 @@ -91,6 +91,7 @@ } $parser = xml_parser_create(NULL); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_set_element_handler($parser, start_element, end_element); xml_set_object($parser, $this); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xml/tests bug32001.phpt
moriyoshi Wed Mar 2 14:27:38 2005 EDT Added files: /php-src/ext/xml/tests bug32001.phpt Log: - Add testcases for bug #32001 http://cvs.php.net/co.php/php-src/ext/xml/tests/bug32001.phpt?r=1.1p=1 Index: php-src/ext/xml/tests/bug32001.phpt +++ php-src/ext/xml/tests/bug32001.phpt --TEST-- Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect) --FILE-- ?php class testcase { private $encoding; private $bom; private $prologue; private $tags; private $chunk_size; function testcase($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) { $this-encoding = $enc; $this-chunk_size = $chunk_size; $this-bom = $bom; $this-prologue = !$omit_prologue; $this-tags = array(); } function start_element($parser, $name, $attrs) { $attrs = array_map('bin2hex', $attrs); $this-tags[] = bin2hex($name).: .implode(', ', $attrs); } function end_element($parser, $name) { } function run() { $data = ''; if ($this-prologue) { $canonical_name = preg_replace('/BE|LE/i', '', $this-encoding); $data .= ?xml version=\1.0\ encoding=\$canonical_name\ ?\n; } $data .= HERE テスト:テスト1 xmlns:テスト=http://www.example.com/テスト/; テスト=テスト テスト:テスト2 テスト=テスト テスト:テスト3 test! /テスト:テスト3 /テスト:テスト2 /テスト:テスト1 HERE; $data = iconv(UTF-8, $this-encoding, $data); if ($this-bom) { switch (strtoupper($this-encoding)) { case 'UTF-8': case 'UTF8': $data = \xef\xbb\xbf.$data; break; case 'UTF-16': case 'UTF16': case 'UTF-16BE': case 'UTF16BE': case 'UCS-2': case 'UCS2': case 'UCS-2BE': case 'UCS2BE': $data = \xfe\xff.$data; break; case 'UTF-16LE': case 'UTF16LE': case 'UCS-2LE': case 'UCS2LE': $data = \xff\xfe.$data; break; case 'UTF-32': case 'UTF32': case 'UTF-32BE': case 'UTF32BE': case 'UCS-4': case 'UCS4': case 'UCS-4BE': case 'UCS4BE': $data = \x00\x00\xfe\xff.$data; break; case 'UTF-32LE': case 'UTF32LE': case 'UCS-4LE': case 'UCS4LE': $data = \xff\xfe\x00\x00.$data; break; } } $parser = xml_parser_create(NULL); xml_set_element_handler($parser, start_element, end_element); xml_set_object($parser, $this); if ($this-chunk_size == 0) { $success = @xml_parse($parser, $data, true); } else { for ($offset = 0; $offset strlen($data); $offset += $this-chunk_size) { $success = @xml_parse($parser, substr($data, $offset, $this-chunk_size), false); if (!$success) { break; } } if ($success) { $success = @xml_parse($parser, , true); } } echo Encoding: $this-encoding\n; echo XML Prologue: .($this-prologue ? 'present': 'not present'), \n; echo Chunk size: .($this-chunk_size ? $this-chunk_size byte(s)\n: all data at once\n); echo BOM: .($this-bom ? 'prepended': 'not prepended'), \n; if ($success) { var_dump($this-tags); } else { echo [Error] ,