summaryrefslogtreecommitdiff
path: root/ext/sysvmsg/tests
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-01-24 14:19:53 +0000
committerAntony Dovgal <tony2001@php.net>2005-01-24 14:19:53 +0000
commit5a559e9a5776372cd6e4a1af17bc0c34ea5e4f7e (patch)
treeb4ce7dde7ab73c5b37ea9d4d0bdfca3740d4fa5c /ext/sysvmsg/tests
parent9e55579cb0b002945dd097c43832aba88509e781 (diff)
downloadphp-git-5a559e9a5776372cd6e4a1af17bc0c34ea5e4f7e.tar.gz
add test
Diffstat (limited to 'ext/sysvmsg/tests')
-rw-r--r--ext/sysvmsg/tests/002.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/sysvmsg/tests/002.phpt b/ext/sysvmsg/tests/002.phpt
new file mode 100644
index 0000000000..b947f2689a
--- /dev/null
+++ b/ext/sysvmsg/tests/002.phpt
@@ -0,0 +1,19 @@
+--TEST--
+msg_recieve() should return false when unserialize() failed
+--SKIPIF--
+<?php if (!extension_loaded("sysvmsg")) die("skip sysvmsg extenions is not available")?>
+--FILE--
+<?php
+
+$queue = msg_get_queue (ftok(__FILE__, 'r'), 0600);
+if (!msg_send ($queue, 1, 'Hi', false /* ! no_ser*/, true/*block*/, $msg_err)) {
+ die("error\n");
+}
+var_dump($res = msg_receive ($queue, 1, $msg_type, 16384, $msg, true, 0, $msg_error));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: msg_receive(): message corrupted in %s002.php on line %d
+bool(false)
+Done