]> granicus.if.org Git - php/commitdiff
Removed shmop test leaking an shm segment
authorMatteo Beccati <mbeccati@php.net>
Wed, 30 Mar 2016 08:00:28 +0000 (10:00 +0200)
committerMatteo Beccati <mbeccati@php.net>
Wed, 30 Mar 2016 08:00:28 +0000 (10:00 +0200)
ext/shmop/shmop.c
ext/shmop/tests/003.phpt [deleted file]

index 4fe65ae37d0a1477ae61a9dcf469305216df6b07..d647790aa06f8b6070ff1e795e2d0fa102828ec6 100644 (file)
@@ -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 (file)
index 1c154f0..0000000
+++ /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)