25 #ifndef WTERMINALCOLOR_TEST_H
26 #define WTERMINALCOLOR_TEST_H
32 #include <boost/shared_ptr.hpp>
34 #include <cxxtest/TestSuite.h>
36 #include "../WTerminalColor.h"
50 TS_ASSERT_THROWS_NOTHING(
WTerminalColor( WTerminalColor::Bold, WTerminalColor::FGRed, WTerminalColor::BGNone ) );
59 TS_ASSERT_THROWS_NOTHING( c =
WTerminalColor( WTerminalColor::Bold, WTerminalColor::FGRed, WTerminalColor::BGGreen ) );
62 std::ostringstream ss;
63 #if defined( __linux__ ) || defined( __APPLE__ )
65 ss << cStart <<
"[" << 1 <<
";" << 31 <<
";" << 42 <<
"m";
77 TS_ASSERT_THROWS_NOTHING( c =
WTerminalColor( WTerminalColor::Bold, WTerminalColor::FGRed, WTerminalColor::BGGreen ) );
80 std::ostringstream ss;
81 #if defined( __linux__ ) || defined( __APPLE__ )
83 ss << cStart <<
"[0m";
95 TS_ASSERT_THROWS_NOTHING( c =
WTerminalColor( WTerminalColor::Bold, WTerminalColor::FGRed, WTerminalColor::BGGreen ) );
103 #endif // WTERMINALCOLOR_TEST_H
void testColorResetControlString(void)
Test control string (reset) generated by class.
void testColorDisabled(void)
Test whether the class returns empty control strings when colors are disabled.
void setEnabled(bool enabled)
With this you can easily trigger whether the color control string is used or if "" is returned...
void testInstantiation(void)
An instantiation should never throw an exception.
void testColorControlString(void)
Test control string generated by class.
Helper class to provide a convenient way to colorize output on the console.
std::string m_colorResetString
Control sequence to reset color.
std::string m_colorString
The string actually containing the control sequence to enable colors on the console.