Skip to content

Commit dc0e1ec

Browse files
authored
Merge pull request #152 from andypost/master
Split issue067 test for 32 bits
2 parents 4088b6a + 17cf29c commit dc0e1ec

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/issue067.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Issue #67 (uint64_t)
55
if (!extension_loaded("msgpack")) {
66
die("skip");
77
}
8+
if (PHP_INT_SIZE !== 8)
9+
die("skip this test is for 64-bit platforms only");
810
?>
911
--FILE--
1012
<?php

tests/issue067_32bit.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
Issue #67 (uint64_t)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded("msgpack")) {
6+
die("skip");
7+
}
8+
if (PHP_INT_SIZE !== 4)
9+
die("skip this test is for 32-bit platforms only");
10+
?>
11+
--FILE--
12+
<?php
13+
var_dump(msgpack_unpack("\xcf"."\x7f\xff\xff\xff"."\xff\xff\xff\xff"));
14+
var_dump(msgpack_unpack("\xcf"."\x80\x00\x00\x00"."\x00\x00\x00\x00"));
15+
var_dump(msgpack_unpack("\xcf"."\xff\xff\xff\xff"."\xff\xff\xff\xff"));
16+
?>
17+
OK
18+
--EXPECT--
19+
string(19) "9223372036854775807"
20+
string(19) "9223372036854775808"
21+
string(20) "18446744073709551615"
22+
OK

0 commit comments

Comments
 (0)