Annotation of embedaddon/php/ext/pcntl/tests/pcntl_wait.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: pcntl_wait()
        !             3: --SKIPIF--
        !             4: <?php if (!extension_loaded("pcntl")) print "skip"; ?>
        !             5: <?php if (!extension_loaded("posix")) die("skip posix extension not available"); ?>
        !             6: --FILE--
        !             7: <?php
        !             8: $pid = pcntl_fork();
        !             9: if ($pid == 1) {
        !            10:        die("failed");
        !            11: } else if ($pid) {
        !            12:        $status = 0;
        !            13:        pcntl_wait($status, WUNTRACED);
        !            14:        var_dump(pcntl_wifexited($status));
        !            15:        posix_kill($pid, SIGCONT);
        !            16: 
        !            17:        pcntl_wait($status);
        !            18:        var_dump(pcntl_wifsignaled($status));
        !            19:        var_dump(pcntl_wifstopped($status));
        !            20:        var_dump(pcntl_wexitstatus($status));
        !            21: 
        !            22:        var_dump(pcntl_wait($status, WNOHANG | WUNTRACED));
        !            23:        var_dump(pcntl_wait());
        !            24:        var_dump(pcntl_waitpid());
        !            25: 
        !            26:        var_dump(pcntl_wifexited());
        !            27:        var_dump(pcntl_wifstopped());
        !            28:        var_dump(pcntl_wifsignaled());
        !            29:        var_dump(pcntl_wexitstatus());
        !            30:        var_dump(pcntl_wtermsig());
        !            31:        var_dump(pcntl_wstopsig());
        !            32: } else {
        !            33:        posix_kill(posix_getpid(), SIGSTOP);
        !            34:        exit(42);
        !            35: }
        !            36: ?>
        !            37: --EXPECTF--
        !            38: bool(false)
        !            39: bool(false)
        !            40: bool(false)
        !            41: int(42)
        !            42: int(-1)
        !            43: 
        !            44: Warning: pcntl_wait() expects at least 1 parameter, 0 given in %s
        !            45: NULL
        !            46: 
        !            47: Warning: pcntl_waitpid() expects at least 2 parameters, 0 given in %s
        !            48: NULL
        !            49: 
        !            50: Warning: pcntl_wifexited() expects exactly 1 parameter, 0 given in %s
        !            51: NULL
        !            52: 
        !            53: Warning: pcntl_wifstopped() expects exactly 1 parameter, 0 given in %s
        !            54: NULL
        !            55: 
        !            56: Warning: pcntl_wifsignaled() expects exactly 1 parameter, 0 given in %s
        !            57: NULL
        !            58: 
        !            59: Warning: pcntl_wexitstatus() expects exactly 1 parameter, 0 given in %s
        !            60: NULL
        !            61: 
        !            62: Warning: pcntl_wtermsig() expects exactly 1 parameter, 0 given in %s
        !            63: NULL
        !            64: 
        !            65: Warning: pcntl_wstopsig() expects exactly 1 parameter, 0 given in %s
        !            66: NULL

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>