diff options
Diffstat (limited to '3rdparty/bx/tests/tokenizecmd_test.cpp')
-rw-r--r-- | 3rdparty/bx/tests/tokenizecmd_test.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/3rdparty/bx/tests/tokenizecmd_test.cpp b/3rdparty/bx/tests/tokenizecmd_test.cpp index d1495b28796..fece7ea2f25 100644 --- a/3rdparty/bx/tests/tokenizecmd_test.cpp +++ b/3rdparty/bx/tests/tokenizecmd_test.cpp @@ -15,12 +15,24 @@ TEST_CASE("commandLine", "") "--long", "--platform", "x", + "--num", "1389", + "--foo", + "--", // it should not parse arguments after argument terminator + "--bar", }; bx::CommandLine cmdLine(BX_COUNTOF(args), args); - REQUIRE(cmdLine.hasArg("long") ); - REQUIRE(cmdLine.hasArg('s') ); + REQUIRE( cmdLine.hasArg("long") ); + REQUIRE( cmdLine.hasArg('s') ); + + int32_t num; + REQUIRE(cmdLine.hasArg(num, '\0', "num") ); + REQUIRE(1389 == num); + + // test argument terminator + REQUIRE( cmdLine.hasArg("foo") ); + REQUIRE(!cmdLine.hasArg("bar") ); // non-existing argument REQUIRE(!cmdLine.hasArg('x') ); @@ -46,7 +58,7 @@ static bool test(const char* _input, int32_t _argc, ...) for (int32_t ii = 0; ii < _argc; ++ii) { const char* arg = va_arg(argList, const char*); - if (0 != bx::strncmp(argv[ii], arg) ) + if (0 != bx::strCmp(argv[ii], arg) ) { return false; } |