mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-27 00:56:23 +00:00
Use caseless string comparison for Demos test name matching
This commit is contained in:
1 parent
d6a4009894
commit
b7f943f6c5
1 file changed
+15
-2
@@ -40,6 +40,12 @@
|
||||
#define NK_ASSERT(expr) TEST_ASSERT(expr, "nuklear assertion failed")
|
||||
#include "3rdparty/nuklear/nuklear.h"
|
||||
|
||||
static void ToLower(std::string &str)
|
||||
{
|
||||
for(char &c : str)
|
||||
c = tolower(c);
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
|
||||
#define NK_GDI_IMPLEMENTATION
|
||||
@@ -480,9 +486,13 @@ Usage: %s Test_Name [test_options]
|
||||
bool validTestArg = false;
|
||||
if(argc >= 2)
|
||||
{
|
||||
std::string match(argv[1]);
|
||||
ToLower(match);
|
||||
for(const TestMetadata &test : tests)
|
||||
{
|
||||
if(!strcmp(test.Name, argv[1]))
|
||||
std::string name(test.Name);
|
||||
ToLower(name);
|
||||
if(name == match)
|
||||
{
|
||||
validTestArg = true;
|
||||
break;
|
||||
@@ -673,9 +683,12 @@ Usage: %s Test_Name [test_options]
|
||||
SetUnhandledExceptionFilter(&exceptionHandler);
|
||||
#endif
|
||||
|
||||
ToLower(testchoice);
|
||||
for(const TestMetadata &test : tests)
|
||||
{
|
||||
if(testchoice == test.Name)
|
||||
std::string name(test.Name);
|
||||
ToLower(name);
|
||||
if(testchoice == name)
|
||||
{
|
||||
TEST_LOG("Running '%s'", test.Name);
|
||||
test.test->Prepare(argc, argv);
|
||||
|
||||
Reference in new issue
Block a user