Address PR comments

This commit is contained in:
jonawals
2021-06-07 15:32:17 +01:00
parent a0feeec608
commit 796b5be286
4 changed files with 11 additions and 11 deletions
@@ -40,10 +40,10 @@ namespace TestImpact
{
std::cout << "Sequence completed in " << (duration.count() / 1000.f) << "s with";
if (failureReport.GetExecutionFailures().size() ||
failureReport.GetTestRunFailures().size() ||
failureReport.GetTimedOutTests().size() ||
failureReport.GetUnexecutedTests().size())
if (!failureReport.GetExecutionFailures().empty() ||
!failureReport.GetTestRunFailures().empty() ||
!failureReport.GetTimedOutTests().empty() ||
!failureReport.GetUnexecutedTests().empty())
{
std::cout << ":\n";
std::cout << SetColor(Foreground::White, Background::Red).c_str()
@@ -29,7 +29,7 @@ namespace TestImpact
class TestSequenceEventHandler
{
public:
TestSequenceEventHandler(SuiteType suiteFilter);
explicit TestSequenceEventHandler(SuiteType suiteFilter);
//! TestSequenceStartCallback.
void operator()(Client::TestRunSelection&& selectedTests);
@@ -16,14 +16,14 @@ namespace TestImpact
{
namespace Console
{
AZStd::string SetColor(Foreground fgd, Background bgd)
AZStd::string SetColor(Foreground foreground, Background background)
{
return AZStd::string::format("\033[%u;%um", static_cast<unsigned>(fgd), static_cast<unsigned>(bgd));
return AZStd::string::format("\033[%u;%um", aznumeric_cast<uint32_t>(foreground), aznumeric_cast<uint32_t>(background));
}
AZStd::string SetColorForString(Foreground fgd, Background bgd, const AZStd::string& str)
AZStd::string SetColorForString(Foreground foreground, Background background, const AZStd::string& str)
{
return AZStd::string::format("%s%s%s", SetColor(fgd, bgd).c_str(), str.c_str(), ResetColor().c_str());
return AZStd::string::format("%s%s%s", SetColor(foreground, background).c_str(), str.c_str(), ResetColor().c_str());
}
AZStd::string ResetColor()
@@ -45,10 +45,10 @@ namespace TestImpact
};
//! Returns a string to be used to set the specified foreground and background color.
AZStd::string SetColor(Foreground fgd, Background bgd);
AZStd::string SetColor(Foreground foreground, Background background);
//! Returns a string with the specified string set to the specified foreground and background color followed by a color reset.
AZStd::string SetColorForString(Foreground fgd, Background bgd, const AZStd::string& str);
AZStd::string SetColorForString(Foreground foreground, Background background, const AZStd::string& str);
//! Returns a string to be used to reset the color back to white foreground on black background.
AZStd::string ResetColor();