Fix colors in output of TestSamples (#3332)
This commit is contained in:
parent
009c144455
commit
afac0e8ad3
|
@ -101,6 +101,11 @@ private:
|
||||||
setSettings(set);
|
setSettings(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
virtual void reportOut(const std::string &outmsg, Color = Color::Reset) override {
|
||||||
|
std::cout << outmsg << std::endl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
void runConsoleCodePageTranslationOnWindows() const {
|
void runConsoleCodePageTranslationOnWindows() const {
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "redirect.h"
|
#include "redirect.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cctype>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -124,8 +125,10 @@ static std::string writestr(const std::string &str, bool gccStyle = false)
|
||||||
ostr << "\\t";
|
ostr << "\\t";
|
||||||
else if (*i == '\"')
|
else if (*i == '\"')
|
||||||
ostr << "\\\"";
|
ostr << "\\\"";
|
||||||
else
|
else if (std::isprint(static_cast<unsigned char>(*i)))
|
||||||
ostr << *i;
|
ostr << *i;
|
||||||
|
else
|
||||||
|
ostr << "\\x" << std::hex << short{*i};
|
||||||
}
|
}
|
||||||
if (!str.empty() && !gccStyle)
|
if (!str.empty() && !gccStyle)
|
||||||
ostr << std::endl;
|
ostr << std::endl;
|
||||||
|
|
Loading…
Reference in New Issue