!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/StrIntTools/   drwxr-xr-x
Free 289.66 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:     StrIntUtilsTest.cpp (1.57 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#include <TestSupport.h>
#include <StrIntTools/StrIntUtils.h>

using namespace Passenger;
using namespace std;

namespace tut {
    struct StrIntTools_StrIntUtilsTest: public TestBase {
    };

    void testTruncate(const char* str, const char *tokens, int maxBetweenTokens, const char* expected) {
        std::stringstream sstream;
        truncateBeforeTokens(str, tokens, maxBetweenTokens, sstream);
        ensure("got [" +  sstream.str() + "], expected [" + expected + "]", sstream.str() == expected);
    }

    DEFINE_TEST_GROUP(StrIntTools_StrIntUtilsTest);

    TEST_METHOD(1) {
        set_test_name("no change should occur");
        testTruncate("", "", 0, "");
        testTruncate("testwithout/tokens", "", 2, "testwithout/tokens");
        testTruncate("", "/", 2, "");
        testTruncate("/", "", 2, "/");
        testTruncate("/", "/", 2, "/");
        testTruncate("hello", "/", 2, "hello");
        testTruncate("/hello", "/", 3, "/hello");
    }

    TEST_METHOD(2) {
        set_test_name("truncation must not touch begin/end token");
        testTruncate("hello/", "/", 3, "hel/");
        testTruncate("/hello/", "/", 3, "/hel/");
    }

    TEST_METHOD(3) {
        set_test_name("exact truncation and multiple split tokens");
        testTruncate("hello/world/Main.cpp", "/", 2, "he/wo/Main.cpp");
        testTruncate("hello/world\\Main.cpp", "/\\", 1, "h/w\\Main.cpp");
        testTruncate("hello/world\\Main.cpp", "/", 1, "h/world\\Main.cpp");
        testTruncate("/he/llo/worl/", "/", 3, "/he/llo/wor/");
    }

    TEST_METHOD(4) {
        set_test_name("should ignore non-UTF characters in escapeHTML");
        char s[10];
        snprintf(s, 10, "h\xeallo"); // hĂȘllo
        string result = escapeHTML(s);
        ensure_equals(result, "h?llo");
    }
}

:: 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.0966 ]--