[PATCH v2 4/5] ReportsHtml.cc: Restore ostream format

Ryan Long ryan.long at oarcorp.com
Tue Jul 20 15:06:56 UTC 2021


CID 1505939: Not restoring ofstream format

Save format of stream before changing it, and change it back before returning.

Closes #4471
---
 tester/covoar/ReportsHtml.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc
index 53ee0c1..e276732 100644
--- a/tester/covoar/ReportsHtml.cc
+++ b/tester/covoar/ReportsHtml.cc
@@ -6,6 +6,7 @@
 #include <iomanip>
 
 #include <rld.h>
+#include <rtems-utils.h>
 
 #include "ReportsHtml.h"
 #include "app_common.h"
@@ -13,6 +14,8 @@
 #include "DesiredSymbols.h"
 #include "ObjdumpProcessor.h"
 
+typedef rtems::utils::ostream_guard ostream_guard;
+
 #if 0
 #define TABLE_HEADER_CLASS \
   " table-autopage:10 table-page-number:pagenum table-page-count:pages "
@@ -724,6 +727,7 @@ namespace Coverage {
     const SymbolInformation& symbolInfo
   )
   {
+    ostream_guard old_state( report );
 
     // Mark the background color different for odd and even lines.
     if ( ( count % 2 ) != 0 ) {
@@ -818,6 +822,7 @@ namespace Coverage {
     }
 
     report << "</tr>" << std::endl;
+
     return true;
   }
 
-- 
1.8.3.1



More information about the devel mailing list