File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / sysvmsg / tests / 002.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
msg_receive() 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));

if (!msg_remove_queue($queue)) {
	echo "BAD: queue removal failed\n";
}
	
echo "Done\n";
?>
--EXPECTF--
Warning: msg_receive(): message corrupted in %s002.php on line %d
bool(false)
Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>