Annotation of embedaddon/php/ext/sysvshm/tests/004.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: shm_put_var() tests
3: --SKIPIF--
4: <?php if (!extension_loaded("sysvshm")) print "skip"; ?>
5: --FILE--
6: <?php
7:
8: $key = ftok(__FILE__, 't');
9: $s = shm_attach($key, 1024);
10:
11: var_dump(shm_put_var());
12: var_dump(shm_put_var(-1, -1, -1));
13: var_dump(shm_put_var(-1, 10, "qwerty"));
14: var_dump(shm_put_var($s, -1, "qwerty"));
15: var_dump(shm_put_var($s, 10, "qwerty"));
16: var_dump(shm_put_var($s, 10, "qwerty"));
17:
18: $string = str_repeat("test", 512);
19: var_dump(shm_put_var($s, 11, $string));
20:
21: shm_remove($s);
22:
23: echo "Done\n";
24: ?>
25: --EXPECTF--
26: Warning: shm_put_var() expects exactly 3 parameters, 0 given in %s004.php on line %d
27: NULL
28:
29: Warning: shm_put_var() expects parameter 1 to be resource, integer given in %s004.php on line %d
30: NULL
31:
32: Warning: shm_put_var() expects parameter 1 to be resource, integer given in %s004.php on line %d
33: NULL
34: bool(true)
35: bool(true)
36: bool(true)
37:
38: Warning: shm_put_var(): not enough shared memory left in %s004.php on line 14
39: bool(false)
40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>