mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[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 svn path=/trunk/; revision=68246
This commit is contained in:
parent
77ad885551
commit
634ccedc1c
1 changed files with 5 additions and 5 deletions
|
@ -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@reactos.org>
|
||||
* COPYRIGHT: Copyright 2008-2015 Colin Finck <colin@reactos.org>
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
@ -136,7 +136,7 @@ StringOut(const string& String, bool forcePrint)
|
|||
}
|
||||
|
||||
DbgString[size] = 0;
|
||||
OutputDebugStringA(DbgString);
|
||||
DbgPrint("%s", DbgString);
|
||||
}
|
||||
|
||||
last_newline = curr_pos;
|
||||
|
@ -150,11 +150,11 @@ StringOut(const string& String, bool forcePrint)
|
|||
{
|
||||
/* 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 @@ StringOut(const string& String, bool forcePrint)
|
|||
|
||||
/* 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);
|
||||
|
|
Loading…
Reference in a new issue