mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Make focus's "test_" or "bench_" prefix optional.
This commit is contained in:
1 parent
7e654ba652
commit
c62aa518a5
3 files changed
+16
-2
No files matched your search
@@ -61,9 +61,23 @@ bool check_focus() {
|
||||
while ((*q != ',') && (*q != '\x00')) {
|
||||
q++;
|
||||
}
|
||||
|
||||
// See if proc_funcname (with or without a "test_" or "bench_" prefix)
|
||||
// starts with the [p, q) string.
|
||||
if (!strncmp(proc_funcname, p, q - p)) {
|
||||
return true;
|
||||
}
|
||||
const char* unprefixed_proc_funcname = NULL;
|
||||
if (!strncmp(proc_funcname, "test_", 5)) {
|
||||
unprefixed_proc_funcname = proc_funcname + 5;
|
||||
} else if (!strncmp(proc_funcname, "bench_", 6)) {
|
||||
unprefixed_proc_funcname = proc_funcname + 6;
|
||||
}
|
||||
if (unprefixed_proc_funcname &&
|
||||
!strncmp(unprefixed_proc_funcname, p, q - p)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (*q == '\x00') {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user