[ros-diffs] [cfinck] 39027: Output the string indicating the test which is going to be run in one call. This should prevent a race condition, when another application also outputs something over the debug line.

cfinck at svn.reactos.org cfinck at svn.reactos.org
Thu Jan 22 23:12:14 CET 2009


Author: cfinck
Date: Thu Jan 22 16:12:13 2009
New Revision: 39027

URL: http://svn.reactos.org/svn/reactos?rev=39027&view=rev
Log:
Output the string indicating the test which is going to be run in one call.
This should prevent a race condition, when another application also outputs something over the debug line.

Modified:
    trunk/rostests/rosautotest/winetests.c

Modified: trunk/rostests/rosautotest/winetests.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/rosautotest/winetests.c?rev=39027&r1=39026&r2=39027&view=diff
==============================================================================
--- trunk/rostests/rosautotest/winetests.c [iso-8859-1] (original)
+++ trunk/rostests/rosautotest/winetests.c [iso-8859-1] Thu Jan 22 16:12:13 2009
@@ -49,13 +49,14 @@
         LogLength = BUFFER_BLOCKSIZE;
     }
 
+    /* Allocate a buffer with the exact size of the output string.
+       We have to output this string in one call to prevent a race condition, when another application also outputs a string over the debug line. */
+    Buffer = HeapAlloc(hProcessHeap, 0, 27 + strlen(GetSuiteIDData->Module) + 8 + strlen(GetSuiteIDData->Test) + 2);
+    sprintf(Buffer, "Running Wine Test, Module: %s, Test: %s\n", GetSuiteIDData->Module, GetSuiteIDData->Test);
+    StringOut(Buffer);
+    HeapFree(hProcessHeap, 0, Buffer);
+
     /* Execute the test */
-    StringOut("Running Wine Test, Module: ");
-    StringOut(GetSuiteIDData->Module);
-    StringOut(", Test: ");
-    StringOut(GetSuiteIDData->Test);
-    StringOut("\n");
-
     if(!CreateProcessW(NULL, CommandLine, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, StartupInfo, &ProcessInfo))
     {
         StringOut("CreateProcessW for running the test failed\n");



More information about the Ros-diffs mailing list