diff options
author | Matteo Beccati <mbeccati@php.net> | 2016-03-30 10:00:28 +0200 |
---|---|---|
committer | Matteo Beccati <mbeccati@php.net> | 2016-03-30 10:00:28 +0200 |
commit | 3bfe1c55ae72f6f2c1cccc641e46f26114376ecd (patch) | |
tree | 0179dafaada1d5c62aea5118a515d6fd37d9a55e /ext/shmop | |
parent | ed06d130f70691cb50bed9dc7b9db38970a9d408 (diff) | |
download | php-git-3bfe1c55ae72f6f2c1cccc641e46f26114376ecd.tar.gz |
Removed shmop test leaking an shm segment
Diffstat (limited to 'ext/shmop')
-rw-r--r-- | ext/shmop/shmop.c | 1 | ||||
-rw-r--r-- | ext/shmop/tests/003.phpt | 33 |
2 files changed, 1 insertions, 33 deletions
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index 4fe65ae37d..d647790aa0 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -203,6 +203,7 @@ PHP_FUNCTION(shmop_open) } if (shmctl(shmop->shmid, IPC_STAT, &shm)) { + /* please do not add coverage here: the segment would be leaked and impossible to delete via php */ php_error_docref(NULL, E_WARNING, "unable to get shared memory segment information '%s'", strerror(errno)); goto err; } diff --git a/ext/shmop/tests/003.phpt b/ext/shmop/tests/003.phpt deleted file mode 100644 index 1c154f08ca..0000000000 --- a/ext/shmop/tests/003.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -shmop extension error messages (non-root) ---SKIPIF-- -<?php - if( substr(PHP_OS, 0, 3) == "WIN") { - die('skip not for Windows'); - } - if (!extension_loaded("shmop")) { - die("skip shmop extension not available"); - } - if (!extension_loaded("posix")) { - die("skip posix extension not available"); - } - if (!posix_geteuid()) { - die("skip cannot run test as root"); - } -?> ---FILE-- -<?php - $hex_shm_id = function(){ - return mt_rand(1338, 9999); - }; - -echo '## shmop_open function tests ##', PHP_EOL; - // warning outputs: unable to get shared memory segment information - var_dump(shmop_open($hex_shm_id(), 'n', 0, 1024)); - -?> ---EXPECTF-- -## shmop_open function tests ## - -Warning: shmop_open(): unable to get shared memory segment information 'Permission denied' in %s on line %d -bool(false) |