]> granicus.if.org Git - php/commitdiff
PHP_INT_MIN and _MAX tests
authorAndrea Faulds <ajf@ajf.me>
Fri, 1 Aug 2014 16:01:17 +0000 (17:01 +0100)
committerAndrea Faulds <ajf@ajf.me>
Fri, 1 Aug 2014 16:01:17 +0000 (17:01 +0100)
tests/lang/constants/PHP_INT_32bit.phpt [new file with mode: 0644]
tests/lang/constants/PHP_INT_64bit.phpt [new file with mode: 0644]

diff --git a/tests/lang/constants/PHP_INT_32bit.phpt b/tests/lang/constants/PHP_INT_32bit.phpt
new file mode 100644 (file)
index 0000000..0c85d97
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+Test PHP_INT_MIN, PHP_INT_MAX and PHP_INT_SIZE (32-bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4)
+    die("skip this test is for 32-bit platforms only"); ?>
+--FILE--
+<?php
+
+var_dump(PHP_INT_MIN);
+var_dump(PHP_INT_MAX);
+var_dump(PHP_INT_SIZE);
+
+?>
+--EXPECT--
+int(-2147483648)
+int(2147483647)
+int(4)
\ No newline at end of file
diff --git a/tests/lang/constants/PHP_INT_64bit.phpt b/tests/lang/constants/PHP_INT_64bit.phpt
new file mode 100644 (file)
index 0000000..4b7da3a
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+Test PHP_INT_MIN, PHP_INT_MAX and PHP_INT_SIZE (64-bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 8)
+    die("skip this test is for 64-bit platforms only"); ?>
+--FILE--
+<?php
+
+var_dump(PHP_INT_MIN);
+var_dump(PHP_INT_MAX);
+var_dump(PHP_INT_SIZE);
+
+?>
+--EXPECT--
+int(-9223372036854775808)
+int(9223372036854775807)
+int(8)
\ No newline at end of file