summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-12-21 12:16:20 +0000
committerAntony Dovgal <tony2001@php.net>2005-12-21 12:16:20 +0000
commit604990d6a56b47e0c442118746cc312268ca4a9e (patch)
tree80380a011f07ab08493a84851c7b994c33a99f33 /ext
parentb7d5d7047bea5d1600e71e49855f86f5e66546dc (diff)
downloadphp-git-604990d6a56b47e0c442118746cc312268ca4a9e.tar.gz
fix test, add test for 64bit platform
Diffstat (limited to 'ext')
-rwxr-xr-xext/wddx/tests/bug35410.phpt7
-rwxr-xr-xext/wddx/tests/bug35410_64bit.phpt76
2 files changed, 81 insertions, 2 deletions
diff --git a/ext/wddx/tests/bug35410.phpt b/ext/wddx/tests/bug35410.phpt
index 966bb0e5bb..3b4b9b62cf 100755
--- a/ext/wddx/tests/bug35410.phpt
+++ b/ext/wddx/tests/bug35410.phpt
@@ -1,7 +1,10 @@
--TEST--
#35410 (wddx_deserialize() doesn't handle large ints as keys properly)
--SKIPIF--
-<?php if (!extension_loaded("wddx")) print "skip"; ?>
+<?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
@@ -53,7 +56,7 @@ array(1) {
array(1) {
["content_113300831086270200"]=>
array(1) {
- [113301888545229100]=>
+ ["113301888545229100"]=>
array(3) {
["max"]=>
int(10)
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"
+ }
+ }
+ }
+ }
+ }
+}