diff options
-rw-r--r-- | ext/shmop/tests/002.phpt | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ext/shmop/tests/002.phpt b/ext/shmop/tests/002.phpt index 3206f90776..94d536a175 100644 --- a/ext/shmop/tests/002.phpt +++ b/ext/shmop/tests/002.phpt @@ -13,37 +13,34 @@ edgarsandi - <edgar.r.sandi@gmail.com> ?> --FILE-- <?php - $hex_shm_id = function(){ - return mt_rand(1338, 9999); - }; echo PHP_EOL, '## shmop_open function tests ##'; // warning outputs: 4 parameters expected var_dump($shm_id = shmop_open()); // warning outputs: invalid flag when the flags length != 1 - var_dump(shmop_open($hex_shm_id(), '', 0644, 1024)); + var_dump(shmop_open(1338, '', 0644, 1024)); // warning outputs: invalid access mode - var_dump(shmop_open($hex_shm_id(), 'b', 0644, 1024)); + var_dump(shmop_open(1338, 'b', 0644, 1024)); // warning outputs: unable to attach or create shared memory segment var_dump(shmop_open(null, 'a', 0644, 1024)); // warning outputs: Shared memory segment size must be greater than zero - var_dump(shmop_open($hex_shm_id(), "c", 0666, 0)); + var_dump(shmop_open(1338, "c", 0666, 0)); echo PHP_EOL, '## shmop_read function tests ##'; // warning outputs: 3 parameters expected var_dump(shmop_read()); // warning outputs: start is out of range - $shm_id = shmop_open($hex_shm_id(), 'n', 0600, 1024); + $shm_id = shmop_open(1338, 'n', 0600, 1024); var_dump(shmop_read($shm_id, -10, 0)); shmop_delete($shm_id); // warning outputs: count is out of range - $shm_id = shmop_open($hex_shm_id(), 'n', 0600, 1024); + $shm_id = shmop_open(1339, 'n', 0600, 1024); var_dump(shmop_read($shm_id, 0, -10)); shmop_delete($shm_id); @@ -52,7 +49,7 @@ echo PHP_EOL, '## shmop_write function tests ##'; var_dump(shmop_write()); // warning outputs: offset out of range - $shm_id = shmop_open($hex_shm_id(), 'n', 0600, 1024); + $shm_id = shmop_open(1340, 'n', 0600, 1024); var_dump(shmop_write($shm_id, 'text to try write', -10)); shmop_delete($shm_id); |