[PATCH v3 2/3] ntoskrnl.exe/tests: Print the current test name instead of ntorksnl.

Rémi Bernon rbernon at codeweavers.com
Mon Aug 30 05:57:10 CDT 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/ntoskrnl.exe/tests/utils.h | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/dlls/ntoskrnl.exe/tests/utils.h b/dlls/ntoskrnl.exe/tests/utils.h
index f73f6f938ca..4393518acb9 100644
--- a/dlls/ntoskrnl.exe/tests/utils.h
+++ b/dlls/ntoskrnl.exe/tests/utils.h
@@ -178,19 +178,31 @@ static inline NTSTATUS winetest_init(void)
             FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SYNCHRONOUS_IO_NONALERT);
 }
 
-static inline void winetest_cleanup(void)
+#define winetest_cleanup() winetest_cleanup_(__FILE__)
+static inline void winetest_cleanup_(const char *file)
 {
+    char test_name[MAX_PATH], *tmp;
     struct test_data *data;
     SIZE_T size = sizeof(*data);
+    const char *source_file;
     OBJECT_ATTRIBUTES attr;
     UNICODE_STRING string;
     void *addr = NULL;
     HANDLE section;
 
+    source_file = strrchr(file,'/');
+    if (!source_file) source_file = strrchr(file,'\\');
+    if (!source_file) source_file = file;
+    else source_file++;
+
+    strcpy(test_name, source_file);
+    if ((tmp = strrchr(test_name, '.'))) *tmp = 0;
+
     if (winetest_debug)
     {
-        kprintf("%04x:ntoskrnl: %d tests executed (%d marked as todo, %d %s), %d skipped.\n",
-                (DWORD)(DWORD_PTR)PsGetCurrentProcessId(), successes + failures + todo_successes + todo_failures,
+        kprintf("%04x:%s: %d tests executed (%d marked as todo, %d %s), %d skipped.\n",
+                (DWORD)(DWORD_PTR)PsGetCurrentProcessId(), test_name,
+                successes + failures + todo_successes + todo_failures,
                 todo_successes, failures + todo_failures,
                 (failures + todo_failures != 1) ? "failures" : "failure", skipped );
     }
-- 
2.33.0




More information about the wine-devel mailing list