!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/test/cxx/   drwxr-xr-x
Free 289.67 GB of 429.69 GB (67.41%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     FileDescriptorTest.cpp (1.47 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#include <TestSupport.h>
#include <FileDescriptor.h>
#include <cerrno>

using namespace Passenger;

namespace tut {
    struct FileDescriptorTest: public TestBase {
        int pipes[2];

        FileDescriptorTest() {
            pipe(pipes);
        }

        ~FileDescriptorTest() {
            if (pipes[0] != -1) {
                close(pipes[0]);
            }
            if (pipes[1] != -1) {
                close(pipes[1]);
            }
        }
    };

    DEFINE_TEST_GROUP(FileDescriptorTest);

    TEST_METHOD(1) {
        // Test constructors.
        FileDescriptor f;
        ensure_equals("An empty FileDescriptor has value -1",
            f, -1);

        int fd = pipes[0];
        pipes[0] = -1;
        f = FileDescriptor(fd, __FILE__, __LINE__);
        ensure_equals("FileDescriptor takes the value of its constructor argument",
            f, fd);
    }

    TEST_METHOD(2) {
        // It closes the underlying file descriptor when the last
        // instance is destroyed.
        int reader = pipes[0];
        pipes[0] = -1;
        {
            FileDescriptor f(reader, __FILE__, __LINE__);
            {
                FileDescriptor f2(f);
            }
            ensure("File descriptor is not closed if there are still live copies",
                write(pipes[1], "x", 1) != -1);
        }
        ensure("File descriptor is closed if the last live copy is dead",
            write(pipes[1], "x", 1) == -1);
    }

    TEST_METHOD(3) {
        // Calling close() will close the underlying file descriptor for all instances.
        int reader = pipes[0];
        pipes[0] = -1;

        FileDescriptor f(reader, __FILE__, __LINE__);
        FileDescriptor f2(f);
        f.close();
        ensure_equals("(1)", f, -1);
        ensure_equals("(2)", f2, -1);
        ensure(write(pipes[1], "x", 1) == -1);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0991 ]--