Author: tfaber
Date: Tue Jun 23 10:06:38 2015
New Revision: 68246
URL: http://svn.reactos.org/svn/reactos?rev=68246&view=rev
Log:
[ROSAUTOTEST]
- Flush cout after each write as already done by Colin in r66855, per ROSTESTS-158
- Use DbgPrint instead of OutputDebugStringA again because the latter only calls the former anyway
Fixes test summary lines not being recognized by Testman, especially on VMware.
A little summary so we don't keep going back and forth with this function:
1) Only writing complete lines is required to that the output doesn't mix with debug output from other components. See r55618
2) OutputDebugStringA splits its input into 512-byte-sized blocks with no regard for line breaks, so using it with strings larger than 512 bytes breaks (1).
3) OutputDebugStringA eventually calls DbgPrint("%s", string) anyway so using it with chunks smaller than 512 bytes is not an optimization
As a result, yes this function MUST split up the lines itself, this can't be optimized or simplified away! kthxbye
ROSTESTS-178 #resolve
Modified:
trunk/rostests/rosautotest/tools.cpp
Modified: trunk/rostests/rosautotest/tools.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/rosautotest/tools.cpp?rev…
==============================================================================
--- trunk/rostests/rosautotest/tools.cpp [iso-8859-1] (original)
+++ trunk/rostests/rosautotest/tools.cpp [iso-8859-1] Tue Jun 23 10:06:38 2015
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Automatic Testing Utility
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
* PURPOSE: Various helper functions
- * COPYRIGHT: Copyright 2008-2009 Colin Finck <colin(a)reactos.org>
+ * COPYRIGHT: Copyright 2008-2015 Colin Finck <colin(a)reactos.org>
*/
#include "precomp.h"
@@ -136,7 +136,7 @@
}
DbgString[size] = 0;
- OutputDebugStringA(DbgString);
+ DbgPrint("%s", DbgString);
}
last_newline = curr_pos;
@@ -150,11 +150,11 @@
{
/* Output the whole string */
if(Configuration.DoPrint())
- cout << NewString;
+ cout << NewString << flush;
memcpy(DbgString, NewString.c_str() + start, size);
DbgString[size] = 0;
- OutputDebugStringA(DbgString);
+ DbgPrint("%s", DbgString);
NewString.clear();
return NewString;
@@ -162,7 +162,7 @@
/* Output full lines only */
if(Configuration.DoPrint())
- cout << NewString.substr(0, start);
+ cout << NewString.substr(0, start) << flush;
/* Return the remaining chunk */
return NewString.substr(start, size);