Commit f3f003e3 authored by Martin Marinov's avatar Martin Marinov
Browse files

Synchronize thread output to the test checksum report stream.

parent d5b0d484
......@@ -6,6 +6,7 @@
#include "Base/Debug/DebCallStack.hh"
#include <fstream>
#include <iostream>
#include <mutex>
namespace Test {
namespace Checksum {
......@@ -137,20 +138,24 @@ Difference Object::compare(
void Object::add(const Result& _rslt, const String& _data)
static std::mutex mtx; //synchronize access to the checksum report stream
std::lock_guard<std::mutex> lock(mtx);
static Base::OutputStreamAdaptT<std::ofstream> test_str(REPORT_FILENAME);
static bool tag_out = false;
#ifdef DEB_ON
static String prev_call_stck;
String call_stck("/");
if (prev_call_stck != call_stck)
test_str << call_stck << Base::LF;
prev_call_stck = call_stck;
if (!tag_out)
tag_out = true;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment