com php-src: Removed shmop test leaking an shm segment: ext/shmop/shmop.c ext/shmop/tests/003.phpt
| From: | Matteo Beccati | Date: | Wed, 30 Mar 2016 08:00:28 +0000 |
| Subject: | com php-src: Removed shmop test leaking an shm segment: ext/shmop/shmop.c ext/shmop/tests/003.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91547@lists.php.net to get a copy of this message | ||
Commit: 3bfe1c55ae72f6f2c1cccc641e46f26114376ecd
Author: Matteo Beccati <mbeccati@php.net> Wed, 30 Mar 2016 10:00:28 +0200
Parents: ed06d130f70691cb50bed9dc7b9db38970a9d408
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3bfe1c55ae72f6f2c1cccc641e46f26114376ecd
Log:
Removed shmop test leaking an shm segment
Changed paths:
M ext/shmop/shmop.c
D ext/shmop/tests/003.phpt
Diff:
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c
index 4fe65ae..d647790 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 1c154f0..0000000
--- 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)