[ROSAUTOTEST]
[reactos.git] / rostests / rosautotest / tools.cpp
index 417e809..b5276ba 100644 (file)
@@ -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;
@@ -149,18 +149,20 @@ StringOut(const string& String, bool forcePrint)
     if(forcePrint == true || NewString[curr_pos - 1] == '\n')
     {
         /* Output the whole string */
-        cout << NewString;
+        if(Configuration.DoPrint())
+            cout << NewString << flush;
 
         memcpy(DbgString, NewString.c_str() + start, size);
         DbgString[size] = 0;
-        OutputDebugStringA(DbgString);
+        DbgPrint("%s", DbgString);
 
         NewString.clear();
         return NewString;
     }
 
     /* Output full lines only */
-    cout << NewString.substr(0, start);
+    if(Configuration.DoPrint())
+        cout << NewString.substr(0, start) << flush;
 
     /* Return the remaining chunk */
     return NewString.substr(start, size);