summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-05-18 20:19:34 +0000
committerAntony Dovgal <tony2001@php.net>2006-05-18 20:19:34 +0000
commiteeccf79e5c2d194eae0046e27340373febd374d4 (patch)
tree1a55d56b1d360db22604712cc9e9c4f54fd759d1
parent0f30174f3c184084fb1caba485ae97aa509352fe (diff)
downloadphp-git-eeccf79e5c2d194eae0046e27340373febd374d4.tar.gz
fix test and add new for 64bit only
-rwxr-xr-xext/wddx/tests/bug35410.phpt5
-rwxr-xr-xext/wddx/tests/bug35410_64bit.phpt76
2 files changed, 81 insertions, 0 deletions
diff --git a/ext/wddx/tests/bug35410.phpt b/ext/wddx/tests/bug35410.phpt
index a14544d03c..3b4b9b62cf 100755
--- a/ext/wddx/tests/bug35410.phpt
+++ b/ext/wddx/tests/bug35410.phpt
@@ -1,5 +1,10 @@
--TEST--
#35410 (wddx_deserialize() doesn't handle large ints as keys properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded("wddx")) print "skip";
+ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
--FILE--
<?php
$wddx = <<<WDX
diff --git a/ext/wddx/tests/bug35410_64bit.phpt b/ext/wddx/tests/bug35410_64bit.phpt
new file mode 100755
index 0000000000..15377b175e
--- /dev/null
+++ b/ext/wddx/tests/bug35410_64bit.phpt
@@ -0,0 +1,76 @@
+--TEST--
+#35410 (wddx_deserialize() doesn't handle large ints as keys properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded("wddx")) print "skip";
+ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+$wddx = <<<WDX
+<wddxpacket version="1.0">
+<header>
+<comment>Content Configuration File</comment>
+</header>
+<data>
+<struct>
+<var name="content_queries">
+<struct>
+<var name="content_113300831086270200">
+<struct>
+<var name="113301888545229100">
+<struct>
+<var name="max">
+<number>10</number>
+</var>
+<var name="cache">
+<number>4</number>
+</var>
+<var name="order">
+<struct>
+<var name="content_113300831086270200">
+<struct>
+<var name="CMS_BUILD">
+<string>desc</string>
+</var>
+</struct>
+</var>
+</struct>
+</var>
+</struct>
+</var>
+</struct>
+</var>
+</struct>
+</var>
+</struct>
+</data>
+</wddxpacket>
+WDX;
+
+var_dump(wddx_deserialize($wddx));
+?>
+--EXPECT--
+array(1) {
+ ["content_queries"]=>
+ array(1) {
+ ["content_113300831086270200"]=>
+ array(1) {
+ [113301888545229100]=>
+ array(3) {
+ ["max"]=>
+ int(10)
+ ["cache"]=>
+ int(4)
+ ["order"]=>
+ array(1) {
+ ["content_113300831086270200"]=>
+ array(1) {
+ ["CMS_BUILD"]=>
+ string(4) "desc"
+ }
+ }
+ }
+ }
+ }
+}