From 159d086af45800f7cfb1e488434d12cd5f967b7c Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 25 Apr 2020 02:32:33 +0200 Subject: [PATCH] macOS build fix --- configure.ac | 4 +- examples/calculator.cpp | 14 +- examples/treeview.cpp | 94 +- src/fapplication.cpp | 26 +- src/flistview.cpp | 5 +- src/fmouse.cpp | 2 +- src/foptiattr.cpp | 16 +- src/foptimove.cpp | 38 +- src/fstring.cpp | 4 +- src/fterm.cpp | 22 +- src/ftermcap.cpp | 56 +- src/ftermcapquirks.cpp | 324 +++---- src/ftermdetection.cpp | 68 +- src/ftermlinux.cpp | 4 +- src/ftextview.cpp | 4 - src/fvterm.cpp | 18 +- src/include/final/fc.h | 2 +- src/include/final/fmouse.h | 2 +- src/include/final/foptiattr.h | 3 - src/include/final/ftypes.h | 21 +- src/include/final/fvterm.h | 8 +- test/fkeyboard-test.cpp | 350 +++---- test/foptiattr-test.cpp | 1602 ++++++++++++++++----------------- test/foptimove-test.cpp | 766 ++++++++-------- test/fstring-test.cpp | 259 +++++- test/ftermcapquirks-test.cpp | 270 +++--- test/ftermdata-test.cpp | 12 +- test/ftermdetection-test.cpp | 84 +- test/ftermopenbsd-test.cpp | 2 +- 29 files changed, 2132 insertions(+), 1948 deletions(-) diff --git a/configure.ac b/configure.ac index 9794c8c5..47f6e80d 100644 --- a/configure.ac +++ b/configure.ac @@ -49,9 +49,9 @@ AC_CHECK_FUNCS( \ vsnprintf ) # Checks for 'tgetent' -AC_SEARCH_LIBS([tgetent], [termcap tinfo curses ncurses]) +AC_SEARCH_LIBS([tgetent], [terminfo mytinfo termlib termcap tinfo ncurses curses]) # Checks for 'tparm' -AC_SEARCH_LIBS([tparm], [termcap tinfo curses ncurses]) +AC_SEARCH_LIBS([tparm], [terminfo mytinfo termlib termcap tinfo ncurses curses]) # Checks for libtool AC_ENABLE_SHARED diff --git a/examples/calculator.cpp b/examples/calculator.cpp index 35f17f7c..63f78ce8 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -172,6 +172,7 @@ class Calc final : public finalcut::FDialog // Methods void drawDispay(); void draw() override; + void sendOnButtonAccelerator(); void clear (const lDouble&); void zero (const lDouble&); void one (const lDouble&); @@ -341,11 +342,7 @@ void Calc::onKeyPress (finalcut::FKeyEvent* ev) case fc::Fkey_escape: case fc::Fkey_escape_mintty: - { - finalcut::FAccelEvent a_ev( fc::Accelerator_Event - , getFocusWidget() ); - calculator_buttons[On]->onAccel(&a_ev); - } + sendOnButtonAccelerator(); ev->accept(); break; @@ -466,6 +463,13 @@ void Calc::drawDispay() } } +//---------------------------------------------------------------------- +void Calc::sendOnButtonAccelerator() +{ + finalcut::FAccelEvent a_ev(fc::Accelerator_Event, getFocusWidget()); + calculator_buttons[On]->onAccel(&a_ev); +} + //---------------------------------------------------------------------- void Calc::clear (const lDouble&) { diff --git a/examples/treeview.cpp b/examples/treeview.cpp index 71c014c8..55eb3972 100644 --- a/examples/treeview.cpp +++ b/examples/treeview.cpp @@ -36,6 +36,10 @@ using finalcut::FSize; sInt64 StringToNumber (const finalcut::FString&); bool sortAscending (const finalcut::FObject*, const finalcut::FObject*); bool sortDescending (const finalcut::FObject*, const finalcut::FObject*); +bool isLessThanInteger (const finalcut::FString&, const finalcut::FString&); +bool isLessThanDouble (const finalcut::FString&, const finalcut::FString&); +bool isGreaterThanInteger (const finalcut::FString&, const finalcut::FString&); +bool isGreaterThanDouble (const finalcut::FString&, const finalcut::FString&); // non-member functions @@ -50,6 +54,44 @@ sInt64 StringToNumber (const finalcut::FString& str) return number; } +//---------------------------------------------------------------------- +bool isLessThanInteger ( const finalcut::FString& lhs + , const finalcut::FString& rhs ) +{ + const sInt64 l_number = StringToNumber(lhs); + const sInt64 r_number = StringToNumber(rhs); + return bool( l_number < r_number ); // lhs < rhs +} + +//---------------------------------------------------------------------- +bool isLessThanDouble ( const finalcut::FString& lhs + , const finalcut::FString& rhs ) +{ + std::setlocale(LC_NUMERIC, "C"); + const double l_number = lhs.toDouble(); + const double r_number = rhs.toDouble(); + return bool( l_number < r_number ); // lhs < rhs +} + +//---------------------------------------------------------------------- +bool isGreaterThanInteger ( const finalcut::FString& lhs + , const finalcut::FString& rhs ) +{ + const sInt64 l_number = StringToNumber(lhs); + const sInt64 r_number = StringToNumber(rhs); + return bool( l_number > r_number ); // lhs > rhs +} + +//---------------------------------------------------------------------- +bool isGreaterThanDouble ( const finalcut::FString& lhs + , const finalcut::FString& rhs ) +{ + std::setlocale(LC_NUMERIC, "C"); + const double l_number = lhs.toDouble(); + const double r_number = rhs.toDouble(); + return bool( l_number > r_number ); // lhs > rhs +} + //---------------------------------------------------------------------- bool sortAscending ( const finalcut::FObject* lhs , const finalcut::FObject* rhs ) @@ -57,26 +99,16 @@ bool sortAscending ( const finalcut::FObject* lhs const auto& l_item = static_cast(lhs); const auto& r_item = static_cast(rhs); const int column = l_item->getSortColumn(); + const auto& l_str = l_item->getText(column); + const auto& r_str = r_item->getText(column); - switch ( column ) + if ( column == 2 ) { - case 2: - { - const sInt64 l_number = StringToNumber(l_item->getText(column)); - const sInt64 r_number = StringToNumber(r_item->getText(column)); - return bool( l_number < r_number ); // lhs < rhs - } - - case 3: - { - std::setlocale(LC_NUMERIC, "C"); - const double l_number = l_item->getText(column).toDouble(); - const double r_number = r_item->getText(column).toDouble(); - return bool( l_number < r_number ); // lhs < rhs - } - - default: - break; // Don't do anything + return isGreaterThanInteger(l_str, r_str); + } + else if ( column == 3 ) + { + return isGreaterThanDouble(l_str, r_str); } return false; @@ -89,26 +121,16 @@ bool sortDescending ( const finalcut::FObject* lhs const auto& l_item = static_cast(lhs); const auto& r_item = static_cast(rhs); const int column = l_item->getSortColumn(); + const auto& l_str = l_item->getText(column); + const auto& r_str = r_item->getText(column); - switch ( column ) + if ( column == 2 ) { - case 2: - { - const sInt64 l_number = StringToNumber(l_item->getText(column)); - const sInt64 r_number = StringToNumber(r_item->getText(column)); - return bool( l_number > r_number ); // lhs > rhs - } - - case 3: - { - std::setlocale(LC_NUMERIC, "C"); - const double l_number = l_item->getText(column).toDouble(); - const double r_number = r_item->getText(column).toDouble(); - return bool( l_number > r_number ); // lhs > rhs - } - - default: - break; // Don't do anything + return isLessThanInteger(l_str, r_str); + } + else if ( column == 3 ) + { + return isLessThanDouble(l_str, r_str); } return false; diff --git a/src/fapplication.cpp b/src/fapplication.cpp index d1870032..7da4deb0 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -361,24 +361,24 @@ void FApplication::cmd_options (const int& argc, char* argv[]) { static struct option long_options[] = { - {C_STR("encoding"), required_argument, nullptr, 0 }, - {C_STR("no-mouse"), no_argument, nullptr, 0 }, - {C_STR("no-optimized-cursor"), no_argument, nullptr, 0 }, - {C_STR("no-terminal-detection"), no_argument, nullptr, 0 }, - {C_STR("no-terminal-data-request"), no_argument, nullptr, 0 }, - {C_STR("no-color-change"), no_argument, nullptr, 0 }, - {C_STR("no-sgr-optimizer"), no_argument, nullptr, 0 }, - {C_STR("vgafont"), no_argument, nullptr, 0 }, - {C_STR("newfont"), no_argument, nullptr, 0 }, + {"encoding", required_argument, nullptr, 0 }, + {"no-mouse", no_argument, nullptr, 0 }, + {"no-optimized-cursor", no_argument, nullptr, 0 }, + {"no-terminal-detection", no_argument, nullptr, 0 }, + {"no-terminal-data-request", no_argument, nullptr, 0 }, + {"no-color-change", no_argument, nullptr, 0 }, + {"no-sgr-optimizer", no_argument, nullptr, 0 }, + {"vgafont", no_argument, nullptr, 0 }, + {"newfont", no_argument, nullptr, 0 }, #if defined(__FreeBSD__) || defined(__DragonFly__) - {C_STR("no-esc-for-alt-meta"), no_argument, nullptr, 0 }, - {C_STR("no-cursorstyle-change"), no_argument, nullptr, 0 }, + {"no-esc-for-alt-meta", no_argument, nullptr, 0 }, + {"no-cursorstyle-change", no_argument, nullptr, 0 }, #elif defined(__NetBSD__) || defined(__OpenBSD__) - {C_STR("no-esc-for-alt-meta"), no_argument, nullptr, 0 }, + {"no-esc-for-alt-meta", no_argument, nullptr, 0 }, #endif - {nullptr, 0, nullptr, 0 } + {nullptr, 0, nullptr, 0 } }; opterr = 0; diff --git a/src/flistview.cpp b/src/flistview.cpp index e796aeb8..ae460fc0 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -2960,11 +2960,8 @@ void FListView::cb_hbarChange (const FWidget*, const FDataPtr) break; case FScrollbar::scrollJump: - { - const int value = hbar->getValue(); - scrollToX(value); + scrollToX (hbar->getValue()); break; - } case FScrollbar::scrollWheelUp: scrollBy (-wheel_distance, 0); diff --git a/src/fmouse.cpp b/src/fmouse.cpp index cfe94cbe..1cffe4fc 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -877,7 +877,7 @@ void FMouseSGR::setMoveState (const FPoint& mouse_position, int btn) } //---------------------------------------------------------------------- -void FMouseSGR::setPressedButtonState (const int btn, struct timeval* time) +void FMouseSGR::setPressedButtonState (const int btn, const struct timeval* time) { // Gets the extended x11 mouse mode (SGR) status for pressed buttons diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 3c195926..e8a4df75 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -956,7 +956,7 @@ bool FOptiAttr::setTermAttributes ( FChar*& term { if ( term && F_set_attributes.cap ) { - const char* sgr = tparm ( F_set_attributes.cap + const char* sgr = tparm ( C_STR(F_set_attributes.cap) , p1 && ! fake_reverse , p2 , p3 && ! fake_reverse @@ -1462,9 +1462,9 @@ inline void FOptiAttr::change_to_default_color ( FChar*& term const auto& op = F_orig_pair.cap; if ( op && std::strncmp (op, CSI "39;49;25m", 11) == 0 ) - sgr_49 = C_STR(CSI "49;25m"); + sgr_49 = CSI "49;25m"; else - sgr_49 = C_STR(CSI "49m"); + sgr_49 = CSI "49m"; append_sequence (sgr_49); term->bg_color = fc::Default; @@ -1500,13 +1500,13 @@ inline void FOptiAttr::change_current_color ( const FChar* const& term if ( term->fg_color != fg || frev ) { - color_str = tparm(AF, ansi_fg, 0, 0, 0, 0, 0, 0, 0, 0); + color_str = tparm(C_STR(AF), ansi_fg, 0, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } if ( term->bg_color != bg || frev ) { - color_str = tparm(AB, ansi_bg, 0, 0, 0, 0, 0, 0, 0, 0); + color_str = tparm(C_STR(AB), ansi_bg, 0, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } } @@ -1514,13 +1514,13 @@ inline void FOptiAttr::change_current_color ( const FChar* const& term { if ( term->fg_color != fg || frev ) { - color_str = tparm(Sf, fg, 0, 0, 0, 0, 0, 0, 0, 0); + color_str = tparm(C_STR(Sf), fg, 0, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } if ( term->bg_color != bg || frev ) { - color_str = tparm(Sb, bg, 0, 0, 0, 0, 0, 0, 0, 0); + color_str = tparm(C_STR(Sb), bg, 0, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } } @@ -1528,7 +1528,7 @@ inline void FOptiAttr::change_current_color ( const FChar* const& term { fg = vga2ansi(fg); bg = vga2ansi(bg); - color_str = tparm(sp, fg, bg, 0, 0, 0, 0, 0, 0, 0); + color_str = tparm(C_STR(sp), fg, bg, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } } diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 1c22bd4e..0696a623 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -42,11 +42,11 @@ FOptiMove::FOptiMove (int baud) calculateCharDuration(); // ANSI set cursor address preset for undefined terminals - set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH")); + set_cursor_address (CSI "%i%p1%d;%p2%dH"); // Set carriage return preset - set_carriage_return (C_STR("\r")); + set_carriage_return ("\r"); // Set cursor down preset - set_cursor_down (C_STR("\n")); + set_cursor_down ("\n"); } //---------------------------------------------------------------------- @@ -267,7 +267,7 @@ void FOptiMove::set_cursor_address (const char cap[]) { if ( cap ) { - const char* temp = tgoto(cap, 23, 23); + const char* temp = tgoto(C_STR(cap), 23, 23); F_cursor_address.cap = cap; F_cursor_address.duration = capDuration (temp, 1); F_cursor_address.length = capDurationToLength (F_cursor_address.duration); @@ -285,7 +285,7 @@ void FOptiMove::set_column_address (const char cap[]) { if ( cap ) { - const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); + const char* temp = tparm(C_STR(cap), 23, 0, 0, 0, 0, 0, 0, 0, 0); F_column_address.cap = cap; F_column_address.duration = capDuration (temp, 1); F_column_address.length = capDurationToLength (F_column_address.duration); @@ -303,7 +303,7 @@ void FOptiMove::set_row_address (const char cap[]) { if ( cap ) { - const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); + const char* temp = tparm(C_STR(cap), 23, 0, 0, 0, 0, 0, 0, 0, 0); F_row_address.cap = cap; F_row_address.duration = capDuration (temp, 1); F_row_address.length = capDurationToLength (F_row_address.duration); @@ -321,7 +321,7 @@ void FOptiMove::set_parm_up_cursor (const char cap[]) { if ( cap ) { - const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); + const char* temp = tparm(C_STR(cap), 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_up_cursor.cap = cap; F_parm_up_cursor.duration = capDuration (temp, 1); F_parm_up_cursor.length = capDurationToLength (F_parm_up_cursor.duration); @@ -339,7 +339,7 @@ void FOptiMove::set_parm_down_cursor (const char cap[]) { if ( cap ) { - const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); + const char* temp = tparm(C_STR(cap), 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_down_cursor.cap = cap; F_parm_down_cursor.duration = capDuration (temp, 1); F_parm_down_cursor.length = capDurationToLength (F_parm_down_cursor.duration); @@ -357,7 +357,7 @@ void FOptiMove::set_parm_left_cursor (const char cap[]) { if ( cap ) { - const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); + const char* temp = tparm(C_STR(cap), 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_left_cursor.cap = cap; F_parm_left_cursor.duration = capDuration (temp, 1); F_parm_left_cursor.length = capDurationToLength (F_parm_left_cursor.duration); @@ -375,7 +375,7 @@ void FOptiMove::set_parm_right_cursor (const char cap[]) { if ( cap ) { - const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); + const char* temp = tparm(C_STR(cap), 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_right_cursor.cap = cap; F_parm_right_cursor.duration = capDuration (temp, 1); F_parm_right_cursor.length = capDurationToLength (F_parm_right_cursor.duration); @@ -393,7 +393,7 @@ void FOptiMove::set_erase_chars (const char cap[]) { if ( cap ) { - const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); + const char* temp = tparm(C_STR(cap), 23, 0, 0, 0, 0, 0, 0, 0, 0); F_erase_chars.cap = cap; F_erase_chars.duration = capDuration (temp, 1); F_erase_chars.length = capDurationToLength (F_erase_chars.duration); @@ -411,7 +411,7 @@ void FOptiMove::set_repeat_char (const char cap[]) { if ( cap ) { - const char* temp = tparm(cap, ' ', 23, 0, 0, 0, 0, 0, 0, 0); + const char* temp = tparm(C_STR(cap), ' ', 23, 0, 0, 0, 0, 0, 0, 0); F_repeat_char.cap = cap; F_repeat_char.duration = capDuration (temp, 1); F_repeat_char.length = capDurationToLength (F_repeat_char.duration); @@ -686,7 +686,7 @@ inline int FOptiMove::verticalMove (char move[], int from_y, int to_y) if ( move ) { std::strncpy ( move - , tparm(F_row_address.cap, to_y, 0, 0, 0, 0, 0, 0, 0, 0) + , tparm(C_STR(F_row_address.cap), to_y, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE ); move[BUF_SIZE - 1] = '\0'; } @@ -713,7 +713,7 @@ inline void FOptiMove::downMove ( char move[], int& vtime if ( move ) { std::strncpy ( move - , tparm(F_parm_down_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) + , tparm(C_STR(F_parm_down_cursor.cap), num, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE ); move[BUF_SIZE - 1] = '\0'; } @@ -741,7 +741,7 @@ inline void FOptiMove::upMove ( char move[], int& vtime if ( move ) { std::strncpy ( move - , tparm(F_parm_up_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) + , tparm(C_STR(F_parm_up_cursor.cap), num, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE ); move[BUF_SIZE - 1] = '\0'; } @@ -767,7 +767,7 @@ inline int FOptiMove::horizontalMove (char hmove[], int from_x, int to_x) { // Move to fixed column position1 std::strncat ( hmove - , tparm(F_column_address.cap, to_x, 0, 0, 0, 0, 0, 0, 0, 0) + , tparm(C_STR(F_column_address.cap), to_x, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE - std::strlen(hmove) - 1 ); hmove[BUF_SIZE - 1] = '\0'; htime = F_column_address.duration; @@ -790,7 +790,7 @@ inline void FOptiMove::rightMove ( char hmove[], int& htime if ( F_parm_right_cursor.cap && F_parm_right_cursor.duration < htime ) { std::strncpy ( hmove - , tparm(F_parm_right_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) + , tparm(C_STR(F_parm_right_cursor.cap), num, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE - 1); hmove[BUF_SIZE - 1] = '\0'; htime = F_parm_right_cursor.duration; @@ -845,7 +845,7 @@ inline void FOptiMove::leftMove ( char hmove[], int& htime if ( F_parm_left_cursor.cap && F_parm_left_cursor.duration < htime ) { std::strncpy ( hmove - , tparm(F_parm_left_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) + , tparm(C_STR(F_parm_left_cursor.cap), num, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE - 1); hmove[BUF_SIZE - 1] = '\0'; htime = F_parm_left_cursor.duration; @@ -906,7 +906,7 @@ inline bool FOptiMove::isMethod0Faster ( int& move_time , int xnew, int ynew ) { // Test method 0: direct cursor addressing - const char* move_xy = tgoto(F_cursor_address.cap, xnew, ynew); + const char* move_xy = tgoto(C_STR(F_cursor_address.cap), xnew, ynew); if ( move_xy ) { diff --git a/src/fstring.cpp b/src/fstring.cpp index 15b61683..8c40bbc5 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -395,7 +395,7 @@ const char* FString::c_str() const if ( length > 0 ) return wc_to_c_str (string); else if ( string ) - return const_cast(""); + return const_cast(""); else return nullptr; } @@ -1244,7 +1244,7 @@ void FString::_assign (const wchar_t s[]) if ( string && std::wcscmp(string, s) == 0 ) return; // string == s - uInt new_length = uInt(std::wcslen(s)); + std::size_t new_length{std::wcslen(s)}; if ( ! string || new_length > capacity() ) { diff --git a/src/fterm.cpp b/src/fterm.cpp index 929efc58..3f3b7cb0 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -836,7 +836,7 @@ const char* FTerm::moveCursorString (int xold, int yold, int xnew, int ynew) if ( data->hasCursorOptimisation() ) return opti_move->moveCursor (xold, yold, xnew, ynew); else - return tgoto(TCAP(fc::t_cursor_address), xnew, ynew); + return tgoto(C_STR(TCAP(fc::t_cursor_address)), xnew, ynew); } //---------------------------------------------------------------------- @@ -987,9 +987,9 @@ void FTerm::setPalette (FColor index, int r, int g, int b) const int bb = (b * 1001) / 256; if ( Ic ) - color_str = tparm(Ic, index, rr, gg, bb, 0, 0, 0, 0, 0); + color_str = tparm(C_STR(Ic), index, rr, gg, bb, 0, 0, 0, 0, 0); else if ( Ip ) - color_str = tparm(Ip, index, 0, 0, 0, rr, gg, bb, 0, 0); + color_str = tparm(C_STR(Ip), index, 0, 0, 0, rr, gg, bb, 0, 0); if ( color_str ) { @@ -1099,7 +1099,7 @@ void FTerm::setEncoding (fc::encoding enc) { if ( enc == fc::VT100 || enc == fc::PC ) { - char* empty{nullptr}; + const char* empty{nullptr}; opti_move->set_tabular (empty); } else @@ -1433,14 +1433,12 @@ void FTerm::init_pc_charset() if ( data->hasUTF8Console() ) { // Select iso8859-1 + null mapping - TCAP(fc::t_enter_pc_charset_mode) = \ - C_STR(ESC "%@" ESC "(U"); + TCAP(fc::t_enter_pc_charset_mode) = ESC "%@" ESC "(U"; } else { // Select null mapping - TCAP(fc::t_enter_pc_charset_mode) = \ - C_STR(ESC "(U"); + TCAP(fc::t_enter_pc_charset_mode) = ESC "(U"; } opti_attr->set_enter_pc_charset_mode \ @@ -1454,14 +1452,12 @@ void FTerm::init_pc_charset() if ( data->hasUTF8Console() ) { // Select ascii mapping + utf8 - TCAP(fc::t_exit_pc_charset_mode) = \ - C_STR(ESC "(B" ESC "%G"); + TCAP(fc::t_exit_pc_charset_mode) = ESC "(B" ESC "%G"; } else { // Select ascii mapping - TCAP(fc::t_enter_pc_charset_mode) = \ - C_STR(ESC "(B"); + TCAP(fc::t_enter_pc_charset_mode) = ESC "(B"; } opti_attr->set_exit_pc_charset_mode \ @@ -1836,7 +1832,7 @@ void FTerm::init_tab_quirks() if ( enc == fc::VT100 || enc == fc::PC ) { - char* empty{nullptr}; + const char* empty{nullptr}; opti_move->set_tabular (empty); } } diff --git a/src/ftermcap.cpp b/src/ftermcap.cpp index 6663a849..cd3e5c3d 100644 --- a/src/ftermcap.cpp +++ b/src/ftermcap.cpp @@ -164,7 +164,7 @@ void FTermcap::termcapVariables (char*& buffer) //---------------------------------------------------------------------- void FTermcap::termcapBoleans() { - // Get termcap booleans + // Get termcap flags/booleans // Screen erased with the background color background_color_erase = tgetflag(C_STR("ut")); @@ -195,7 +195,7 @@ void FTermcap::termcapBoleans() //---------------------------------------------------------------------- void FTermcap::termcapNumerics() { - // Get termcap numeric + // Get termcap numerics // Maximum number of colors on screen max_color = std::max(max_color, tgetnum(C_STR("Co"))); @@ -222,7 +222,7 @@ void FTermcap::termcapStrings (char*& buffer) // Read termcap output strings for (std::size_t i{0}; strings[i].tname[0] != 0; i++) - strings[i].string = tgetstr(strings[i].tname, &buffer); + strings[i].string = tgetstr(C_STR(strings[i].tname), &buffer); } //---------------------------------------------------------------------- @@ -232,46 +232,46 @@ void FTermcap::termcapKeys (char*& buffer) for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++) { - fc::fkey[i].string = tgetstr(fc::fkey[i].tname, &buffer); + fc::fkey[i].string = tgetstr(C_STR(fc::fkey[i].tname), &buffer); // Fallback for rxvt with TERM=xterm if ( std::strncmp(fc::fkey[i].tname, "khx", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "7~"); // Home key + fc::fkey[i].string = CSI "7~"; // Home key if ( std::strncmp(fc::fkey[i].tname, "@7x", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "8~"); // End key + fc::fkey[i].string = CSI "8~"; // End key if ( std::strncmp(fc::fkey[i].tname, "k1x", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "11~"); // F1 + fc::fkey[i].string = CSI "11~"; // F1 if ( std::strncmp(fc::fkey[i].tname, "k2x", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "12~"); // F2 + fc::fkey[i].string = CSI "12~"; // F2 if ( std::strncmp(fc::fkey[i].tname, "k3x", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "13~"); // F3 + fc::fkey[i].string = CSI "13~"; // F3 if ( std::strncmp(fc::fkey[i].tname, "k4x", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "14~"); // F4 + fc::fkey[i].string = CSI "14~"; // F4 // Fallback for TERM=ansi if ( std::strncmp(fc::fkey[i].tname, "@7X", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "K"); // End key + fc::fkey[i].string = CSI "K"; // End key // Keypad keys if ( std::strncmp(fc::fkey[i].tname, "@8x", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OM"); // Enter key + fc::fkey[i].string = ESC "OM"; // Enter key if ( std::strncmp(fc::fkey[i].tname, "KP1", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "Oo"); // Keypad slash + fc::fkey[i].string = ESC "Oo"; // Keypad slash if ( std::strncmp(fc::fkey[i].tname, "KP2", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "Oj"); // Keypad asterisk + fc::fkey[i].string = ESC "Oj"; // Keypad asterisk if ( std::strncmp(fc::fkey[i].tname, "KP3", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "Om"); // Keypad minus sign + fc::fkey[i].string = ESC "Om"; // Keypad minus sign if ( std::strncmp(fc::fkey[i].tname, "KP4", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "Ok"); // Keypad plus sign + fc::fkey[i].string = ESC "Ok"; // Keypad plus sign } // VT100 key codes for the arrow and function keys @@ -287,40 +287,40 @@ void FTermcap::termcapKeysVt100() for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++) { if ( std::strncmp(fc::fkey[i].tname, "kux", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "A"); // Key up (standard mode) + fc::fkey[i].string = CSI "A"; // Key up (standard mode) if ( std::strncmp(fc::fkey[i].tname, "kuX", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OA"); // Key up (application mode) + fc::fkey[i].string = ESC "OA"; // Key up (application mode) if ( std::strncmp(fc::fkey[i].tname, "kdx", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "B"); // Key down (standard mode) + fc::fkey[i].string = CSI "B"; // Key down (standard mode) if ( std::strncmp(fc::fkey[i].tname, "kdX", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OB"); // Key down (application mode) + fc::fkey[i].string = ESC "OB"; // Key down (application mode) if ( std::strncmp(fc::fkey[i].tname, "krx", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "C"); // Key right (standard mode) + fc::fkey[i].string = CSI "C"; // Key right (standard mode) if ( std::strncmp(fc::fkey[i].tname, "krX", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OC"); // Key right (application mode) + fc::fkey[i].string = ESC "OC"; // Key right (application mode) if ( std::strncmp(fc::fkey[i].tname, "klx", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "D"); // Key left (standard mode) + fc::fkey[i].string = CSI "D"; // Key left (standard mode) if ( std::strncmp(fc::fkey[i].tname, "klX", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OD"); // Key left (application mode) + fc::fkey[i].string = ESC "OD"; // Key left (application mode) if ( std::strncmp(fc::fkey[i].tname, "k1X", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OP"); // PF1 (application mode) + fc::fkey[i].string = ESC "OP"; // PF1 (application mode) if ( std::strncmp(fc::fkey[i].tname, "k2X", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OQ"); // PF2 (application mode) + fc::fkey[i].string = ESC "OQ"; // PF2 (application mode) if ( std::strncmp(fc::fkey[i].tname, "k3X", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OR"); // PF3 (application mode) + fc::fkey[i].string = ESC "OR"; // PF3 (application mode) if ( std::strncmp(fc::fkey[i].tname, "k4X", 3) == 0 ) - fc::fkey[i].string = C_STR(ESC "OS"); // PF4 (application mode) + fc::fkey[i].string = ESC "OS"; // PF4 (application mode) } } diff --git a/src/ftermcapquirks.cpp b/src/ftermcapquirks.cpp index d0117a1b..52fcea0c 100644 --- a/src/ftermcapquirks.cpp +++ b/src/ftermcapquirks.cpp @@ -118,21 +118,21 @@ void FTermcapQuirks::freebsd() // FreeBSD console fixes TCAP(fc::t_acs_chars) = \ - C_STR("-\036.\0370\333" - "a\260f\370g\361" - "h\261j\331k\277" - "l\332m\300n\305" - "q\304t\303u\264" - "v\301w\302x\263" - "y\363z\362~\371"); + "-\036.\0370\333" + "a\260f\370g\361" + "h\261j\331k\277" + "l\332m\300n\305" + "q\304t\303u\264" + "v\301w\302x\263" + "y\363z\362~\371"; TCAP(fc::t_set_attributes) = \ - C_STR(CSI "0" - "%?%p1%p6%|%t;1%;" - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;"); + CSI "0" + "%?%p1%p6%|%t;1%;" + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;"; FTermcap::attr_without_color = 18; } @@ -143,23 +143,19 @@ void FTermcapQuirks::cygwin() { // Set invisible cursor for cygwin terminal if ( ! TCAP(fc::t_cursor_invisible) ) - TCAP(fc::t_cursor_invisible) = \ - C_STR(CSI "?25l"); + TCAP(fc::t_cursor_invisible) = CSI "?25l"; // Set visible cursor for cygwin terminal if ( ! TCAP(fc::t_cursor_visible) ) - TCAP(fc::t_cursor_visible) = \ - C_STR(CSI "?25h"); + TCAP(fc::t_cursor_visible) = CSI "?25h"; // Set ansi blink for cygwin terminal if ( ! TCAP(fc::t_enter_blink_mode) ) - TCAP(fc::t_enter_blink_mode) = \ - C_STR(CSI "5m"); + TCAP(fc::t_enter_blink_mode) = CSI "5m"; // Set enable alternate character set for cygwin terminal if ( ! TCAP(fc::t_enable_acs) ) - TCAP(fc::t_enable_acs) = \ - C_STR(ESC "(B" ESC ")0"); + TCAP(fc::t_enable_acs) = ESC "(B" ESC ")0"; // Set background color erase for cygwin terminal FTermcap::background_color_erase = true; @@ -177,40 +173,38 @@ void FTermcapQuirks::linux() if ( FTerm::getMaxColor() > 8 ) { TCAP(fc::t_set_a_foreground) = \ - C_STR(CSI "3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;22%;m"); + CSI "3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;22%;m"; TCAP(fc::t_set_a_background) = \ - C_STR(CSI "4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m"); + CSI "4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m"; // Avoid underline, blink, dim mode and reverse FTermcap::attr_without_color = 30; } else { - TCAP(fc::t_set_a_foreground) = \ - C_STR(CSI "3%p1%dm"); - TCAP(fc::t_set_a_background) = \ - C_STR(CSI "4%p1%dm"); + TCAP(fc::t_set_a_foreground) = CSI "3%p1%dm"; + TCAP(fc::t_set_a_background) = CSI "4%p1%dm"; // Avoid underline and dim mode FTermcap::attr_without_color = 18; } // Set select graphic rendition attributes TCAP(fc::t_set_attributes) = \ - C_STR(CSI "0" - "%?%p6%t;1%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;"); + CSI "0" + "%?%p6%t;1%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;"; - TCAP(fc::t_enter_alt_charset_mode) = C_STR(SO); - TCAP(fc::t_exit_alt_charset_mode) = C_STR(SI); - TCAP(fc::t_exit_attribute_mode) = C_STR(CSI "0m" SI); - TCAP(fc::t_exit_bold_mode) = C_STR(CSI "22m"); - TCAP(fc::t_exit_blink_mode) = C_STR(CSI "25m"); - TCAP(fc::t_exit_reverse_mode) = C_STR(CSI "27m"); + TCAP(fc::t_enter_alt_charset_mode) = SO; + TCAP(fc::t_exit_alt_charset_mode) = SI; + TCAP(fc::t_exit_attribute_mode) = CSI "0m" SI; + TCAP(fc::t_exit_bold_mode) = CSI "22m"; + TCAP(fc::t_exit_blink_mode) = CSI "25m"; + TCAP(fc::t_exit_reverse_mode) = CSI "27m"; TCAP(fc::t_exit_secure_mode) = nullptr; TCAP(fc::t_exit_protected_mode) = nullptr; TCAP(fc::t_exit_crossed_out_mode) = nullptr; - TCAP(fc::t_orig_pair) = C_STR(CSI "39;49;25m"); + TCAP(fc::t_orig_pair) = CSI "39;49;25m"; // Avoid underline and dim mode TCAP(fc::t_enter_dim_mode) = nullptr; @@ -227,21 +221,19 @@ void FTermcapQuirks::xterm() { FTermcap::can_change_color_palette = true; TCAP(fc::t_initialize_color) = \ - C_STR(OSC "4;%p1%d;rgb:" - "%p2%{255}%*%{1000}%/%2.2X/" - "%p3%{255}%*%{1000}%/%2.2X/" - "%p4%{255}%*%{1000}%/%2.2X" ESC "\\"); + OSC "4;%p1%d;rgb:" + "%p2%{255}%*%{1000}%/%2.2X/" + "%p3%{255}%*%{1000}%/%2.2X/" + "%p4%{255}%*%{1000}%/%2.2X" ESC "\\"; } // Fallback if "vi" is not found if ( ! TCAP(fc::t_cursor_invisible) ) - TCAP(fc::t_cursor_invisible) = \ - C_STR(CSI "?25l"); + TCAP(fc::t_cursor_invisible) = CSI "?25l"; // Fallback if "ve" is not found if ( ! TCAP(fc::t_cursor_normal) ) - TCAP(fc::t_cursor_normal) = \ - C_STR(CSI "?12l" CSI "?25h"); + TCAP(fc::t_cursor_normal) = CSI "?12l" CSI "?25h"; } //---------------------------------------------------------------------- @@ -252,19 +244,17 @@ void FTermcapQuirks::rxvt() if ( std::strncmp(termtype, "rxvt-16color", 12) == 0 ) { - TCAP(fc::t_enter_alt_charset_mode) = \ - C_STR(ESC "(0"); - TCAP(fc::t_exit_alt_charset_mode) = \ - C_STR(ESC "(B"); + TCAP(fc::t_enter_alt_charset_mode) = ESC "(0"; + TCAP(fc::t_exit_alt_charset_mode) = ESC "(B"; } // Set ansi foreground and background color if ( ! term_detection->isUrxvtTerminal() ) { TCAP(fc::t_set_a_foreground) = \ - C_STR(CSI "%?%p1%{8}%<%t%p1%{30}%+%e%p1%'R'%+%;%dm"); + CSI "%?%p1%{8}%<%t%p1%{30}%+%e%p1%'R'%+%;%dm"; TCAP(fc::t_set_a_background) = \ - C_STR(CSI "%?%p1%{8}%<%t%p1%'('%+%e%p1%{92}%+%;%dm"); + CSI "%?%p1%{8}%<%t%p1%'('%+%e%p1%{92}%+%;%dm"; } } @@ -276,7 +266,7 @@ void FTermcapQuirks::vte() // set exit underline for gnome terminal TCAP(fc::t_exit_underline_mode) = \ - C_STR(CSI "24m"); + CSI "24m"; } //---------------------------------------------------------------------- @@ -291,86 +281,71 @@ void FTermcapQuirks::putty() // Set ansi foreground and background color TCAP(fc::t_set_a_foreground) = \ - C_STR(CSI "%?%p1%{8}%<" - "%t3%p1%d" - "%e%p1%{16}%<" - "%t9%p1%{8}%-%d" - "%e38;5;%p1%d%;m"); + CSI "%?%p1%{8}%<" + "%t3%p1%d" + "%e%p1%{16}%<" + "%t9%p1%{8}%-%d" + "%e38;5;%p1%d%;m"; TCAP(fc::t_set_a_background) = \ - C_STR(CSI "%?%p1%{8}%<" - "%t4%p1%d" - "%e%p1%{16}%<" - "%t10%p1%{8}%-%d" - "%e48;5;%p1%d%;m"); + CSI "%?%p1%{8}%<" + "%t4%p1%d" + "%e%p1%{16}%<" + "%t10%p1%{8}%-%d" + "%e48;5;%p1%d%;m"; TCAP(fc::t_set_attributes) = \ - C_STR(CSI "0" - "%?%p1%p6%|%t;1%;" - "%?%p5%t;2%;" // since putty 0.71 - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;"); + CSI "0" + "%?%p1%p6%|%t;1%;" + "%?%p5%t;2%;" // since putty 0.71 + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;"; // PuTTY 0.71 or higher - TCAP(fc::t_enter_dim_mode) = \ - C_STR(CSI "2m"); + TCAP(fc::t_enter_dim_mode) = CSI "2m"; // PuTTY 0.71 or higher - TCAP(fc::t_exit_dim_mode) = \ - C_STR(CSI "22m"); + TCAP(fc::t_exit_dim_mode) = CSI "22m"; if ( ! TCAP(fc::t_clr_bol) ) - TCAP(fc::t_clr_bol) = \ - C_STR(CSI "1K"); + TCAP(fc::t_clr_bol) = CSI "1K"; if ( ! TCAP(fc::t_orig_pair) ) - TCAP(fc::t_orig_pair) = \ - C_STR(CSI "39;49m"); + TCAP(fc::t_orig_pair) = CSI "39;49m"; if ( ! TCAP(fc::t_orig_colors) ) - TCAP(fc::t_orig_colors) = \ - C_STR(OSC "R"); + TCAP(fc::t_orig_colors) = OSC "R"; if ( ! TCAP(fc::t_column_address) ) - TCAP(fc::t_column_address) = \ - C_STR(CSI "%i%p1%dG"); + TCAP(fc::t_column_address) = CSI "%i%p1%dG"; if ( ! TCAP(fc::t_row_address) ) - TCAP(fc::t_row_address) = \ - C_STR(CSI "%i%p1%dd"); + TCAP(fc::t_row_address) = CSI "%i%p1%dd"; if ( ! TCAP(fc::t_enable_acs) ) - TCAP(fc::t_enable_acs) = \ - C_STR(ESC "(B" ESC ")0"); + TCAP(fc::t_enable_acs) = ESC "(B" ESC ")0"; if ( ! TCAP(fc::t_enter_am_mode) ) - TCAP(fc::t_enter_am_mode) = \ - C_STR(CSI "?7h"); + TCAP(fc::t_enter_am_mode) = CSI "?7h"; if ( ! TCAP(fc::t_exit_am_mode) ) - TCAP(fc::t_exit_am_mode) = \ - C_STR(CSI "?7l"); + TCAP(fc::t_exit_am_mode) = CSI "?7l"; if ( ! TCAP(fc::t_enter_pc_charset_mode) ) - TCAP(fc::t_enter_pc_charset_mode) = \ - C_STR(CSI "11m"); + TCAP(fc::t_enter_pc_charset_mode) = CSI "11m"; if ( ! TCAP(fc::t_exit_pc_charset_mode) ) - TCAP(fc::t_exit_pc_charset_mode) = \ - C_STR(CSI "10m"); + TCAP(fc::t_exit_pc_charset_mode) = CSI "10m"; if ( ! TCAP(fc::t_keypad_xmit) ) - TCAP(fc::t_keypad_xmit) = \ - C_STR(CSI "?1h" ESC "="); + TCAP(fc::t_keypad_xmit) = CSI "?1h" ESC "="; if ( ! TCAP(fc::t_keypad_local) ) - TCAP(fc::t_keypad_local) = \ - C_STR(CSI "?1l" ESC ">"); + TCAP(fc::t_keypad_local) = CSI "?1l" ESC ">"; if ( ! TCAP(fc::t_key_mouse) ) - TCAP(fc::t_key_mouse) = \ - C_STR(CSI "M"); + TCAP(fc::t_key_mouse) = CSI "M"; } //---------------------------------------------------------------------- @@ -380,14 +355,10 @@ void FTermcapQuirks::teraterm() FTermcap::eat_nl_glitch = true; // Tera Term color settings - TCAP(fc::t_set_a_foreground) = \ - C_STR(CSI "38;5;%p1%dm"); - TCAP(fc::t_set_a_background) = \ - C_STR(CSI "48;5;%p1%dm"); - TCAP(fc::t_exit_attribute_mode) = \ - C_STR(CSI "0m" SI); - TCAP(fc::t_orig_pair) = \ - C_STR(CSI "39;49m"); + TCAP(fc::t_set_a_foreground) = CSI "38;5;%p1%dm"; + TCAP(fc::t_set_a_background) = CSI "48;5;%p1%dm"; + TCAP(fc::t_exit_attribute_mode) = CSI "0m" SI; + TCAP(fc::t_orig_pair) = CSI "39;49m"; } //---------------------------------------------------------------------- @@ -397,84 +368,77 @@ void FTermcapQuirks::sunConsole() FTermcap::eat_nl_glitch = true; // Sun Microsystems workstation console parameter cursor control - TCAP(fc::t_parm_up_cursor) = \ - C_STR(CSI "%p1%dA"); - - TCAP(fc::t_parm_down_cursor) = \ - C_STR(CSI "%p1%dB"); - - TCAP(fc::t_parm_right_cursor) = \ - C_STR(CSI "%p1%dC"); - - TCAP(fc::t_parm_left_cursor) = \ - C_STR(CSI "%p1%dD"); + TCAP(fc::t_parm_up_cursor) = CSI "%p1%dA"; + TCAP(fc::t_parm_down_cursor) = CSI "%p1%dB"; + TCAP(fc::t_parm_right_cursor) = CSI "%p1%dC"; + TCAP(fc::t_parm_left_cursor) = CSI "%p1%dD"; // Sun Microsystems workstation console keys for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++) { if ( std::strncmp(fc::fkey[i].tname, "K2", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "218z"); // center of keypad + fc::fkey[i].string = CSI "218z"; // center of keypad if ( std::strncmp(fc::fkey[i].tname, "kb", 2) == 0 ) - fc::fkey[i].string = C_STR("\b"); // backspace key + fc::fkey[i].string = "\b"; // backspace key if ( std::strncmp(fc::fkey[i].tname, "kD", 2) == 0 && std::strlen(fc::fkey[i].tname) == 2 ) - fc::fkey[i].string = C_STR("\177"); // delete-character key + fc::fkey[i].string = "\177"; // delete-character key if ( std::strncmp(fc::fkey[i].tname, "@7", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "220z"); // end key + fc::fkey[i].string = CSI "220z"; // end key if ( std::strncmp(fc::fkey[i].tname, "k;", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "233z"); // F10 function key + fc::fkey[i].string = CSI "233z"; // F10 function key if ( std::strncmp(fc::fkey[i].tname, "F1", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "234z"); // F11 function key + fc::fkey[i].string = CSI "234z"; // F11 function key if ( std::strncmp(fc::fkey[i].tname, "F2", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "235z"); // F12 function key + fc::fkey[i].string = CSI "235z"; // F12 function key if ( std::strncmp(fc::fkey[i].tname, "kh", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "214z"); // home key + fc::fkey[i].string = CSI "214z"; // home key if ( std::strncmp(fc::fkey[i].tname, "kI", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "247z"); // insert-character key + fc::fkey[i].string = CSI "247z"; // insert-character key if ( std::strncmp(fc::fkey[i].tname, "kN", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "222z"); // next-page key + fc::fkey[i].string = CSI "222z"; // next-page key if ( std::strncmp(fc::fkey[i].tname, "%7", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "194z"); // options key + fc::fkey[i].string = CSI "194z"; // options key if ( std::strncmp(fc::fkey[i].tname, "kP", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "216z"); // prev-page key + fc::fkey[i].string = CSI "216z"; // prev-page key if ( std::strncmp(fc::fkey[i].tname, "&5", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "193z"); // resume key + fc::fkey[i].string = CSI "193z"; // resume key if ( std::strncmp(fc::fkey[i].tname, "&8", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "195z"); // undo key + fc::fkey[i].string = CSI "195z"; // undo key if ( std::strncmp(fc::fkey[i].tname, "K2", 2) == 0 ) - fc::fkey[i].string = C_STR(CSI "218z"); // center of keypad + fc::fkey[i].string = CSI "218z"; // center of keypad if ( std::strncmp(fc::fkey[i].tname, "kDx", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "249z"); // keypad delete + fc::fkey[i].string = CSI "249z"; // keypad delete if ( std::strncmp(fc::fkey[i].tname, "@8x", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "250z"); // enter/send key + fc::fkey[i].string = CSI "250z"; // enter/send key if ( std::strncmp(fc::fkey[i].tname, "KP1", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "212z"); // keypad slash + fc::fkey[i].string = CSI "212z"; // keypad slash if ( std::strncmp(fc::fkey[i].tname, "KP2", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "213z"); // keypad asterisk + fc::fkey[i].string = CSI "213z"; // keypad asterisk if ( std::strncmp(fc::fkey[i].tname, "KP3", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "254z"); // keypad minus sign + fc::fkey[i].string = CSI "254z"; // keypad minus sign if ( std::strncmp(fc::fkey[i].tname, "KP4", 3) == 0 ) - fc::fkey[i].string = C_STR(CSI "253z"); // keypad plus sign + fc::fkey[i].string = CSI "253z"; // keypad plus sign } } @@ -489,18 +453,18 @@ void FTermcapQuirks::screen() if ( term_detection->isTmuxTerm() ) { TCAP(fc::t_initialize_color) = \ - C_STR(ESC "Ptmux;" ESC OSC "4;%p1%d;rgb:" - "%p2%{255}%*%{1000}%/%2.2X/" - "%p3%{255}%*%{1000}%/%2.2X/" - "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\"); + ESC "Ptmux;" ESC OSC "4;%p1%d;rgb:" + "%p2%{255}%*%{1000}%/%2.2X/" + "%p3%{255}%*%{1000}%/%2.2X/" + "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\"; } else { TCAP(fc::t_initialize_color) = \ - C_STR(ESC "P" OSC "4;%p1%d;rgb:" - "%p2%{255}%*%{1000}%/%2.2X/" - "%p3%{255}%*%{1000}%/%2.2X/" - "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\"); + ESC "P" OSC "4;%p1%d;rgb:" + "%p2%{255}%*%{1000}%/%2.2X/" + "%p3%{255}%*%{1000}%/%2.2X/" + "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\"; } } } @@ -518,39 +482,34 @@ void FTermcapQuirks::general() // Fallback if "AF" is not found if ( ! TCAP(fc::t_set_a_foreground) ) - TCAP(fc::t_set_a_foreground) = \ - C_STR(CSI "3%p1%dm"); + TCAP(fc::t_set_a_foreground) = CSI "3%p1%dm"; // Fallback if "AB" is not found if ( ! TCAP(fc::t_set_a_background) ) - TCAP(fc::t_set_a_background) = \ - C_STR(CSI "4%p1%dm"); + TCAP(fc::t_set_a_background) = CSI "4%p1%dm"; // Fallback if "Ic" is not found if ( ! TCAP(fc::t_initialize_color) ) { FTermcap::can_change_color_palette = true; TCAP(fc::t_initialize_color) = \ - C_STR(OSC "P%p1%x" - "%p2%{255}%*%{1000}%/%02x" - "%p3%{255}%*%{1000}%/%02x" - "%p4%{255}%*%{1000}%/%02x"); + OSC "P%p1%x" + "%p2%{255}%*%{1000}%/%02x" + "%p3%{255}%*%{1000}%/%02x" + "%p4%{255}%*%{1000}%/%02x"; } // Fallback if "ti" is not found if ( ! TCAP(fc::t_enter_ca_mode) ) - TCAP(fc::t_enter_ca_mode) = \ - C_STR(ESC "7" CSI "?47h"); + TCAP(fc::t_enter_ca_mode) = ESC "7" CSI "?47h"; // Fallback if "te" is not found if ( ! TCAP(fc::t_exit_ca_mode) ) - TCAP(fc::t_exit_ca_mode) = \ - C_STR(CSI "?47l" ESC "8" CSI "m"); + TCAP(fc::t_exit_ca_mode) = CSI "?47l" ESC "8" CSI "m"; // Set ansi move if "cm" is not found if ( ! TCAP(fc::t_cursor_address) ) - TCAP(fc::t_cursor_address) = \ - C_STR(CSI "%i%p1%d;%p2%dH"); + TCAP(fc::t_cursor_address) = CSI "%i%p1%d;%p2%dH"; } //---------------------------------------------------------------------- @@ -562,35 +521,16 @@ void FTermcapQuirks::ecma48() return; // Seems to be a ECMA-48 (ANSI X3.64) compatible terminal - TCAP(fc::t_enter_dbl_underline_mode) = \ - C_STR(CSI "21m"); // Exit single underline, too - - TCAP(fc::t_exit_dbl_underline_mode) = \ - C_STR(CSI "24m"); - - TCAP(fc::t_exit_bold_mode) = \ - C_STR(CSI "22m"); // Exit dim, too - - TCAP(fc::t_exit_dim_mode) = \ - C_STR(CSI "22m"); - - TCAP(fc::t_exit_underline_mode) = \ - C_STR(CSI "24m"); - - TCAP(fc::t_exit_blink_mode) = \ - C_STR(CSI "25m"); - - TCAP(fc::t_exit_reverse_mode) = \ - C_STR(CSI "27m"); - - TCAP(fc::t_exit_secure_mode) = \ - C_STR(CSI "28m"); - - TCAP(fc::t_enter_crossed_out_mode) = \ - C_STR(CSI "9m"); - - TCAP(fc::t_exit_crossed_out_mode) = \ - C_STR(CSI "29m"); + TCAP(fc::t_enter_dbl_underline_mode) = CSI "21m"; // Leaves single underlined too + TCAP(fc::t_exit_dbl_underline_mode) = CSI "24m"; + TCAP(fc::t_exit_bold_mode) = CSI "22m"; // Exit dim, too + TCAP(fc::t_exit_dim_mode) = CSI "22m"; + TCAP(fc::t_exit_underline_mode) = CSI "24m"; + TCAP(fc::t_exit_blink_mode) = CSI "25m"; + TCAP(fc::t_exit_reverse_mode) = CSI "27m"; + TCAP(fc::t_exit_secure_mode) = CSI "28m"; + TCAP(fc::t_enter_crossed_out_mode) = CSI "9m"; + TCAP(fc::t_exit_crossed_out_mode) = CSI "29m"; } } // namespace finalcut diff --git a/src/ftermdetection.cpp b/src/ftermdetection.cpp index 26122377..e84a2456 100644 --- a/src/ftermdetection.cpp +++ b/src/ftermdetection.cpp @@ -86,7 +86,7 @@ FTermDetection::FTermDetection() gnome_terminal_id = 0; // Set default ttytype file - std::strncpy (ttytypename, C_STR("/etc/ttytype"), sizeof(ttytypename)); + std::strncpy (ttytypename, "/etc/ttytype", sizeof(ttytypename)); ttytypename[sizeof(ttytypename) - 1] = '\0'; } @@ -155,7 +155,7 @@ void FTermDetection::deallocation() void FTermDetection::getSystemTermType() { // Import the untrusted environment variable TERM - const char* const& term_env = std::getenv(C_STR("TERM")); + const char* const& term_env = std::getenv("TERM"); const char* termfilename = fterm_data->getTermFileName(); if ( term_env ) @@ -177,7 +177,7 @@ void FTermDetection::getSystemTermType() } // 2nd fallback: use vt100 if not found - std::strncpy (termtype, C_STR("vt100"), sizeof(termtype)); + std::strncpy (termtype, "vt100", sizeof(termtype)); termtype[sizeof(termtype) - 1] = '\0'; } @@ -328,12 +328,12 @@ void FTermDetection::termtypeAnalysis() } // Linux console - if ( std::strncmp(termtype, C_STR("linux"), 5) == 0 - || std::strncmp(termtype, C_STR("con"), 3) == 0 ) + if ( std::strncmp(termtype, "linux", 5) == 0 + || std::strncmp(termtype, "con", 3) == 0 ) terminal_type.linux_con = true; // NetBSD workstation console - if ( std::strncmp(termtype, C_STR("wsvt25"), 6) == 0 ) + if ( std::strncmp(termtype, "wsvt25", 6) == 0 ) terminal_type.netbsd_con = true; } @@ -368,20 +368,20 @@ void FTermDetection::detectTerminal() // // Test if the terminal is a xterm - if ( std::strncmp(termtype, C_STR("xterm"), 5) == 0 - || std::strncmp(termtype, C_STR("Eterm"), 5) == 0 ) + if ( std::strncmp(termtype, "xterm", 5) == 0 + || std::strncmp(termtype, "Eterm", 5) == 0 ) { terminal_type.xterm = true; // Each xterm should be able to use at least 16 colors if ( ! new_termtype && std::strlen(termtype) == 5 ) - new_termtype = C_STR("xterm-16color"); + new_termtype = "xterm-16color"; } // set the new environment variable TERM if ( new_termtype ) { - setenv(C_STR("TERM"), new_termtype, 1); + setenv("TERM", new_termtype, 1); std::strncpy (termtype, new_termtype, sizeof(termtype)); termtype[sizeof(termtype) - 1] = '\0'; } @@ -464,29 +464,29 @@ const char* FTermDetection::termtype_256color_quirks() color256 = true; if ( ! isScreenTerm() ) - return (new_termtype = C_STR("gnome-256color")); + return (new_termtype = "gnome-256color"); } if ( ! color256 ) return new_termtype; if ( std::strncmp(termtype, "xterm", 5) == 0 ) - new_termtype = C_STR("xterm-256color"); + new_termtype = "xterm-256color"; if ( std::strncmp(termtype, "screen", 6) == 0 ) - new_termtype = C_STR("screen-256color"); + new_termtype = "screen-256color"; if ( std::strncmp(termtype, "Eterm", 5) == 0 ) - new_termtype = C_STR("Eterm-256color"); + new_termtype = "Eterm-256color"; if ( std::strncmp(termtype, "mlterm", 6) == 0 ) - new_termtype = C_STR("mlterm-256color"); + new_termtype = "mlterm-256color"; if ( std::strncmp(termtype, "rxvt", 4) != 0 && color_env.string1 && std::strncmp(color_env.string1, "rxvt-xpm", 8) == 0 ) { - new_termtype = C_STR("rxvt-256color"); + new_termtype = "rxvt-256color"; terminal_type.rxvt = true; } @@ -494,7 +494,7 @@ const char* FTermDetection::termtype_256color_quirks() || (color_env.string6 && std::strlen(color_env.string6) > 0) ) { terminal_type.kde_konsole = true; - new_termtype = C_STR("konsole-256color"); + new_termtype = "konsole-256color"; } if ( color_env.string3 && std::strlen(color_env.string3) > 0 ) @@ -522,17 +522,17 @@ const char* FTermDetection::determineMaxColor (const char current_termtype[]) color256 = true; if ( isPuttyTerminal() ) - new_termtype = C_STR("putty-256color"); + new_termtype = "putty-256color"; else - new_termtype = C_STR("xterm-256color"); + new_termtype = "xterm-256color"; } else if ( ! getXTermColorName(87).isEmpty() ) { - new_termtype = C_STR("xterm-88color"); + new_termtype = "xterm-88color"; } else if ( ! getXTermColorName(15).isEmpty() ) { - new_termtype = C_STR("xterm-16color"); + new_termtype = "xterm-16color"; } } @@ -598,9 +598,9 @@ const char* FTermDetection::parseAnswerbackMsg (const char current_termtype[]) terminal_type.putty = true; if ( color256 ) - new_termtype = C_STR("putty-256color"); + new_termtype = "putty-256color"; else - new_termtype = C_STR("putty"); + new_termtype = "putty"; } // cygwin needs a backspace to delete the '♣' char @@ -889,12 +889,12 @@ inline const char* FTermDetection::secDA_Analysis_24 (const char current_termtyp && FTermOpenBSD::isBSDConsole() ) { // NetBSD/OpenBSD workstation console - if ( std::strncmp(termtype, C_STR("wsvt25"), 6) == 0 ) + if ( std::strncmp(termtype, "wsvt25", 6) == 0 ) terminal_type.netbsd_con = true; - else if ( std::strncmp(termtype, C_STR("vt220"), 5) == 0 ) + else if ( std::strncmp(termtype, "vt220", 5) == 0 ) { terminal_type.openbsd_con = true; - new_termtype = C_STR("pccon"); + new_termtype = "pccon"; } } @@ -909,7 +909,7 @@ inline const char* FTermDetection::secDA_Analysis_32 (const char[]) // Terminal ID 32 - Tera Term terminal_type.tera_term = true; - const char* new_termtype = C_STR("teraterm"); + const char* new_termtype = "teraterm"; return new_termtype; } @@ -927,7 +927,7 @@ inline const char* FTermDetection::secDA_Analysis_67 (const char[]) // Terminal ID 67 - cygwin terminal_type.cygwin = true; - const char* new_termtype = C_STR("cygwin"); + const char* new_termtype = "cygwin"; std::fflush(stdout); return new_termtype; } @@ -939,7 +939,7 @@ inline const char* FTermDetection::secDA_Analysis_77 (const char[]) terminal_type.mintty = true; decscusr_support = true; - const char* new_termtype = C_STR("xterm-256color"); + const char* new_termtype = "xterm-256color"; std::fflush(stdout); return new_termtype; } @@ -953,9 +953,9 @@ inline const char* FTermDetection::secDA_Analysis_82() terminal_type.rxvt = true; if ( std::strncmp(termtype, "rxvt-cygwin-native", 18) == 0 ) - new_termtype = C_STR("rxvt-16color"); + new_termtype = "rxvt-16color"; else - new_termtype = C_STR("rxvt"); + new_termtype = "rxvt"; return new_termtype; } @@ -993,9 +993,9 @@ inline const char* FTermDetection::secDA_Analysis_85() if ( std::strncmp(termtype, "rxvt-", 5) != 0 ) { if ( color256 ) - new_termtype = C_STR("rxvt-256color"); + new_termtype = "rxvt-256color"; else - new_termtype = C_STR("rxvt"); + new_termtype = "rxvt"; } else new_termtype = termtype; @@ -1016,7 +1016,7 @@ inline const char* FTermDetection::secDA_Analysis_vte (const char current_termty terminal_type.gnome_terminal = true; // Each gnome-terminal should be able to use 256 colors color256 = true; - new_termtype = C_STR("gnome-256color"); + new_termtype = "gnome-256color"; gnome_terminal_id = secondary_da.terminal_id_version; // VTE 0.40.0 or higher and gnome-terminal 3.16 or higher diff --git a/src/ftermlinux.cpp b/src/ftermlinux.cpp index df579581..566cadc8 100644 --- a/src/ftermlinux.cpp +++ b/src/ftermlinux.cpp @@ -496,7 +496,7 @@ FKey FTermLinux::modifierKeyCorrection (const FKey& key_id) int FTermLinux::getFramebuffer_bpp() { int fd{-1}; - const char* fb = C_STR("/dev/fb/0"); + const char* fb = "/dev/fb/0"; struct fb_var_screeninfo fb_var{}; struct fb_fix_screeninfo fb_fix{}; @@ -508,7 +508,7 @@ int FTermLinux::getFramebuffer_bpp() if ( errno != ENOENT && errno != ENOTDIR ) return -1; - fb = C_STR("/dev/fb0"); + fb = "/dev/fb0"; if ( (fd = fsystem->open(fb, O_RDWR)) < 0 ) return -1; diff --git a/src/ftextview.cpp b/src/ftextview.cpp index b3b61084..c860b7ef 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -787,16 +787,12 @@ void FTextView::cb_vbarChange (const FWidget*, const FDataPtr) break; case FScrollbar::scrollWheelUp: - { scrollBy (0, -wheel_distance); break; - } case FScrollbar::scrollWheelDown: - { scrollBy (0, wheel_distance); break; - } } update_scrollbar = true; diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 75ff8046..750b3eff 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -843,7 +843,7 @@ void FVTerm::restoreVTerm (const FRect& box) } //---------------------------------------------------------------------- -bool FVTerm::updateVTermCursor (FTermArea* area) +bool FVTerm::updateVTermCursor (const FTermArea* area) { if ( ! area ) return false; @@ -1586,7 +1586,7 @@ void FVTerm::updateInheritBackground ( const FTermArea* area } //---------------------------------------------------------------------- -void FVTerm::updateCharacter ( FTermArea* area +void FVTerm::updateCharacter ( const FTermArea* area , const FPoint& area_pos , const FPoint& terminal_pos ) { @@ -2006,7 +2006,7 @@ void FVTerm::putAreaLine (const FChar* ac, FChar* tc, int length) //---------------------------------------------------------------------- void FVTerm::putAreaCharacter ( const FPoint& pos, FVTerm* obj - , FChar* ac + , const FChar* ac , FChar* tc ) { if ( ac->attr.bit.transparent ) // Transparent @@ -2478,7 +2478,7 @@ void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y if ( le ) appendOutputBuffer (le); else if ( RI ) - appendOutputBuffer (tparm(RI, 1, 0, 0, 0, 0, 0, 0, 0, 0)); + appendOutputBuffer (tparm(C_STR(RI), 1, 0, 0, 0, 0, 0, 0, 0, 0)); else { skipPaddingCharacter (x, y, prev_char); @@ -2518,7 +2518,7 @@ void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y if ( le ) appendOutputBuffer (le); else if ( RI ) - appendOutputBuffer (tparm(RI, 1, 0, 0, 0, 0, 0, 0, 0, 0)); + appendOutputBuffer (tparm(C_STR(RI), 1, 0, 0, 0, 0, 0, 0, 0, 0)); if ( le || RI ) { @@ -2590,7 +2590,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y && (ut || normal) ) { appendAttributes (print_char); - appendOutputBuffer (tparm(ec, whitespace, 0, 0, 0, 0, 0, 0, 0, 0)); + appendOutputBuffer (tparm(C_STR(ec), whitespace, 0, 0, 0, 0, 0, 0, 0, 0)); if ( x + whitespace - 1 < xmax || draw_trailing_ws ) setTermXY (int(x + whitespace), int(y)); @@ -2655,7 +2655,7 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) newFontChanges (print_char); charsetChanges (print_char); appendAttributes (print_char); - appendOutputBuffer (tparm(rp, print_char->ch, repetitions, 0, 0, 0, 0, 0, 0, 0)); + appendOutputBuffer (tparm(C_STR(rp), print_char->ch, repetitions, 0, 0, 0, 0, 0, 0, 0)); term_pos->x_ref() += int(repetitions); x = x + repetitions - 1; } @@ -2742,7 +2742,7 @@ bool FVTerm::printWrap (FTermArea* area) } //---------------------------------------------------------------------- -void FVTerm::printPaddingCharacter (FTermArea* area, FChar& term_char) +void FVTerm::printPaddingCharacter (FTermArea* area, const FChar& term_char) { // Creates a padding-character from the current character (term_char) // and prints it. It is a placeholder for the column after @@ -3038,7 +3038,7 @@ int FVTerm::appendLowerRight (FChar*& screen_char) if ( IC ) { - appendOutputBuffer (tparm(IC, 1, 0, 0, 0, 0, 0, 0, 0, 0)); + appendOutputBuffer (tparm(C_STR(IC), 1, 0, 0, 0, 0, 0, 0, 0, 0)); appendChar (screen_char); } else if ( im && ei ) diff --git a/src/include/final/fc.h b/src/include/final/fc.h index 4ff86a43..648b8a56 100644 --- a/src/include/final/fc.h +++ b/src/include/final/fc.h @@ -30,7 +30,7 @@ #include // Typecast to c-string -#define C_STR const_cast +#define C_STR const_cast // ASCII sequences #define ESC "\033" // Escape diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index 0231b54b..e85ae581 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -370,7 +370,7 @@ class FMouseSGR final : public FMouse // Methods void setKeyState (int); void setMoveState (const FPoint&, int); - void setPressedButtonState (const int, struct timeval*); + void setPressedButtonState (const int, const struct timeval*); void setReleasedButtonState (const int); // Data members diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index 3e2462f4..65018ad8 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -35,9 +35,6 @@ #error "Only can be included directly." #endif -// Typecast to c-string -#define C_STR const_cast - #include #if defined(__sun) && defined(__SVR4) diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h index 687527d7..8c73b1ae 100644 --- a/src/include/final/ftypes.h +++ b/src/include/final/ftypes.h @@ -137,18 +137,19 @@ struct FCharAttribute uInt8 : 8; // padding byte }; +union attribute +{ + FCharAttribute bit; + uInt8 byte[4]; +}; + typedef struct { - wchar_t ch; // character code - wchar_t encoded_char; // encoded output character - FColor fg_color; // foreground color - FColor bg_color; // background color - - union attribute - { - FCharAttribute bit; - uInt8 byte[4]; - } attr; + wchar_t ch; // Character code + wchar_t encoded_char; // Encoded output character + FColor fg_color; // Foreground color + FColor bg_color; // Background color + attribute attr; // Attributes } FChar; diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 8452ca6a..f9b35ee1 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -353,7 +353,7 @@ class FVTerm , FTermArea* ); static void removeArea (FTermArea*&); static void restoreVTerm (const FRect&); - bool updateVTermCursor (FTermArea*); + bool updateVTermCursor (const FTermArea*); static void setAreaCursor ( const FPoint& , bool, FTermArea* ); static void getArea (const FPoint&, const FTermArea*); @@ -411,7 +411,7 @@ class FVTerm static void updateInheritBackground ( const FTermArea* , const FPoint& , const FPoint& ); - static void updateCharacter ( FTermArea* + static void updateCharacter ( const FTermArea* , const FPoint& , const FPoint& ); static bool updateVTermCharacter ( FTermArea* @@ -433,7 +433,7 @@ class FVTerm void finish(); static void putAreaLine (const FChar*, FChar*, int); static void putAreaCharacter ( const FPoint&, FVTerm* - , FChar*, FChar* ); + , const FChar*, FChar* ); static void getAreaCharacter ( const FPoint&, const FTermArea* , FChar*& ); bool clearTerm (int = ' '); @@ -456,7 +456,7 @@ class FVTerm bool isFullWidthPaddingChar (const FChar* const&); static void cursorWrap(); bool printWrap (FTermArea*); - void printPaddingCharacter (FTermArea*, FChar&); + void printPaddingCharacter (FTermArea*, const FChar&); void updateTerminalLine (uInt); bool updateTerminalCursor(); bool isInsideTerminal (const FPoint&); diff --git a/test/fkeyboard-test.cpp b/test/fkeyboard-test.cpp index bc6d196c..e868e31c 100644 --- a/test/fkeyboard-test.cpp +++ b/test/fkeyboard-test.cpp @@ -44,181 +44,181 @@ FKeyMap; FKeyMap fkey[] = { - { finalcut::fc::Fkey_backspace , C_STR("\177") , "kb" }, // backspace key - { finalcut::fc::Fkey_catab , 0 , "ka" }, // clear-all-tabs key - { finalcut::fc::Fkey_clear , 0 , "kC" }, // clear-screen or erase key - { finalcut::fc::Fkey_ctab , C_STR(CSI "3~") , "kt" }, // clear-tab key - { finalcut::fc::Fkey_dc , 0 , "kD" }, // delete-character key - { finalcut::fc::Fkey_dc , 0 , "kDx" }, // delete-character key - { finalcut::fc::Fkey_dl , 0 , "kL" }, // delete-line key - { finalcut::fc::Fkey_down , C_STR(ESC "OB") , "kd" }, // down-arrow key - { finalcut::fc::Fkey_down , C_STR(CSI "B") , "kdx"}, // down-arrow key - { finalcut::fc::Fkey_down , C_STR(ESC "OB") , "kd" }, // down-arrow key - { finalcut::fc::Fkey_eic , 0 , "kM" }, // sent by rmir or smir in insert mode - { finalcut::fc::Fkey_eol , 0 , "kE" }, // clear-to-end-of-line key - { finalcut::fc::Fkey_eos , 0 , "kS" }, // clear-to-end-of-screen key - { finalcut::fc::Fkey_f0 , 0 , "k0" }, // F0 function key - { finalcut::fc::Fkey_f1 , C_STR(ESC "OP") , "k1" }, // F1 function key - { finalcut::fc::Fkey_f1 , C_STR(CSI "11~") , "k1x"}, // F1 function key - { finalcut::fc::Fkey_f1 , C_STR(ESC "OP") , "k1X"}, // F1 function key - { finalcut::fc::Fkey_f2 , C_STR(ESC "OQ") , "k2" }, // F2 function key - { finalcut::fc::Fkey_f2 , C_STR(CSI "12~") , "k2x"}, // F2 function key - { finalcut::fc::Fkey_f2 , C_STR(CSI "OQ") , "k2X"}, // F2 function key - { finalcut::fc::Fkey_f3 , C_STR(ESC "OR") , "k3" }, // F3 function key - { finalcut::fc::Fkey_f3 , C_STR(CSI "13~") , "k3x"}, // F3 function key - { finalcut::fc::Fkey_f3 , C_STR(ESC "OR") , "k3X"}, // F3 function key - { finalcut::fc::Fkey_f4 , C_STR(ESC "OS") , "k4" }, // F4 function key - { finalcut::fc::Fkey_f4 , C_STR(CSI "14~") , "k4x"}, // F4 function key - { finalcut::fc::Fkey_f4 , C_STR(ESC "OS") , "k4X"}, // F4 function key - { finalcut::fc::Fkey_f5 , C_STR(CSI "15~") , "k5" }, // F5 function key - { finalcut::fc::Fkey_f6 , C_STR(CSI "17~") , "k6" }, // F6 function key - { finalcut::fc::Fkey_f7 , C_STR(CSI "18~") , "k7" }, // F7 function key - { finalcut::fc::Fkey_f8 , C_STR(CSI "19~") , "k8" }, // F8 fucntion key - { finalcut::fc::Fkey_f9 , C_STR(CSI "20~") , "k9" }, // F9 function key - { finalcut::fc::Fkey_f10 , C_STR(CSI "21~") , "k;" }, // F10 function key - { finalcut::fc::Fkey_home , C_STR(ESC "OH") , "kh" }, // home key - { finalcut::fc::Fkey_home , C_STR(CSI "7~") , "khx"}, // home key - { finalcut::fc::Fkey_ic , C_STR(CSI "2~") , "kI" }, // insert-character key - { finalcut::fc::Fkey_il , 0 , "kA" }, // insert-line key - { finalcut::fc::Fkey_left , C_STR(ESC "OD") , "kl" }, // left-arrow key - { finalcut::fc::Fkey_left , C_STR(CSI "D") , "klx"}, // left-arrow key - { finalcut::fc::Fkey_left , C_STR(ESC "OD") , "kl" }, // left-arrow key - { finalcut::fc::Fkey_ll , 0 , "kH" }, // last-line key - { finalcut::fc::Fkey_npage , C_STR(CSI "6~") , "kN" }, // next-page key - { finalcut::fc::Fkey_ppage , C_STR(CSI "5~") , "kP" }, // prev-page key - { finalcut::fc::Fkey_right , C_STR(ESC "OC") , "kr" }, // right-arrow key - { finalcut::fc::Fkey_right , C_STR(CSI "C") , "krx"}, // right-arrow key - { finalcut::fc::Fkey_right , C_STR(ESC "OC") , "kr" }, // right-arrow key - { finalcut::fc::Fkey_sf , C_STR(CSI "1;2B") , "kF" }, // scroll-forward key (shift-up) - { finalcut::fc::Fkey_sr , C_STR(CSI "1;2A") , "kR" }, // scroll-backward key (shift-down) - { finalcut::fc::Fkey_stab , 0 , "kT" }, // set-tab key - { finalcut::fc::Fkey_up , C_STR(ESC "OA") , "ku" }, // up-arrow key - { finalcut::fc::Fkey_up , C_STR(CSI "A") , "kux"}, // up-arrow key - { finalcut::fc::Fkey_up , C_STR(ESC "OA") , "ku" }, // up-arrow key - { finalcut::fc::Fkey_a1 , 0 , "K1" }, // upper left of keypad - { finalcut::fc::Fkey_a3 , 0 , "K3" }, // upper right of keypad - { finalcut::fc::Fkey_b2 , C_STR(CSI "E") , "K2" }, // center of keypad - { finalcut::fc::Fkey_c1 , 0 , "K4" }, // lower left of keypad - { finalcut::fc::Fkey_c3 , 0 , "K5" }, // lower right of keypad - { finalcut::fc::Fkey_btab , C_STR(CSI "Z") , "kB" }, // back-tab key - { finalcut::fc::Fkey_beg , 0 , "@1" }, // begin key - { finalcut::fc::Fkey_cancel , 0 , "@2" }, // cancel key - { finalcut::fc::Fkey_close , 0 , "@3" }, // close key - { finalcut::fc::Fkey_command , 0 , "@4" }, // command key - { finalcut::fc::Fkey_copy , 0 , "@5" }, // copy key - { finalcut::fc::Fkey_create , 0 , "@6" }, // create key - { finalcut::fc::Fkey_end , C_STR(ESC "OF") , "@7" }, // end key - { finalcut::fc::Fkey_end , C_STR(CSI "8~") , "@7x"}, // end key - { finalcut::fc::Fkey_end , C_STR(CSI "K") , "@7X"}, // end key - { finalcut::fc::Fkey_enter , 0 , "@8" }, // enter/send key - { finalcut::fc::Fkey_enter , C_STR(ESC "OM") , "@8x"}, // enter/send key - { finalcut::fc::Fkey_exit , 0 , "@9" }, // exit key - { finalcut::fc::Fkey_find , C_STR(CSI "1~") , "@0" }, // find key - { finalcut::fc::Fkey_slash , C_STR(ESC "Oo") , "KP1"}, // keypad slash - { finalcut::fc::Fkey_asterisk , C_STR(ESC "Oj") , "KP2"}, // keypad asterisk - { finalcut::fc::Fkey_minus_sign, C_STR(ESC "Om") , "KP3"}, // keypad minus sign - { finalcut::fc::Fkey_plus_sign , C_STR(ESC "Ok") , "KP4"}, // keypad plus sign - { finalcut::fc::Fkey_help , 0 , "%1" }, // help key - { finalcut::fc::Fkey_mark , 0 , "%2" }, // mark key - { finalcut::fc::Fkey_message , 0 , "%3" }, // message key - { finalcut::fc::Fkey_move , 0 , "%4" }, // move key - { finalcut::fc::Fkey_next , 0 , "%5" }, // next key - { finalcut::fc::Fkey_open , 0 , "%6" }, // open key - { finalcut::fc::Fkey_options , 0 , "%7" }, // options key - { finalcut::fc::Fkey_previous , 0 , "%8" }, // previous key - { finalcut::fc::Fkey_print , 0 , "%9" }, // print key - { finalcut::fc::Fkey_redo , 0 , "%0" }, // redo key - { finalcut::fc::Fkey_reference , 0 , "&1" }, // reference key - { finalcut::fc::Fkey_refresh , 0 , "&2" }, // refresh key - { finalcut::fc::Fkey_replace , 0 , "&3" }, // replace key - { finalcut::fc::Fkey_restart , 0 , "&4" }, // restart key - { finalcut::fc::Fkey_resume , 0 , "&5" }, // resume key - { finalcut::fc::Fkey_save , 0 , "&6" }, // save key - { finalcut::fc::Fkey_suspend , 0 , "&7" }, // suspend key - { finalcut::fc::Fkey_undo , 0 , "&8" }, // undo key - { finalcut::fc::Fkey_sbeg , 0 , "&9" }, // shifted begin key - { finalcut::fc::Fkey_scancel , 0 , "&0" }, // shifted cancel key - { finalcut::fc::Fkey_scommand , 0 , "*1" }, // shifted command key - { finalcut::fc::Fkey_scopy , 0 , "*2" }, // shifted copy key - { finalcut::fc::Fkey_screate , 0 , "*3" }, // shifted create key - { finalcut::fc::Fkey_sdc , C_STR(CSI "3;2~") , "*4" }, // shifted delete-character key - { finalcut::fc::Fkey_sdl , 0 , "*5" }, // shifted delete-line key - { finalcut::fc::Fkey_select , C_STR(CSI "4~") , "*6" }, // select key - { finalcut::fc::Fkey_send , C_STR(CSI "1;2F") , "*7" }, // shifted end key - { finalcut::fc::Fkey_seol , 0 , "*8" }, // shifted clear-to-end-of-line key - { finalcut::fc::Fkey_sexit , 0 , "*9" }, // shifted exit key - { finalcut::fc::Fkey_sfind , 0 , "*0" }, // shifted find key - { finalcut::fc::Fkey_shelp , 0 , "#1" }, // shifted help key - { finalcut::fc::Fkey_shome , C_STR(CSI "1;2H") , "#2" }, // shifted home key - { finalcut::fc::Fkey_sic , C_STR(CSI "2;2~") , "#3" }, // shifted insert-character key - { finalcut::fc::Fkey_sleft , C_STR(CSI "1;2D") , "#4" }, // shifted left-arrow key - { finalcut::fc::Fkey_smessage , 0 , "%a" }, // shifted message key - { finalcut::fc::Fkey_smove , 0 , "%b" }, // shifted move key - { finalcut::fc::Fkey_snext , C_STR(CSI "6;2~") , "%c" }, // shifted next key - { finalcut::fc::Fkey_soptions , 0 , "%d" }, // shifted options key - { finalcut::fc::Fkey_sprevious , C_STR(CSI "5;2~") , "%e" }, // shifted previous key - { finalcut::fc::Fkey_sprint , 0 , "%f" }, // shifted print key - { finalcut::fc::Fkey_sredo , 0 , "%g" }, // shifted redo key - { finalcut::fc::Fkey_sreplace , 0 , "%h" }, // shifted replace key - { finalcut::fc::Fkey_sright , C_STR(CSI "1;2C") , "%i" }, // shifted right-arrow key - { finalcut::fc::Fkey_srsume , 0 , "%j" }, // shifted resume key - { finalcut::fc::Fkey_ssave , 0 , "!1" }, // shifted save key - { finalcut::fc::Fkey_ssuspend , 0 , "!2" }, // shifted suspend key - { finalcut::fc::Fkey_sundo , 0 , "!3" }, // shifted undo key - { finalcut::fc::Fkey_f11 , C_STR(CSI "23~") , "F1" }, // F11 function key - { finalcut::fc::Fkey_f12 , C_STR(CSI "24~") , "F2" }, // F12 function key - { finalcut::fc::Fkey_f13 , C_STR(ESC "O1;2P"), "F3" }, // F13 function key - { finalcut::fc::Fkey_f14 , C_STR(ESC "O1;2Q"), "F4" }, // F14 function key - { finalcut::fc::Fkey_f15 , C_STR(ESC "O1;2R"), "F5" }, // F15 function key - { finalcut::fc::Fkey_f16 , C_STR(ESC "O1;2S"), "F6" }, // F16 function key - { finalcut::fc::Fkey_f17 , C_STR(CSI "15;2~"), "F7" }, // F17 function key - { finalcut::fc::Fkey_f18 , C_STR(CSI "17;2~"), "F8" }, // F18 function key - { finalcut::fc::Fkey_f19 , C_STR(CSI "18;2~"), "F9" }, // F19 function key - { finalcut::fc::Fkey_f20 , C_STR(CSI "19;2~"), "FA" }, // F20 function key - { finalcut::fc::Fkey_f21 , C_STR(CSI "20;2~"), "FB" }, // F21 function key - { finalcut::fc::Fkey_f22 , C_STR(CSI "21;2~"), "FC" }, // F22 function key - { finalcut::fc::Fkey_f23 , C_STR(CSI "23;2~"), "FD" }, // F23 function key - { finalcut::fc::Fkey_f24 , C_STR(CSI "24;2~"), "FE" }, // F24 function key - { finalcut::fc::Fkey_f25 , C_STR(ESC "O1;5P"), "FF" }, // F25 function key - { finalcut::fc::Fkey_f26 , C_STR(ESC "O1;5Q"), "FG" }, // F26 function key - { finalcut::fc::Fkey_f27 , C_STR(ESC "O1;5R"), "FH" }, // F27 function key - { finalcut::fc::Fkey_f28 , C_STR(ESC "O1;5S"), "FI" }, // F28 function key - { finalcut::fc::Fkey_f29 , C_STR(CSI "15;5~"), "FJ" }, // F29 function key - { finalcut::fc::Fkey_f30 , C_STR(CSI "17;5~"), "FK" }, // F30 function key - { finalcut::fc::Fkey_f31 , C_STR(CSI "18;5~"), "FL" }, // F31 function key - { finalcut::fc::Fkey_f32 , C_STR(CSI "19;5~"), "FM" }, // F32 function key - { finalcut::fc::Fkey_f33 , C_STR(CSI "20;5~"), "FN" }, // F33 function key - { finalcut::fc::Fkey_f34 , C_STR(CSI "21;5~"), "FO" }, // F34 function key - { finalcut::fc::Fkey_f35 , C_STR(CSI "23;5~"), "FP" }, // F35 function key - { finalcut::fc::Fkey_f36 , C_STR(CSI "24;5~"), "FQ" }, // F36 function key - { finalcut::fc::Fkey_f37 , C_STR(ESC "O1;6P"), "FR" }, // F37 function key - { finalcut::fc::Fkey_f38 , C_STR(ESC "O1;6Q"), "FS" }, // F38 function key - { finalcut::fc::Fkey_f39 , C_STR(ESC "O1;6R"), "FT" }, // F39 function key - { finalcut::fc::Fkey_f40 , C_STR(ESC "O1;6S"), "FU" }, // F40 function key - { finalcut::fc::Fkey_f41 , C_STR(CSI "15;6~"), "FV" }, // F41 function key - { finalcut::fc::Fkey_f42 , C_STR(CSI "17;6~"), "FW" }, // F42 function key - { finalcut::fc::Fkey_f43 , C_STR(CSI "18;6~"), "FX" }, // F43 function key - { finalcut::fc::Fkey_f44 , C_STR(CSI "19;6~"), "FY" }, // F44 function key - { finalcut::fc::Fkey_f45 , C_STR(CSI "20;6~"), "FZ" }, // F45 function key - { finalcut::fc::Fkey_f46 , C_STR(CSI "21;6~"), "Fa" }, // F46 function key - { finalcut::fc::Fkey_f47 , C_STR(CSI "23;6~"), "Fb" }, // F47 function key - { finalcut::fc::Fkey_f48 , C_STR(CSI "24;6~"), "Fc" }, // F48 function key - { finalcut::fc::Fkey_f49 , C_STR(ESC "O1;3P"), "Fd" }, // F49 function key - { finalcut::fc::Fkey_f50 , C_STR(ESC "O1;3Q"), "Fe" }, // F50 function key - { finalcut::fc::Fkey_f51 , C_STR(ESC "O1;3R"), "Ff" }, // F51 function key - { finalcut::fc::Fkey_f52 , C_STR(ESC "O1;3S"), "Fg" }, // F52 function key - { finalcut::fc::Fkey_f53 , C_STR(CSI "15;3~"), "Fh" }, // F53 function key - { finalcut::fc::Fkey_f54 , C_STR(CSI "17;3~"), "Fi" }, // F54 function key - { finalcut::fc::Fkey_f55 , C_STR(CSI "18;3~"), "Fj" }, // F55 function key - { finalcut::fc::Fkey_f56 , C_STR(CSI "19;3~"), "Fk" }, // F56 function key - { finalcut::fc::Fkey_f57 , C_STR(CSI "20;3~"), "Fl" }, // F57 function key - { finalcut::fc::Fkey_f58 , C_STR(CSI "21;3~"), "Fm" }, // F58 function key - { finalcut::fc::Fkey_f59 , C_STR(CSI "23;3~"), "Fn" }, // F59 function key - { finalcut::fc::Fkey_f60 , C_STR(CSI "24;3~"), "Fo" }, // F60 function key - { finalcut::fc::Fkey_f61 , C_STR(ESC "O1;4P"), "Fp" }, // F61 function key - { finalcut::fc::Fkey_f62 , C_STR(ESC "O1;4Q"), "Fq" }, // F62 function key - { finalcut::fc::Fkey_f63 , C_STR(ESC "O1;4R"), "Fr" }, // F63 function key - { 0 , 0 , "\0" } + { finalcut::fc::Fkey_backspace , "\177" , "kb" }, // backspace key + { finalcut::fc::Fkey_catab , 0 , "ka" }, // clear-all-tabs key + { finalcut::fc::Fkey_clear , 0 , "kC" }, // clear-screen or erase key + { finalcut::fc::Fkey_ctab , CSI "3~" , "kt" }, // clear-tab key + { finalcut::fc::Fkey_dc , 0 , "kD" }, // delete-character key + { finalcut::fc::Fkey_dc , 0 , "kDx" }, // delete-character key + { finalcut::fc::Fkey_dl , 0 , "kL" }, // delete-line key + { finalcut::fc::Fkey_down , ESC "OB" , "kd" }, // down-arrow key + { finalcut::fc::Fkey_down , CSI "B" , "kdx"}, // down-arrow key + { finalcut::fc::Fkey_down , ESC "OB" , "kd" }, // down-arrow key + { finalcut::fc::Fkey_eic , 0 , "kM" }, // sent by rmir or smir in insert mode + { finalcut::fc::Fkey_eol , 0 , "kE" }, // clear-to-end-of-line key + { finalcut::fc::Fkey_eos , 0 , "kS" }, // clear-to-end-of-screen key + { finalcut::fc::Fkey_f0 , 0 , "k0" }, // F0 function key + { finalcut::fc::Fkey_f1 , ESC "OP" , "k1" }, // F1 function key + { finalcut::fc::Fkey_f1 , CSI "11~" , "k1x"}, // F1 function key + { finalcut::fc::Fkey_f1 , ESC "OP" , "k1X"}, // F1 function key + { finalcut::fc::Fkey_f2 , ESC "OQ" , "k2" }, // F2 function key + { finalcut::fc::Fkey_f2 , CSI "12~" , "k2x"}, // F2 function key + { finalcut::fc::Fkey_f2 , CSI "OQ" , "k2X"}, // F2 function key + { finalcut::fc::Fkey_f3 , ESC "OR" , "k3" }, // F3 function key + { finalcut::fc::Fkey_f3 , CSI "13~" , "k3x"}, // F3 function key + { finalcut::fc::Fkey_f3 , ESC "OR" , "k3X"}, // F3 function key + { finalcut::fc::Fkey_f4 , ESC "OS" , "k4" }, // F4 function key + { finalcut::fc::Fkey_f4 , CSI "14~" , "k4x"}, // F4 function key + { finalcut::fc::Fkey_f4 , ESC "OS" , "k4X"}, // F4 function key + { finalcut::fc::Fkey_f5 , CSI "15~" , "k5" }, // F5 function key + { finalcut::fc::Fkey_f6 , CSI "17~" , "k6" }, // F6 function key + { finalcut::fc::Fkey_f7 , CSI "18~" , "k7" }, // F7 function key + { finalcut::fc::Fkey_f8 , CSI "19~" , "k8" }, // F8 fucntion key + { finalcut::fc::Fkey_f9 , CSI "20~" , "k9" }, // F9 function key + { finalcut::fc::Fkey_f10 , CSI "21~" , "k;" }, // F10 function key + { finalcut::fc::Fkey_home , ESC "OH" , "kh" }, // home key + { finalcut::fc::Fkey_home , CSI "7~" , "khx"}, // home key + { finalcut::fc::Fkey_ic , CSI "2~" , "kI" }, // insert-character key + { finalcut::fc::Fkey_il , 0 , "kA" }, // insert-line key + { finalcut::fc::Fkey_left , ESC "OD" , "kl" }, // left-arrow key + { finalcut::fc::Fkey_left , CSI "D" , "klx"}, // left-arrow key + { finalcut::fc::Fkey_left , ESC "OD" , "kl" }, // left-arrow key + { finalcut::fc::Fkey_ll , 0 , "kH" }, // last-line key + { finalcut::fc::Fkey_npage , CSI "6~" , "kN" }, // next-page key + { finalcut::fc::Fkey_ppage , CSI "5~" , "kP" }, // prev-page key + { finalcut::fc::Fkey_right , ESC "OC" , "kr" }, // right-arrow key + { finalcut::fc::Fkey_right , CSI "C" , "krx"}, // right-arrow key + { finalcut::fc::Fkey_right , ESC "OC" , "kr" }, // right-arrow key + { finalcut::fc::Fkey_sf , CSI "1;2B" , "kF" }, // scroll-forward key (shift-up) + { finalcut::fc::Fkey_sr , CSI "1;2A" , "kR" }, // scroll-backward key (shift-down) + { finalcut::fc::Fkey_stab , 0 , "kT" }, // set-tab key + { finalcut::fc::Fkey_up , ESC "OA" , "ku" }, // up-arrow key + { finalcut::fc::Fkey_up , CSI "A" , "kux"}, // up-arrow key + { finalcut::fc::Fkey_up , ESC "OA" , "ku" }, // up-arrow key + { finalcut::fc::Fkey_a1 , 0 , "K1" }, // upper left of keypad + { finalcut::fc::Fkey_a3 , 0 , "K3" }, // upper right of keypad + { finalcut::fc::Fkey_b2 , CSI "E" , "K2" }, // center of keypad + { finalcut::fc::Fkey_c1 , 0 , "K4" }, // lower left of keypad + { finalcut::fc::Fkey_c3 , 0 , "K5" }, // lower right of keypad + { finalcut::fc::Fkey_btab , CSI "Z" , "kB" }, // back-tab key + { finalcut::fc::Fkey_beg , 0 , "@1" }, // begin key + { finalcut::fc::Fkey_cancel , 0 , "@2" }, // cancel key + { finalcut::fc::Fkey_close , 0 , "@3" }, // close key + { finalcut::fc::Fkey_command , 0 , "@4" }, // command key + { finalcut::fc::Fkey_copy , 0 , "@5" }, // copy key + { finalcut::fc::Fkey_create , 0 , "@6" }, // create key + { finalcut::fc::Fkey_end , ESC "OF" , "@7" }, // end key + { finalcut::fc::Fkey_end , CSI "8~" , "@7x"}, // end key + { finalcut::fc::Fkey_end , CSI "K" , "@7X"}, // end key + { finalcut::fc::Fkey_enter , 0 , "@8" }, // enter/send key + { finalcut::fc::Fkey_enter , ESC "OM" , "@8x"}, // enter/send key + { finalcut::fc::Fkey_exit , 0 , "@9" }, // exit key + { finalcut::fc::Fkey_find , CSI "1~" , "@0" }, // find key + { finalcut::fc::Fkey_slash , ESC "Oo" , "KP1"}, // keypad slash + { finalcut::fc::Fkey_asterisk , ESC "Oj" , "KP2"}, // keypad asterisk + { finalcut::fc::Fkey_minus_sign, ESC "Om" , "KP3"}, // keypad minus sign + { finalcut::fc::Fkey_plus_sign , ESC "Ok" , "KP4"}, // keypad plus sign + { finalcut::fc::Fkey_help , 0 , "%1" }, // help key + { finalcut::fc::Fkey_mark , 0 , "%2" }, // mark key + { finalcut::fc::Fkey_message , 0 , "%3" }, // message key + { finalcut::fc::Fkey_move , 0 , "%4" }, // move key + { finalcut::fc::Fkey_next , 0 , "%5" }, // next key + { finalcut::fc::Fkey_open , 0 , "%6" }, // open key + { finalcut::fc::Fkey_options , 0 , "%7" }, // options key + { finalcut::fc::Fkey_previous , 0 , "%8" }, // previous key + { finalcut::fc::Fkey_print , 0 , "%9" }, // print key + { finalcut::fc::Fkey_redo , 0 , "%0" }, // redo key + { finalcut::fc::Fkey_reference , 0 , "&1" }, // reference key + { finalcut::fc::Fkey_refresh , 0 , "&2" }, // refresh key + { finalcut::fc::Fkey_replace , 0 , "&3" }, // replace key + { finalcut::fc::Fkey_restart , 0 , "&4" }, // restart key + { finalcut::fc::Fkey_resume , 0 , "&5" }, // resume key + { finalcut::fc::Fkey_save , 0 , "&6" }, // save key + { finalcut::fc::Fkey_suspend , 0 , "&7" }, // suspend key + { finalcut::fc::Fkey_undo , 0 , "&8" }, // undo key + { finalcut::fc::Fkey_sbeg , 0 , "&9" }, // shifted begin key + { finalcut::fc::Fkey_scancel , 0 , "&0" }, // shifted cancel key + { finalcut::fc::Fkey_scommand , 0 , "*1" }, // shifted command key + { finalcut::fc::Fkey_scopy , 0 , "*2" }, // shifted copy key + { finalcut::fc::Fkey_screate , 0 , "*3" }, // shifted create key + { finalcut::fc::Fkey_sdc , CSI "3;2~" , "*4" }, // shifted delete-character key + { finalcut::fc::Fkey_sdl , 0 , "*5" }, // shifted delete-line key + { finalcut::fc::Fkey_select , CSI "4~" , "*6" }, // select key + { finalcut::fc::Fkey_send , CSI "1;2F" , "*7" }, // shifted end key + { finalcut::fc::Fkey_seol , 0 , "*8" }, // shifted clear-to-end-of-line key + { finalcut::fc::Fkey_sexit , 0 , "*9" }, // shifted exit key + { finalcut::fc::Fkey_sfind , 0 , "*0" }, // shifted find key + { finalcut::fc::Fkey_shelp , 0 , "#1" }, // shifted help key + { finalcut::fc::Fkey_shome , CSI "1;2H" , "#2" }, // shifted home key + { finalcut::fc::Fkey_sic , CSI "2;2~" , "#3" }, // shifted insert-character key + { finalcut::fc::Fkey_sleft , CSI "1;2D" , "#4" }, // shifted left-arrow key + { finalcut::fc::Fkey_smessage , 0 , "%a" }, // shifted message key + { finalcut::fc::Fkey_smove , 0 , "%b" }, // shifted move key + { finalcut::fc::Fkey_snext , CSI "6;2~" , "%c" }, // shifted next key + { finalcut::fc::Fkey_soptions , 0 , "%d" }, // shifted options key + { finalcut::fc::Fkey_sprevious , CSI "5;2~" , "%e" }, // shifted previous key + { finalcut::fc::Fkey_sprint , 0 , "%f" }, // shifted print key + { finalcut::fc::Fkey_sredo , 0 , "%g" }, // shifted redo key + { finalcut::fc::Fkey_sreplace , 0 , "%h" }, // shifted replace key + { finalcut::fc::Fkey_sright , CSI "1;2C" , "%i" }, // shifted right-arrow key + { finalcut::fc::Fkey_srsume , 0 , "%j" }, // shifted resume key + { finalcut::fc::Fkey_ssave , 0 , "!1" }, // shifted save key + { finalcut::fc::Fkey_ssuspend , 0 , "!2" }, // shifted suspend key + { finalcut::fc::Fkey_sundo , 0 , "!3" }, // shifted undo key + { finalcut::fc::Fkey_f11 , CSI "23~" , "F1" }, // F11 function key + { finalcut::fc::Fkey_f12 , CSI "24~" , "F2" }, // F12 function key + { finalcut::fc::Fkey_f13 , ESC "O1;2P", "F3" }, // F13 function key + { finalcut::fc::Fkey_f14 , ESC "O1;2Q", "F4" }, // F14 function key + { finalcut::fc::Fkey_f15 , ESC "O1;2R", "F5" }, // F15 function key + { finalcut::fc::Fkey_f16 , ESC "O1;2S", "F6" }, // F16 function key + { finalcut::fc::Fkey_f17 , CSI "15;2~", "F7" }, // F17 function key + { finalcut::fc::Fkey_f18 , CSI "17;2~", "F8" }, // F18 function key + { finalcut::fc::Fkey_f19 , CSI "18;2~", "F9" }, // F19 function key + { finalcut::fc::Fkey_f20 , CSI "19;2~", "FA" }, // F20 function key + { finalcut::fc::Fkey_f21 , CSI "20;2~", "FB" }, // F21 function key + { finalcut::fc::Fkey_f22 , CSI "21;2~", "FC" }, // F22 function key + { finalcut::fc::Fkey_f23 , CSI "23;2~", "FD" }, // F23 function key + { finalcut::fc::Fkey_f24 , CSI "24;2~", "FE" }, // F24 function key + { finalcut::fc::Fkey_f25 , ESC "O1;5P", "FF" }, // F25 function key + { finalcut::fc::Fkey_f26 , ESC "O1;5Q", "FG" }, // F26 function key + { finalcut::fc::Fkey_f27 , ESC "O1;5R", "FH" }, // F27 function key + { finalcut::fc::Fkey_f28 , ESC "O1;5S", "FI" }, // F28 function key + { finalcut::fc::Fkey_f29 , CSI "15;5~", "FJ" }, // F29 function key + { finalcut::fc::Fkey_f30 , CSI "17;5~", "FK" }, // F30 function key + { finalcut::fc::Fkey_f31 , CSI "18;5~", "FL" }, // F31 function key + { finalcut::fc::Fkey_f32 , CSI "19;5~", "FM" }, // F32 function key + { finalcut::fc::Fkey_f33 , CSI "20;5~", "FN" }, // F33 function key + { finalcut::fc::Fkey_f34 , CSI "21;5~", "FO" }, // F34 function key + { finalcut::fc::Fkey_f35 , CSI "23;5~", "FP" }, // F35 function key + { finalcut::fc::Fkey_f36 , CSI "24;5~", "FQ" }, // F36 function key + { finalcut::fc::Fkey_f37 , ESC "O1;6P", "FR" }, // F37 function key + { finalcut::fc::Fkey_f38 , ESC "O1;6Q", "FS" }, // F38 function key + { finalcut::fc::Fkey_f39 , ESC "O1;6R", "FT" }, // F39 function key + { finalcut::fc::Fkey_f40 , ESC "O1;6S", "FU" }, // F40 function key + { finalcut::fc::Fkey_f41 , CSI "15;6~", "FV" }, // F41 function key + { finalcut::fc::Fkey_f42 , CSI "17;6~", "FW" }, // F42 function key + { finalcut::fc::Fkey_f43 , CSI "18;6~", "FX" }, // F43 function key + { finalcut::fc::Fkey_f44 , CSI "19;6~", "FY" }, // F44 function key + { finalcut::fc::Fkey_f45 , CSI "20;6~", "FZ" }, // F45 function key + { finalcut::fc::Fkey_f46 , CSI "21;6~", "Fa" }, // F46 function key + { finalcut::fc::Fkey_f47 , CSI "23;6~", "Fb" }, // F47 function key + { finalcut::fc::Fkey_f48 , CSI "24;6~", "Fc" }, // F48 function key + { finalcut::fc::Fkey_f49 , ESC "O1;3P", "Fd" }, // F49 function key + { finalcut::fc::Fkey_f50 , ESC "O1;3Q", "Fe" }, // F50 function key + { finalcut::fc::Fkey_f51 , ESC "O1;3R", "Ff" }, // F51 function key + { finalcut::fc::Fkey_f52 , ESC "O1;3S", "Fg" }, // F52 function key + { finalcut::fc::Fkey_f53 , CSI "15;3~", "Fh" }, // F53 function key + { finalcut::fc::Fkey_f54 , CSI "17;3~", "Fi" }, // F54 function key + { finalcut::fc::Fkey_f55 , CSI "18;3~", "Fj" }, // F55 function key + { finalcut::fc::Fkey_f56 , CSI "19;3~", "Fk" }, // F56 function key + { finalcut::fc::Fkey_f57 , CSI "20;3~", "Fl" }, // F57 function key + { finalcut::fc::Fkey_f58 , CSI "21;3~", "Fm" }, // F58 function key + { finalcut::fc::Fkey_f59 , CSI "23;3~", "Fn" }, // F59 function key + { finalcut::fc::Fkey_f60 , CSI "24;3~", "Fo" }, // F60 function key + { finalcut::fc::Fkey_f61 , ESC "O1;4P", "Fp" }, // F61 function key + { finalcut::fc::Fkey_f62 , ESC "O1;4Q", "Fq" }, // F62 function key + { finalcut::fc::Fkey_f63 , ESC "O1;4R", "Fr" }, // F63 function key + { 0 , 0 , "\0" } }; } // namespace test diff --git a/test/foptiattr-test.cpp b/test/foptiattr-test.cpp index b315771a..029be482 100644 --- a/test/foptiattr-test.cpp +++ b/test/foptiattr-test.cpp @@ -134,9 +134,9 @@ void FOptiAttrTest::noArgumentTest() // Null test finalcut::FChar* ch_null = nullptr; CPPUNIT_ASSERT ( oa.changeAttribute(ch, ch) == 0 ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch, ch_null), C_STR("") ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch_null, ch), C_STR("") ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch_null, ch_null), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch, ch_null), "") ; + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch_null, ch), "") ; + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch_null, ch_null), "") ; delete ch; } @@ -150,46 +150,46 @@ void FOptiAttrTest::sgrOptimizerTest() oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (8); oa.setNoColorVideo (3); // Avoid standout (1) + underline mode (2) - oa.set_enter_bold_mode (C_STR(CSI "1m")); - oa.set_exit_bold_mode (C_STR(CSI "22m")); - oa.set_enter_dim_mode (C_STR(CSI "2m")); - oa.set_exit_dim_mode (C_STR(CSI "22m")); - oa.set_enter_italics_mode (C_STR(CSI "3m")); - oa.set_exit_italics_mode (C_STR(CSI "23m")); + oa.set_enter_bold_mode (CSI "1m"); + oa.set_exit_bold_mode (CSI "22m"); + oa.set_enter_dim_mode (CSI "2m"); + oa.set_exit_dim_mode (CSI "22m"); + oa.set_enter_italics_mode (CSI "3m"); + oa.set_exit_italics_mode (CSI "23m"); oa.set_enter_underline_mode (0); oa.set_exit_underline_mode (0); - oa.set_enter_blink_mode (C_STR(CSI "5m")); - oa.set_exit_blink_mode (C_STR(CSI "25m")); - oa.set_enter_reverse_mode (C_STR(CSI "7m")); - oa.set_exit_reverse_mode (C_STR(CSI "27m")); + oa.set_enter_blink_mode (CSI "5m"); + oa.set_exit_blink_mode (CSI "25m"); + oa.set_enter_reverse_mode (CSI "7m"); + oa.set_exit_reverse_mode (CSI "27m"); oa.set_enter_standout_mode (0); oa.set_exit_standout_mode (0); - oa.set_enter_secure_mode (C_STR(CSI "8m")); - oa.set_exit_secure_mode (C_STR(CSI "28m")); + oa.set_enter_secure_mode (CSI "8m"); + oa.set_exit_secure_mode (CSI "28m"); oa.set_enter_protected_mode (0); - oa.set_exit_protected_mode (C_STR(CSI "0m")); - oa.set_enter_crossed_out_mode (C_STR(CSI "9m")); - oa.set_exit_crossed_out_mode (C_STR(CSI "29m")); - oa.set_enter_dbl_underline_mode (C_STR(CSI "21m")); - oa.set_exit_dbl_underline_mode (C_STR(CSI "24m")); - oa.set_set_attributes (C_STR(CSI "0;10" - "%?%p3%t;7%;" - "%?%p4%t;5%;" - "%?%p5%t;2%;" - "%?%p6%t;1%;" - "%?%p7%t;8%;" - "%?%p9%t;11%;m")); - oa.set_exit_attribute_mode (C_STR(CSI "0m")); - oa.set_enter_alt_charset_mode (C_STR(CSI "11m")); - oa.set_exit_alt_charset_mode (C_STR(CSI "10m")); - oa.set_enter_pc_charset_mode (C_STR(CSI "11m")); - oa.set_exit_pc_charset_mode (C_STR(CSI "10m")); - oa.set_a_foreground_color (C_STR(CSI "3%p1%dm")); - oa.set_a_background_color (C_STR(CSI "4%p1%dm")); + oa.set_exit_protected_mode (CSI "0m"); + oa.set_enter_crossed_out_mode (CSI "9m"); + oa.set_exit_crossed_out_mode (CSI "29m"); + oa.set_enter_dbl_underline_mode (CSI "21m"); + oa.set_exit_dbl_underline_mode (CSI "24m"); + oa.set_set_attributes (CSI "0;10" + "%?%p3%t;7%;" + "%?%p4%t;5%;" + "%?%p5%t;2%;" + "%?%p6%t;1%;" + "%?%p7%t;8%;" + "%?%p9%t;11%;m"); + oa.set_exit_attribute_mode (CSI "0m"); + oa.set_enter_alt_charset_mode (CSI "11m"); + oa.set_exit_alt_charset_mode (CSI "10m"); + oa.set_enter_pc_charset_mode (CSI "11m"); + oa.set_exit_pc_charset_mode (CSI "10m"); + oa.set_a_foreground_color (CSI "3%p1%dm"); + oa.set_a_background_color (CSI "4%p1%dm"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); - oa.set_orig_pair (C_STR(CSI "39;49m")); + oa.set_orig_pair (CSI "39;49m"); oa.set_orig_orig_colors (0); oa.initialize(); @@ -205,7 +205,7 @@ void FOptiAttrTest::sgrOptimizerTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;2;1;3;34;47m") ); + , CSI "0;10;2;1;3;34;47m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -217,7 +217,7 @@ void FOptiAttrTest::sgrOptimizerTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;1;33;40m") ); + , CSI "0;10;1;33;40m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -227,77 +227,77 @@ void FOptiAttrTest::sgrOptimizerTest() char buffer[8192] = { CSI "0;10m" CSI "11m" CSI "36m" CSI "44m" }; finalcut::SGRoptimizer sgr_optimizer(buffer); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;10;11;36;44m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;10;11;36;44m") ; std::strcpy(buffer, CSI "0;1m" CSI "34m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;1;34m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;1;34m") ; std::strcpy(buffer, CSI "m" CSI "34m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;34m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;34m") ; std::strcpy(buffer, CSI "1m" CSI "m" CSI "45m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "1;0;45m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "1;0;45m") ; std::strcpy(buffer, CSI "47m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "47m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "47m") ; std::strcpy(buffer, CSI "47m" CSI "m" CSI "1m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "47;0;1m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "47;0;1m") ; std::strcpy(buffer, CSI "49m" CSI "m" CSI "0m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "49;0;0m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "49;0;0m") ; std::strcpy(buffer, CSI "m" CSI "m" CSI "m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;0;0m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;0;0m") ; std::strcpy(buffer, CSI "m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "m") ; std::strcpy(buffer, CSI "0;10;1;7m" CSI "3m" CSI "39m" CSI "49m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;10;1;7;3;39;49m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;10;1;7;3;39;49m") ; std::strcpy(buffer, CSI "m" CSI "38;5;20m" CSI "48;5;229m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;38;5;20;48;5;229m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;38;5;20;48;5;229m") ; std::strcpy(buffer, CSI "m" CSI "38;5;20m" CSI "11;16H"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;38;5;20m" CSI "11;16H") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;38;5;20m" CSI "11;16H") ; std::strcpy(buffer, CSI "1;1H" CSI "m" CSI "38;5;35m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "1;1H" CSI "0;38;5;35m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "1;1H" CSI "0;38;5;35m") ; std::strcpy(buffer, CSI "m" CSI "38;5;20m" CSI "11;16H" CSI "48;5;229m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;38;5;20m" CSI "11;16H" CSI "48;5;229m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;38;5;20m" CSI "11;16H" CSI "48;5;229m") ; std::strcpy(buffer, CSI "m" CSI "38;5;20m" "ABC" CSI "48;5;229m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;38;5;20mABC" CSI "48;5;229m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;38;5;20mABC" CSI "48;5;229m") ; std::strcpy(buffer, CSI "m" CSI "1m" CSI "2m" CSI "3m" CSI "4m" CSI "5m" CSI "7m" CSI "8m" CSI "9m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;1;2;3;4;5;7;8;9m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;1;2;3;4;5;7;8;9m") ; std::strcpy(buffer, CSI "0m" CSI "46;36;1m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;46;36;1m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;46;36;1m") ; std::strcpy(buffer, CSI "m" CSI "38;2;0;139;139m" CSI "48;2;240;255;240m"); sgr_optimizer.optimize(); - CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;38;2;0;139;139;48;2;240;255;240m") ); + CPPUNIT_ASSERT_CSTRING ( buffer, CSI "0;38;2;0;139;139;48;2;240;255;240m") ; delete to; delete from; @@ -361,8 +361,8 @@ void FOptiAttrTest::fakeReverseTest() oa.set_exit_alt_charset_mode (0); oa.set_enter_pc_charset_mode (0); oa.set_exit_pc_charset_mode (0); - oa.set_a_foreground_color (C_STR(CSI "3%p1%dm")); - oa.set_a_background_color (C_STR(CSI "4%p1%dm")); + oa.set_a_foreground_color (CSI "3%p1%dm"); + oa.set_a_background_color (CSI "4%p1%dm"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); @@ -379,7 +379,7 @@ void FOptiAttrTest::fakeReverseTest() to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "37m" CSI "44m") ); + , CSI "37m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -387,7 +387,7 @@ void FOptiAttrTest::fakeReverseTest() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "34m" CSI "47m") ); + , CSI "34m" CSI "47m") ; CPPUNIT_ASSERT ( from->fg_color == finalcut::fc::LightGray ); CPPUNIT_ASSERT ( from->bg_color == finalcut::fc::Blue ); CPPUNIT_ASSERT ( *from == *to ); @@ -396,7 +396,7 @@ void FOptiAttrTest::fakeReverseTest() to->bg_color = finalcut::fc::Red; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "31m" CSI "47m") ); + , CSI "31m" CSI "47m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -404,7 +404,7 @@ void FOptiAttrTest::fakeReverseTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "37m" CSI "41m") ); + , CSI "37m" CSI "41m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -422,47 +422,47 @@ void FOptiAttrTest::ansiTest() oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (8); oa.setNoColorVideo (3); // Avoid standout (1) + underline mode (2) - oa.set_enter_bold_mode (C_STR(CSI "1m")); - oa.set_exit_bold_mode (C_STR(CSI "0m")); + oa.set_enter_bold_mode (CSI "1m"); + oa.set_exit_bold_mode (CSI "0m"); oa.set_enter_dim_mode (0); - oa.set_exit_dim_mode (C_STR(CSI "0m")); + oa.set_exit_dim_mode (CSI "0m"); oa.set_enter_italics_mode (0); oa.set_exit_italics_mode (0); - oa.set_enter_underline_mode (C_STR(CSI "4m")); - oa.set_exit_underline_mode (C_STR(CSI "1m")); - oa.set_enter_blink_mode (C_STR(CSI "5m")); - oa.set_exit_blink_mode (C_STR(CSI "0m")); - oa.set_enter_reverse_mode (C_STR(CSI "7m")); - oa.set_exit_reverse_mode (C_STR(CSI "0m")); - oa.set_enter_standout_mode (C_STR(CSI "7m")); - oa.set_exit_standout_mode (C_STR(CSI "m")); - oa.set_enter_secure_mode (C_STR(CSI "8m")); - oa.set_exit_secure_mode (C_STR(CSI "0m")); + oa.set_enter_underline_mode (CSI "4m"); + oa.set_exit_underline_mode (CSI "1m"); + oa.set_enter_blink_mode (CSI "5m"); + oa.set_exit_blink_mode (CSI "0m"); + oa.set_enter_reverse_mode (CSI "7m"); + oa.set_exit_reverse_mode (CSI "0m"); + oa.set_enter_standout_mode (CSI "7m"); + oa.set_exit_standout_mode (CSI "m"); + oa.set_enter_secure_mode (CSI "8m"); + oa.set_exit_secure_mode (CSI "0m"); oa.set_enter_protected_mode (0); - oa.set_exit_protected_mode (C_STR(CSI "0m")); + oa.set_exit_protected_mode (CSI "0m"); oa.set_enter_crossed_out_mode (0); - oa.set_exit_crossed_out_mode (C_STR(CSI "0m")); + oa.set_exit_crossed_out_mode (CSI "0m"); oa.set_enter_dbl_underline_mode (0); oa.set_exit_dbl_underline_mode (0); - oa.set_set_attributes (C_STR(CSI "0;10" - "%?%p1%t;7%;" - "%?%p2%t;4%;" - "%?%p3%t;7%;" - "%?%p4%t;5%;" - "%?%p6%t;1%;" - "%?%p7%t;8%;" - "%?%p9%t;11%;m")); - oa.set_exit_attribute_mode (C_STR(CSI "0m")); - oa.set_enter_alt_charset_mode (C_STR(CSI "11m")); - oa.set_exit_alt_charset_mode (C_STR(CSI "10m")); - oa.set_enter_pc_charset_mode (C_STR(CSI "11m")); - oa.set_exit_pc_charset_mode (C_STR(CSI "10m")); - oa.set_a_foreground_color (C_STR(CSI "3%p1%dm")); - oa.set_a_background_color (C_STR(CSI "4%p1%dm")); + oa.set_set_attributes (CSI "0;10" + "%?%p1%t;7%;" + "%?%p2%t;4%;" + "%?%p3%t;7%;" + "%?%p4%t;5%;" + "%?%p6%t;1%;" + "%?%p7%t;8%;" + "%?%p9%t;11%;m"); + oa.set_exit_attribute_mode (CSI "0m"); + oa.set_enter_alt_charset_mode (CSI "11m"); + oa.set_exit_alt_charset_mode (CSI "10m"); + oa.set_enter_pc_charset_mode (CSI "11m"); + oa.set_exit_pc_charset_mode (CSI "10m"); + oa.set_a_foreground_color (CSI "3%p1%dm"); + oa.set_a_background_color (CSI "4%p1%dm"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); - oa.set_orig_pair (C_STR(CSI "39;49m")); + oa.set_orig_pair (CSI "39;49m"); oa.set_orig_orig_colors (0); oa.initialize(); @@ -478,7 +478,7 @@ void FOptiAttrTest::ansiTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;1m") ); + , CSI "0;10;1m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -489,7 +489,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;1m" CSI "34m" CSI "47m") ); + , CSI "0;10;1m" CSI "34m" CSI "47m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -500,7 +500,7 @@ void FOptiAttrTest::ansiTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "34m") ); + , CSI "0m" CSI "34m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -509,7 +509,7 @@ void FOptiAttrTest::ansiTest() to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "31m" CSI "40m") ); + , CSI "31m" CSI "40m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -518,7 +518,7 @@ void FOptiAttrTest::ansiTest() to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "32m" CSI "44m") ); + , CSI "32m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -528,7 +528,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;1m") ); + , CSI "0;10;1m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -536,7 +536,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -544,7 +544,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10m") ); + , CSI "0;10m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -552,7 +552,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -560,7 +560,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10m") ); + , CSI "0;10m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -568,7 +568,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -576,7 +576,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;4m") ); + , CSI "0;10;4m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -584,7 +584,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -592,7 +592,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;5m") ); + , CSI "0;10;5m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -600,7 +600,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -608,7 +608,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;7m") ); + , CSI "0;10;7m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -616,7 +616,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -624,7 +624,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;7m") ); + , CSI "0;10;7m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -632,7 +632,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -640,7 +640,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;8m") ); + , CSI "0;10;8m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -648,7 +648,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -656,7 +656,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10m") ); + , CSI "0;10m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -664,7 +664,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -672,7 +672,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10m") ); + , CSI "0;10m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -680,7 +680,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -688,7 +688,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10m") ); + , CSI "0;10m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -696,7 +696,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -704,7 +704,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;11m") ); + , CSI "0;10;11m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -712,7 +712,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "10m" CSI "0m") ); + , CSI "10m" CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -720,7 +720,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10m" CSI "11m") ); + , CSI "0;10m" CSI "11m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -728,7 +728,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "10m") ); + , CSI "0m" CSI "10m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -749,7 +749,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;7;4;7;5;1;8;11m") ); + , CSI "0;10;7;4;7;5;1;8;11m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -758,7 +758,7 @@ void FOptiAttrTest::ansiTest() to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "36m" CSI "44m") ); + , CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -766,7 +766,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;7;5;8;11m" CSI "36m" CSI "44m") ); + , CSI "0;10;7;5;8;11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -774,7 +774,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;7;5;8;11m" CSI "36m" CSI "44m") ); + , CSI "0;10;7;5;8;11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -782,8 +782,8 @@ void FOptiAttrTest::ansiTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;7;5;8;11m" - CSI "36m" CSI "44m") ); + , CSI "0;10;7;5;8;11m" + CSI "36m" CSI "44m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -796,7 +796,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;7;8;11m" CSI "36m" CSI "44m") ); + , CSI "0;10;7;8;11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -804,7 +804,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;8;11m" CSI "36m" CSI "44m") ); + , CSI "0;10;8;11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -817,7 +817,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;11m" CSI "36m" CSI "44m") ); + , CSI "0;10;11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -825,7 +825,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;11m" CSI "36m" CSI "44m") ); + , CSI "0;10;11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -833,7 +833,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;11m" CSI "36m" CSI "44m") ); + , CSI "0;10;11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -841,7 +841,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10;11m" CSI "36m" CSI "44m") ); + , CSI "0;10;11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -849,7 +849,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;10m" CSI "11m" CSI "36m" CSI "44m") ); + , CSI "0;10m" CSI "11m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -857,14 +857,14 @@ void FOptiAttrTest::ansiTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "10m" CSI "36m" CSI "44m") ); + , CSI "0m" CSI "10m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32m") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), CSI "32m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -872,7 +872,7 @@ void FOptiAttrTest::ansiTest() to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() - , C_STR("Esc [ 3 9 m ") ); + , "Esc [ 3 9 m ") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -890,41 +890,41 @@ void FOptiAttrTest::vt100Test() oa.unsetDefaultColorSupport(); // No ANSI default color oa.setMaxColor (1); oa.setNoColorVideo (0); - oa.set_enter_bold_mode (C_STR(CSI "1m$<2>")); - oa.set_exit_bold_mode (C_STR(CSI "0m$<2>")); + oa.set_enter_bold_mode (CSI "1m$<2>"); + oa.set_exit_bold_mode (CSI "0m$<2>"); oa.set_enter_dim_mode (0); - oa.set_exit_dim_mode (C_STR(CSI "0m$<2>")); + oa.set_exit_dim_mode (CSI "0m$<2>"); oa.set_enter_italics_mode (0); oa.set_exit_italics_mode (0); - oa.set_enter_underline_mode (C_STR(CSI "4m$<2>")); - oa.set_exit_underline_mode (C_STR(CSI "m$<2>")); - oa.set_enter_blink_mode (C_STR(CSI "5m$<2>")); - oa.set_exit_blink_mode (C_STR(CSI "0m$<2>")); - oa.set_enter_reverse_mode (C_STR(CSI "7m$<2>")); - oa.set_exit_reverse_mode (C_STR(CSI "0m$<2>")); - oa.set_enter_standout_mode (C_STR(CSI "7m$<2>")); - oa.set_exit_standout_mode (C_STR(CSI "m$<2>")); + oa.set_enter_underline_mode (CSI "4m$<2>"); + oa.set_exit_underline_mode (CSI "m$<2>"); + oa.set_enter_blink_mode (CSI "5m$<2>"); + oa.set_exit_blink_mode (CSI "0m$<2>"); + oa.set_enter_reverse_mode (CSI "7m$<2>"); + oa.set_exit_reverse_mode (CSI "0m$<2>"); + oa.set_enter_standout_mode (CSI "7m$<2>"); + oa.set_exit_standout_mode (CSI "m$<2>"); oa.set_enter_secure_mode (0); - oa.set_exit_secure_mode (C_STR(CSI "0m$<2>")); + oa.set_exit_secure_mode (CSI "0m$<2>"); oa.set_enter_protected_mode (0); - oa.set_exit_protected_mode (C_STR(CSI "0m$<2>")); + oa.set_exit_protected_mode (CSI "0m$<2>"); oa.set_enter_crossed_out_mode (0); - oa.set_exit_crossed_out_mode (C_STR(CSI "0m$<2>")); + oa.set_exit_crossed_out_mode (CSI "0m$<2>"); oa.set_enter_dbl_underline_mode (0); oa.set_exit_dbl_underline_mode (0); - oa.set_set_attributes (C_STR(CSI "0" - "%?%p1%p6%|%t;1%;" - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;$<2>")); - oa.set_exit_attribute_mode (C_STR(CSI "0m$<2>")); - oa.set_enter_alt_charset_mode (C_STR("\016")); - oa.set_exit_alt_charset_mode (C_STR("\017")); + oa.set_set_attributes (CSI "0" + "%?%p1%p6%|%t;1%;" + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;$<2>"); + oa.set_exit_attribute_mode (CSI "0m$<2>"); + oa.set_enter_alt_charset_mode ("\016"); + oa.set_exit_alt_charset_mode ("\017"); oa.set_enter_pc_charset_mode (0); oa.set_exit_pc_charset_mode (0); - oa.set_a_foreground_color (C_STR(CSI "3%p1%dm")); - oa.set_a_background_color (C_STR(CSI "4%p1%dm")); + oa.set_a_foreground_color (CSI "3%p1%dm"); + oa.set_a_background_color (CSI "4%p1%dm"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); @@ -944,7 +944,7 @@ void FOptiAttrTest::vt100Test() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017$<2>") ); + , CSI "0;1m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -955,7 +955,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017$<2>") ); + , CSI "0;1m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -966,20 +966,20 @@ void FOptiAttrTest::vt100Test() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>" ) ); + , CSI "0m$<2>" ) ; // Red text on black background to->fg_color = finalcut::fc::Red; to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("") ); + , "") ; // 256 color text and background to->fg_color = finalcut::fc::SpringGreen3; to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; // Bold on (with default colors) @@ -988,7 +988,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017$<2>") ); + , CSI "0;1m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -996,7 +996,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1004,7 +1004,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1012,7 +1012,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1020,7 +1020,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1028,7 +1028,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1036,7 +1036,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;4m\017$<2>") ); + , CSI "0;4m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1044,7 +1044,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1052,7 +1052,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;5m\017$<2>") ); + , CSI "0;5m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1060,7 +1060,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1068,7 +1068,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;7m\017$<2>") ); + , CSI "0;7m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1076,7 +1076,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1084,7 +1084,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;7m\017$<2>") ); + , CSI "0;1;7m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1092,7 +1092,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1100,7 +1100,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( to->encoded_char == ' ' ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1109,7 +1109,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1117,7 +1117,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1125,7 +1125,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1133,7 +1133,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1141,7 +1141,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1149,7 +1149,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1157,7 +1157,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1165,7 +1165,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\016$<2>") ); + , CSI "0m\016$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1173,7 +1173,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017" CSI "0m$<2>") ); + , "\017" CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1181,7 +1181,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1189,7 +1189,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1210,7 +1210,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;4;7;5m\016$<2>") ); + , CSI "0;1;4;7;5m\016$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1218,14 +1218,14 @@ void FOptiAttrTest::vt100Test() to->fg_color = finalcut::fc::Cyan; to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; // Bold off to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>\016" CSI "4m$<2>" - CSI "5m$<2>" CSI "7m$<2>" CSI "7m$<2>") ); + , CSI "0m$<2>\016" CSI "4m$<2>" + CSI "5m$<2>" CSI "7m$<2>" CSI "7m$<2>" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1233,15 +1233,15 @@ void FOptiAttrTest::vt100Test() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>\016" CSI "4m$<2>" - CSI "5m$<2>" CSI "7m$<2>" CSI "7m$<2>") ); + , CSI "0m$<2>\016" CSI "4m$<2>" + CSI "5m$<2>" CSI "7m$<2>" CSI "7m$<2>" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Italic off to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1249,8 +1249,8 @@ void FOptiAttrTest::vt100Test() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "m$<2>\016" CSI "5m$<2>" - CSI "7m$<2>" CSI "7m$<2>") ); + , CSI "m$<2>\016" CSI "5m$<2>" + CSI "7m$<2>" CSI "7m$<2>" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1258,8 +1258,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>\016" CSI "7m$<2>" - CSI "7m$<2>") ); + , CSI "0m$<2>\016" CSI "7m$<2>" CSI "7m$<2>" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1267,7 +1266,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>\016" CSI "7m$<2>") ); + , CSI "0m$<2>\016" CSI "7m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1275,7 +1274,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "m$<2>\016") ); + , CSI "m$<2>\016") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1284,7 +1283,7 @@ void FOptiAttrTest::vt100Test() CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>\016") ); + , CSI "0m$<2>\016") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1292,7 +1291,7 @@ void FOptiAttrTest::vt100Test() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>\016") ); + , CSI "0m$<2>\016") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1300,21 +1299,21 @@ void FOptiAttrTest::vt100Test() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>\016") ); + , CSI "0m$<2>\016") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Double underline off to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Alternate character set off to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("\017") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1322,14 +1321,14 @@ void FOptiAttrTest::vt100Test() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1352,55 +1351,55 @@ void FOptiAttrTest::xtermTest() oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (256); oa.setNoColorVideo (0); - oa.set_enter_bold_mode (C_STR(CSI "1m")); - oa.set_exit_bold_mode (C_STR(CSI "22m")); - oa.set_enter_dim_mode (C_STR(CSI "2m")); - oa.set_exit_dim_mode (C_STR(CSI "22m")); - oa.set_enter_italics_mode (C_STR(CSI "3m")); - oa.set_exit_italics_mode (C_STR(CSI "23m")); - oa.set_enter_underline_mode (C_STR(CSI "4m")); - oa.set_exit_underline_mode (C_STR(CSI "24m")); - oa.set_enter_blink_mode (C_STR(CSI "5m")); - oa.set_exit_blink_mode (C_STR(CSI "25m")); - oa.set_enter_reverse_mode (C_STR(CSI "7m")); - oa.set_exit_reverse_mode (C_STR(CSI "27m")); - oa.set_enter_standout_mode (C_STR(CSI "7m")); - oa.set_exit_standout_mode (C_STR(CSI "27m")); - oa.set_enter_secure_mode (C_STR(CSI "8m")); - oa.set_exit_secure_mode (C_STR(CSI "28m")); + oa.set_enter_bold_mode (CSI "1m"); + oa.set_exit_bold_mode (CSI "22m"); + oa.set_enter_dim_mode (CSI "2m"); + oa.set_exit_dim_mode (CSI "22m"); + oa.set_enter_italics_mode (CSI "3m"); + oa.set_exit_italics_mode (CSI "23m"); + oa.set_enter_underline_mode (CSI "4m"); + oa.set_exit_underline_mode (CSI "24m"); + oa.set_enter_blink_mode (CSI "5m"); + oa.set_exit_blink_mode (CSI "25m"); + oa.set_enter_reverse_mode (CSI "7m"); + oa.set_exit_reverse_mode (CSI "27m"); + oa.set_enter_standout_mode (CSI "7m"); + oa.set_exit_standout_mode (CSI "27m"); + oa.set_enter_secure_mode (CSI "8m"); + oa.set_exit_secure_mode (CSI "28m"); oa.set_enter_protected_mode (0); - oa.set_exit_protected_mode (C_STR(CSI "0m")); - oa.set_enter_crossed_out_mode (C_STR(CSI "9m")); - oa.set_exit_crossed_out_mode (C_STR(CSI "29m")); - oa.set_enter_dbl_underline_mode (C_STR(CSI "21m")); - oa.set_exit_dbl_underline_mode (C_STR(CSI "24m")); - oa.set_set_attributes (C_STR("%?%p9%t" ESC "(0" - "%e" ESC "(B%;" CSI "0" - "%?%p6%t;1%;" - "%?%p5%t;2%;" - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;" - "%?%p7%t;8%;m")); - oa.set_exit_attribute_mode (C_STR(CSI "0m")); - oa.set_enter_alt_charset_mode (C_STR(ESC "(0")); - oa.set_exit_alt_charset_mode (C_STR(ESC "(B")); + oa.set_exit_protected_mode (CSI "0m"); + oa.set_enter_crossed_out_mode (CSI "9m"); + oa.set_exit_crossed_out_mode (CSI "29m"); + oa.set_enter_dbl_underline_mode (CSI "21m"); + oa.set_exit_dbl_underline_mode (CSI "24m"); + oa.set_set_attributes ("%?%p9%t" ESC "(0" + "%e" ESC "(B%;" CSI "0" + "%?%p6%t;1%;" + "%?%p5%t;2%;" + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;" + "%?%p7%t;8%;m"); + oa.set_exit_attribute_mode (CSI "0m"); + oa.set_enter_alt_charset_mode (ESC "(0"); + oa.set_exit_alt_charset_mode (ESC "(B"); oa.set_enter_pc_charset_mode (0); oa.set_exit_pc_charset_mode (0); - oa.set_a_foreground_color (C_STR(CSI "%?%p1%{8}%<" - "%t3%p1%d" - "%e%p1%{16}%<" - "%t9%p1%{8}%-%d" - "%e38;5;%p1%d%;m")); - oa.set_a_background_color (C_STR(CSI "%?%p1%{8}%<" - "%t4%p1%d" - "%e%p1%{16}%<" - "%t10%p1%{8}%-%d" - "%e48;5;%p1%d%;m")); + oa.set_a_foreground_color (CSI "%?%p1%{8}%<" + "%t3%p1%d" + "%e%p1%{16}%<" + "%t9%p1%{8}%-%d" + "%e38;5;%p1%d%;m"); + oa.set_a_background_color (CSI "%?%p1%{8}%<" + "%t4%p1%d" + "%e%p1%{16}%<" + "%t10%p1%{8}%-%d" + "%e48;5;%p1%d%;m"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); - oa.set_orig_pair (C_STR(CSI "39;49m")); + oa.set_orig_pair (CSI "39;49m"); oa.set_orig_orig_colors (0); oa.initialize(); @@ -1416,7 +1415,7 @@ void FOptiAttrTest::xtermTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;1m") ); + , ESC "(B" CSI "0;1m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1427,8 +1426,8 @@ void FOptiAttrTest::xtermTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;1;2m" CSI "3m" - CSI "34m" CSI "107m") ); + , ESC "(B" CSI "0;1;2m" CSI "3m" + CSI "34m" CSI "107m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1439,7 +1438,7 @@ void FOptiAttrTest::xtermTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "34m") ); + , CSI "0m" CSI "34m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1448,7 +1447,7 @@ void FOptiAttrTest::xtermTest() to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "31m" CSI "40m") ); + , CSI "31m" CSI "40m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1457,7 +1456,7 @@ void FOptiAttrTest::xtermTest() to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "38;5;42m" CSI "48;5;17m") ); + , CSI "38;5;42m" CSI "48;5;17m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1467,7 +1466,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;1m") ); + , ESC "(B" CSI "0;1m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1475,7 +1474,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1483,7 +1482,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;2m") ); + , ESC "(B" CSI "0;2m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1491,7 +1490,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1499,7 +1498,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0m" CSI "3m") ); + , ESC "(B" CSI "0m" CSI "3m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1507,7 +1506,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1515,7 +1514,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;4m") ); + , ESC "(B" CSI "0;4m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1523,7 +1522,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1531,7 +1530,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;5m") ); + , ESC "(B" CSI "0;5m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1539,7 +1538,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1547,7 +1546,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;7m") ); + , ESC "(B" CSI "0;7m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1555,7 +1554,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1563,7 +1562,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;7m") ); + , ESC "(B" CSI "0;7m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1571,7 +1570,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1579,7 +1578,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0;8m") ); + , ESC "(B" CSI "0;8m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1587,7 +1586,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1595,7 +1594,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0m") ); + , ESC "(B" CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1603,7 +1602,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1611,7 +1610,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0m" CSI "9m") ); + , ESC "(B" CSI "0m" CSI "9m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1619,7 +1618,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1627,7 +1626,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0m" CSI "21m") ); + , ESC "(B" CSI "0m" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1635,7 +1634,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1643,7 +1642,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(0" CSI "0m") ); + , ESC "(0" CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1651,7 +1650,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0m") ); + , ESC "(B" CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1659,7 +1658,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B" CSI "0m") ); + , ESC "(B" CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1667,7 +1666,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1688,8 +1687,8 @@ void FOptiAttrTest::xtermTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(0" CSI "0;1;2;4;7;5;8m" CSI "3m" - CSI "9m" CSI "21m") ); + , ESC "(0" CSI "0;1;2;4;7;5;8m" CSI "3m" + CSI "9m" CSI "21m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1698,7 +1697,7 @@ void FOptiAttrTest::xtermTest() to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "36m" CSI "44m") ); + , CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1706,7 +1705,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "22m" CSI "2m") ); + , CSI "22m" CSI "2m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1714,7 +1713,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1722,14 +1721,14 @@ void FOptiAttrTest::xtermTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "23m") ); + , CSI "23m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Underline off to->attr.bit.underline = false; CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "24m" CSI "21m") ); + , CSI "24m" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1738,7 +1737,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "25m") ); + , CSI "25m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1746,14 +1745,14 @@ void FOptiAttrTest::xtermTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Standout off to->attr.bit.standout = false; CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1761,7 +1760,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "28m") ); + , CSI "28m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1769,7 +1768,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "36m" CSI "44m" ESC "(0" CSI "9m" CSI "21m") ); + , CSI "0m" CSI "36m" CSI "44m" ESC "(0" CSI "9m" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1777,7 +1776,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "29m") ); + , CSI "29m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1785,7 +1784,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "24m") ); + , CSI "24m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1793,7 +1792,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(B") ); + , ESC "(B") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1801,14 +1800,14 @@ void FOptiAttrTest::xtermTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "36m" CSI "44m") ); + , CSI "0m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32m") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), CSI "32m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1816,7 +1815,7 @@ void FOptiAttrTest::xtermTest() to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() - , C_STR("Esc [ 3 9 m ") ); + , "Esc [ 3 9 m ") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1834,45 +1833,45 @@ void FOptiAttrTest::rxvtTest() oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (8); oa.setNoColorVideo (0); - oa.set_enter_bold_mode (C_STR(CSI "1m")); - oa.set_exit_bold_mode (C_STR(CSI "22m")); + oa.set_enter_bold_mode (CSI "1m"); + oa.set_exit_bold_mode (CSI "22m"); oa.set_enter_dim_mode (0); - oa.set_exit_dim_mode (C_STR(CSI "22m")); + oa.set_exit_dim_mode (CSI "22m"); oa.set_enter_italics_mode (0); oa.set_exit_italics_mode (0); - oa.set_enter_underline_mode (C_STR(CSI "4m")); - oa.set_exit_underline_mode (C_STR(CSI "24m")); - oa.set_enter_blink_mode (C_STR(CSI "5m")); - oa.set_exit_blink_mode (C_STR(CSI "25m")); - oa.set_enter_reverse_mode (C_STR(CSI "7m")); - oa.set_exit_reverse_mode (C_STR(CSI "27m")); - oa.set_enter_standout_mode (C_STR(CSI "7m")); - oa.set_exit_standout_mode (C_STR(CSI "27m")); + oa.set_enter_underline_mode (CSI "4m"); + oa.set_exit_underline_mode (CSI "24m"); + oa.set_enter_blink_mode (CSI "5m"); + oa.set_exit_blink_mode (CSI "25m"); + oa.set_enter_reverse_mode (CSI "7m"); + oa.set_exit_reverse_mode (CSI "27m"); + oa.set_enter_standout_mode (CSI "7m"); + oa.set_exit_standout_mode (CSI "27m"); oa.set_enter_secure_mode (0); - oa.set_exit_secure_mode (C_STR(CSI "28m")); + oa.set_exit_secure_mode (CSI "28m"); oa.set_enter_protected_mode (0); - oa.set_exit_protected_mode (C_STR(CSI "0m")); - oa.set_enter_crossed_out_mode (C_STR(CSI "9m")); - oa.set_exit_crossed_out_mode (C_STR(CSI "29m")); - oa.set_enter_dbl_underline_mode (C_STR(CSI "21m")); - oa.set_exit_dbl_underline_mode (C_STR(CSI "24m")); - oa.set_set_attributes (C_STR(CSI "0" - "%?%p6%t;1%;" - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;")); - oa.set_exit_attribute_mode (C_STR(CSI "0m")); - oa.set_enter_alt_charset_mode (C_STR("\016")); - oa.set_exit_alt_charset_mode (C_STR("\017")); + oa.set_exit_protected_mode (CSI "0m"); + oa.set_enter_crossed_out_mode (CSI "9m"); + oa.set_exit_crossed_out_mode (CSI "29m"); + oa.set_enter_dbl_underline_mode (CSI "21m"); + oa.set_exit_dbl_underline_mode (CSI "24m"); + oa.set_set_attributes (CSI "0" + "%?%p6%t;1%;" + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;"); + oa.set_exit_attribute_mode (CSI "0m"); + oa.set_enter_alt_charset_mode ("\016"); + oa.set_exit_alt_charset_mode ("\017"); oa.set_enter_pc_charset_mode (0); oa.set_exit_pc_charset_mode (0); - oa.set_a_foreground_color (C_STR(CSI "3%p1%dm")); - oa.set_a_background_color (C_STR(CSI "4%p1%dm")); + oa.set_a_foreground_color (CSI "3%p1%dm"); + oa.set_a_background_color (CSI "4%p1%dm"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); - oa.set_orig_pair (C_STR(CSI "39;49m")); + oa.set_orig_pair (CSI "39;49m"); oa.set_orig_orig_colors (0); oa.initialize(); @@ -1888,7 +1887,7 @@ void FOptiAttrTest::rxvtTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017") ); + , CSI "0;1m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1899,7 +1898,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017" CSI "34m" CSI "47m") ); + , CSI "0;1m\017" CSI "34m" CSI "47m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1910,7 +1909,7 @@ void FOptiAttrTest::rxvtTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "34m") ); + , CSI "0m" CSI "34m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1919,7 +1918,7 @@ void FOptiAttrTest::rxvtTest() to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "31m" CSI "40m") ); + , CSI "31m" CSI "40m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1928,7 +1927,7 @@ void FOptiAttrTest::rxvtTest() to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "32m" CSI "44m") ); + , CSI "32m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1938,7 +1937,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017") ); + , CSI "0;1m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1946,7 +1945,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1954,7 +1953,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1962,7 +1961,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1970,7 +1969,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1978,7 +1977,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1986,7 +1985,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;4m\017") ); + , CSI "0;4m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1994,7 +1993,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2002,7 +2001,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;5m\017") ); + , CSI "0;5m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2010,7 +2009,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2018,7 +2017,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;7m\017") ); + , CSI "0;7m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2026,7 +2025,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2034,7 +2033,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;7m\017") ); + , CSI "0;7m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2042,7 +2041,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2050,7 +2049,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( to->encoded_char == ' ' ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2059,7 +2058,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2067,7 +2066,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2075,7 +2074,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2083,7 +2082,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "9m") ); + , CSI "0m\017" CSI "9m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2091,7 +2090,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2099,7 +2098,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "21m") ); + , CSI "0m\017" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2107,7 +2106,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2115,7 +2114,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\016") ); + , CSI "0m\016") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2123,7 +2122,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017" CSI "0m") ); + , "\017" CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2131,7 +2130,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2139,7 +2138,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2160,8 +2159,8 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;4;7;5m\016" - CSI "9m" CSI "21m") ); + , CSI "0;1;4;7;5m\016" + CSI "9m" CSI "21m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2170,7 +2169,7 @@ void FOptiAttrTest::rxvtTest() to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "36m" CSI "44m") ); + , CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2178,7 +2177,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2186,7 +2185,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2194,14 +2193,14 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("") ); + , "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Underline off to->attr.bit.underline = false; CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "24m" CSI "21m") ); + , CSI "24m" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2210,7 +2209,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "25m") ); + , CSI "25m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2218,14 +2217,14 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Standout off to->attr.bit.standout = false; CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2233,7 +2232,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "28m") ); + , CSI "28m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2241,7 +2240,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "36m" CSI "44m\016" CSI "9m" CSI "21m") ); + , CSI "0m" CSI "36m" CSI "44m\016" CSI "9m" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2249,7 +2248,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "29m") ); + , CSI "29m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2257,7 +2256,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "24m") ); + , CSI "24m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2265,7 +2264,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017") ); + , "\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2273,14 +2272,14 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "36m" CSI "44m") ); + , CSI "0m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32m") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), CSI "32m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2288,7 +2287,7 @@ void FOptiAttrTest::rxvtTest() to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() - , C_STR("Esc [ 3 9 m ") ); + , "Esc [ 3 9 m ") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2306,20 +2305,20 @@ void FOptiAttrTest::linuxTest() oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (16); oa.setNoColorVideo (18); - oa.set_enter_bold_mode (C_STR(CSI "1m")); - oa.set_exit_bold_mode (C_STR(CSI "22m")); + oa.set_enter_bold_mode (CSI "1m"); + oa.set_exit_bold_mode (CSI "22m"); oa.set_enter_dim_mode (0); oa.set_exit_dim_mode (0); oa.set_enter_italics_mode (0); oa.set_exit_italics_mode (0); oa.set_enter_underline_mode (0); oa.set_exit_underline_mode (0); - oa.set_enter_blink_mode (C_STR(CSI "5m")); - oa.set_exit_blink_mode (C_STR(CSI "25m")); - oa.set_enter_reverse_mode (C_STR(CSI "7m")); - oa.set_exit_reverse_mode (C_STR(CSI "27m")); - oa.set_enter_standout_mode (C_STR(CSI "7m")); - oa.set_exit_standout_mode (C_STR(CSI "27m")); + oa.set_enter_blink_mode (CSI "5m"); + oa.set_exit_blink_mode (CSI "25m"); + oa.set_enter_reverse_mode (CSI "7m"); + oa.set_exit_reverse_mode (CSI "27m"); + oa.set_enter_standout_mode (CSI "7m"); + oa.set_exit_standout_mode (CSI "27m"); oa.set_enter_secure_mode (0); oa.set_exit_secure_mode (0); oa.set_enter_protected_mode (0); @@ -2328,25 +2327,25 @@ void FOptiAttrTest::linuxTest() oa.set_exit_crossed_out_mode (0); oa.set_enter_dbl_underline_mode (0); oa.set_exit_dbl_underline_mode (0); - oa.set_set_attributes (C_STR(CSI "0" - "%?%p6%|%t;1%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;")); - oa.set_exit_attribute_mode (C_STR(CSI "0m\017")); - oa.set_enter_alt_charset_mode (C_STR("\016")); - oa.set_exit_alt_charset_mode (C_STR("\017")); - oa.set_enter_pc_charset_mode (C_STR(CSI "11m")); - oa.set_exit_pc_charset_mode (C_STR(CSI "10m")); - oa.set_a_foreground_color (C_STR(CSI "3%p1%{8}%m%d" - "%?%p1%{7}%>%t;1%e;22%;m")); - oa.set_a_background_color (C_STR(CSI "4%p1%{8}%m%d" - "%?%p1%{7}%>%t;5%e;25%;m")); + oa.set_set_attributes (CSI "0" + "%?%p6%|%t;1%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;"); + oa.set_exit_attribute_mode (CSI "0m\017"); + oa.set_enter_alt_charset_mode ("\016"); + oa.set_exit_alt_charset_mode ("\017"); + oa.set_enter_pc_charset_mode (CSI "11m"); + oa.set_exit_pc_charset_mode (CSI "10m"); + oa.set_a_foreground_color (CSI "3%p1%{8}%m%d" + "%?%p1%{7}%>%t;1%e;22%;m"); + oa.set_a_background_color (CSI "4%p1%{8}%m%d" + "%?%p1%{7}%>%t;5%e;25%;m"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); - oa.set_orig_pair (C_STR(CSI "39;49;25m")); - oa.set_orig_orig_colors (C_STR(OSC "R")); + oa.set_orig_pair (CSI "39;49;25m"); + oa.set_orig_orig_colors (OSC "R"); oa.initialize(); finalcut::FChar* from = new finalcut::FChar(); @@ -2361,7 +2360,7 @@ void FOptiAttrTest::linuxTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017") ); + , CSI "0;1m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2372,7 +2371,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017" CSI "34;22m" CSI "47;5m") ); + , CSI "0;1m\017" CSI "34;22m" CSI "47;5m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2383,7 +2382,7 @@ void FOptiAttrTest::linuxTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "34;22m") ); + , CSI "0m\017" CSI "34;22m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2392,7 +2391,7 @@ void FOptiAttrTest::linuxTest() to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "31;22m" CSI "40;25m") ); + , CSI "31;22m" CSI "40;25m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2401,7 +2400,7 @@ void FOptiAttrTest::linuxTest() to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "32;1m" CSI "44;25m") ); + , CSI "32;1m" CSI "44;25m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2411,7 +2410,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017") ); + , CSI "0;1m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2419,7 +2418,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2427,7 +2426,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2435,7 +2434,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2443,7 +2442,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2451,7 +2450,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2459,7 +2458,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2467,7 +2466,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2475,7 +2474,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;5m\017") ); + , CSI "0;5m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2483,7 +2482,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2491,7 +2490,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;7m\017") ); + , CSI "0;7m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2499,7 +2498,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2507,7 +2506,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;7m\017") ); + , CSI "0;7m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2515,7 +2514,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2523,7 +2522,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( to->encoded_char == ' ' ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2532,7 +2531,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\17") ); + , CSI "0m\17") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2540,7 +2539,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2548,7 +2547,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2556,7 +2555,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2564,7 +2563,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2572,7 +2571,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2580,7 +2579,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2588,7 +2587,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\016") ); + , CSI "0m\016") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2596,7 +2595,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017" CSI "0m\017") ); + , "\017" CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2604,7 +2603,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "11m") ); + , CSI "0m\017" CSI "11m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2612,7 +2611,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "10m") ); + , CSI "0m\017" CSI "10m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2633,8 +2632,8 @@ void FOptiAttrTest::linuxTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;7;5m\016" - CSI "11m") ); + , CSI "0;1;7;5m\016" + CSI "11m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2643,7 +2642,7 @@ void FOptiAttrTest::linuxTest() to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "36;22m" CSI "44;25m") ); + , CSI "36;22m" CSI "44;25m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2651,7 +2650,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2664,7 +2663,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("") ); + , "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2677,7 +2676,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "25m") ); + , CSI "25m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2685,14 +2684,14 @@ void FOptiAttrTest::linuxTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Standout off to->attr.bit.standout = false; CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2700,7 +2699,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("") ); + , "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2708,7 +2707,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("") ); + , "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2716,7 +2715,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("") ); + , "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2724,7 +2723,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("") ); + , "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2732,7 +2731,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017") ); + , "\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2740,14 +2739,14 @@ void FOptiAttrTest::linuxTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "10m" CSI "36;22m" CSI "44;25m") ); + , CSI "0m\017" CSI "10m" CSI "36;22m" CSI "44;25m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32;22m") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), CSI "32;22m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2755,7 +2754,7 @@ void FOptiAttrTest::linuxTest() to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() - , C_STR("Esc [ 3 9 m ") ); + , "Esc [ 3 9 m ") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2781,55 +2780,55 @@ void FOptiAttrTest::puttyTest() oa.unsetDefaultColorSupport(); // No ANSI default color oa.setMaxColor (256); oa.setNoColorVideo (0); - oa.set_enter_bold_mode (C_STR(CSI "1m")); - oa.set_exit_bold_mode (C_STR(CSI "22m")); - oa.set_enter_dim_mode (C_STR(CSI "2m")); - oa.set_exit_dim_mode (C_STR(CSI "22m")); + oa.set_enter_bold_mode (CSI "1m"); + oa.set_exit_bold_mode (CSI "22m"); + oa.set_enter_dim_mode (CSI "2m"); + oa.set_exit_dim_mode (CSI "22m"); oa.set_enter_italics_mode (0); oa.set_exit_italics_mode (0); - oa.set_enter_underline_mode (C_STR(CSI "4m")); - oa.set_exit_underline_mode (C_STR(CSI "24m")); - oa.set_enter_blink_mode (C_STR(CSI "5m")); - oa.set_exit_blink_mode (C_STR(CSI "25m")); - oa.set_enter_reverse_mode (C_STR(CSI "7m")); - oa.set_exit_reverse_mode (C_STR(CSI "27m")); - oa.set_enter_standout_mode (C_STR(CSI "7m")); - oa.set_exit_standout_mode (C_STR(CSI "27m")); + oa.set_enter_underline_mode (CSI "4m"); + oa.set_exit_underline_mode (CSI "24m"); + oa.set_enter_blink_mode (CSI "5m"); + oa.set_exit_blink_mode (CSI "25m"); + oa.set_enter_reverse_mode (CSI "7m"); + oa.set_exit_reverse_mode (CSI "27m"); + oa.set_enter_standout_mode (CSI "7m"); + oa.set_exit_standout_mode (CSI "27m"); oa.set_enter_secure_mode (0); - oa.set_exit_secure_mode (C_STR(CSI "28m")); + oa.set_exit_secure_mode (CSI "28m"); oa.set_enter_protected_mode (0); - oa.set_exit_protected_mode (C_STR(CSI "0m")); - oa.set_enter_crossed_out_mode (C_STR(CSI "9m")); - oa.set_exit_crossed_out_mode (C_STR(CSI "29m")); - oa.set_enter_dbl_underline_mode (C_STR(CSI "21m")); - oa.set_exit_dbl_underline_mode (C_STR(CSI "24m")); - oa.set_set_attributes (C_STR(CSI "0" - "%?%p1%p6%|%t;1%;" - "%?%p5%t;2%;" - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;")); - oa.set_exit_attribute_mode (C_STR(CSI "0m")); - oa.set_enter_alt_charset_mode (C_STR("\016")); - oa.set_exit_alt_charset_mode (C_STR("\017")); - oa.set_enter_pc_charset_mode (C_STR(CSI "11m")); - oa.set_exit_pc_charset_mode (C_STR(CSI "10m")); - oa.set_a_foreground_color (C_STR(CSI "%?%p1%{8}%<" - "%t3%p1%d" - "%e%p1%{16}%<" - "%t9%p1%{8}%-%d" - "%e38;5;%p1%d%;m")); - oa.set_a_background_color (C_STR(CSI "%?%p1%{8}%<" - "%t4%p1%d" - "%e%p1%{16}%<" - "%t10%p1%{8}%-%d" - "%e48;5;%p1%d%;m")); + oa.set_exit_protected_mode (CSI "0m"); + oa.set_enter_crossed_out_mode (CSI "9m"); + oa.set_exit_crossed_out_mode (CSI "29m"); + oa.set_enter_dbl_underline_mode (CSI "21m"); + oa.set_exit_dbl_underline_mode (CSI "24m"); + oa.set_set_attributes (CSI "0" + "%?%p1%p6%|%t;1%;" + "%?%p5%t;2%;" + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;"); + oa.set_exit_attribute_mode (CSI "0m"); + oa.set_enter_alt_charset_mode ("\016"); + oa.set_exit_alt_charset_mode ("\017"); + oa.set_enter_pc_charset_mode (CSI "11m"); + oa.set_exit_pc_charset_mode (CSI "10m"); + oa.set_a_foreground_color (CSI "%?%p1%{8}%<" + "%t3%p1%d" + "%e%p1%{16}%<" + "%t9%p1%{8}%-%d" + "%e38;5;%p1%d%;m"); + oa.set_a_background_color (CSI "%?%p1%{8}%<" + "%t4%p1%d" + "%e%p1%{16}%<" + "%t10%p1%{8}%-%d" + "%e48;5;%p1%d%;m"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); - oa.set_orig_pair (C_STR(CSI "39;49m")); - oa.set_orig_orig_colors (C_STR(OSC "R")); + oa.set_orig_pair (CSI "39;49m"); + oa.set_orig_orig_colors (OSC "R"); oa.initialize(); @@ -2845,7 +2844,7 @@ void FOptiAttrTest::puttyTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017") ); + , CSI "0;1m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2856,8 +2855,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;2m\017" - CSI "34m" CSI "107m") ); + , CSI "0;1;2m\017" CSI "34m" CSI "107m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2868,7 +2866,7 @@ void FOptiAttrTest::puttyTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "39;49m" CSI "34m") ); + , CSI "0m" CSI "39;49m" CSI "34m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2877,7 +2875,7 @@ void FOptiAttrTest::puttyTest() to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "31m" CSI "40m") ); + , CSI "31m" CSI "40m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2886,7 +2884,7 @@ void FOptiAttrTest::puttyTest() to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "38;5;42m" CSI "48;5;17m") ); + , CSI "38;5;42m" CSI "48;5;17m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2896,7 +2894,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017") ); + , CSI "0;1m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2904,7 +2902,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2912,7 +2910,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;2m\017") ); + , CSI "0;2m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2920,7 +2918,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2928,7 +2926,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2936,7 +2934,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2944,7 +2942,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;4m\017") ); + , CSI "0;4m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2952,7 +2950,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2960,7 +2958,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;5m\017") ); + , CSI "0;5m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2968,7 +2966,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2976,7 +2974,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;7m\017") ); + , CSI "0;7m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2984,7 +2982,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -2992,7 +2990,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;7m\017") ); + , CSI "0;1;7m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3000,7 +2998,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3008,7 +3006,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( to->encoded_char == ' ' ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3017,7 +3015,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3025,7 +3023,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3033,7 +3031,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3041,7 +3039,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "9m") ); + , CSI "0m\017" CSI "9m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3049,7 +3047,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3057,7 +3055,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "21m") ); + , CSI "0m\017" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3065,7 +3063,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m") ); + , CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3073,7 +3071,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\016") ); + , CSI "0m\016") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3081,7 +3079,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017" CSI "0m") ); + , "\017" CSI "0m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3089,7 +3087,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017" CSI "11m") ); + , CSI "0m\017" CSI "11m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3097,7 +3095,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "10m") ); + , CSI "0m" CSI "10m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3118,8 +3116,8 @@ void FOptiAttrTest::puttyTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;2;4;7;5m\016" - CSI "9m" CSI "21m" CSI "11m") ); + , CSI "0;1;2;4;7;5m\016" + CSI "9m" CSI "21m" CSI "11m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3128,7 +3126,7 @@ void FOptiAttrTest::puttyTest() to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "36m" CSI "44m") ); + , CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3136,7 +3134,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "22m" CSI "2m") ); + , CSI "22m" CSI "2m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3144,21 +3142,21 @@ void FOptiAttrTest::puttyTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Italic off to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Underline off to->attr.bit.underline = false; CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "24m" CSI "21m") ); + , CSI "24m" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3167,7 +3165,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "25m") ); + , CSI "25m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3175,14 +3173,14 @@ void FOptiAttrTest::puttyTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Standout off to->attr.bit.standout = false; CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3190,7 +3188,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "28m") ); + , CSI "28m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3198,8 +3196,8 @@ void FOptiAttrTest::puttyTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "36m" CSI "44m" "\016" - CSI "11m" CSI "9m" CSI "21m") ); + , CSI "0m" CSI "36m" CSI "44m" "\016" + CSI "11m" CSI "9m" CSI "21m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3207,7 +3205,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "29m") ); + , CSI "29m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3215,7 +3213,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "24m") ); + , CSI "24m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3223,7 +3221,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017") ); + , "\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3231,14 +3229,14 @@ void FOptiAttrTest::puttyTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m" CSI "10m" CSI "36m" CSI "44m") ); + , CSI "0m" CSI "10m" CSI "36m" CSI "44m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32m") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), CSI "32m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3246,7 +3244,7 @@ void FOptiAttrTest::puttyTest() to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() - , C_STR("Esc [ 3 9 ; 4 9 m Esc [ 4 4 m ") ); + , "Esc [ 3 9 ; 4 9 m Esc [ 4 4 m ") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3264,45 +3262,45 @@ void FOptiAttrTest::teratermTest() oa.unsetDefaultColorSupport(); // No ANSI default color oa.setMaxColor (16); oa.setNoColorVideo (41); // Avoid standout (1) + blink (8) + bold (32) - oa.set_enter_bold_mode (C_STR(CSI "1m")); - oa.set_exit_bold_mode (C_STR(CSI "22m")); + oa.set_enter_bold_mode (CSI "1m"); + oa.set_exit_bold_mode (CSI "22m"); oa.set_enter_dim_mode (0); - oa.set_exit_dim_mode (C_STR(CSI "22m")); + oa.set_exit_dim_mode (CSI "22m"); oa.set_enter_italics_mode (0); oa.set_exit_italics_mode (0); - oa.set_enter_underline_mode (C_STR(CSI "4m")); - oa.set_exit_underline_mode (C_STR(CSI "24m")); - oa.set_enter_blink_mode (C_STR(CSI "5m")); - oa.set_exit_blink_mode (C_STR(CSI "25m")); - oa.set_enter_reverse_mode (C_STR(CSI "7m")); - oa.set_exit_reverse_mode (C_STR(CSI "27m")); - oa.set_enter_standout_mode (C_STR(CSI "7m")); - oa.set_exit_standout_mode (C_STR(CSI "27m")); + oa.set_enter_underline_mode (CSI "4m"); + oa.set_exit_underline_mode (CSI "24m"); + oa.set_enter_blink_mode (CSI "5m"); + oa.set_exit_blink_mode (CSI "25m"); + oa.set_enter_reverse_mode (CSI "7m"); + oa.set_exit_reverse_mode (CSI "27m"); + oa.set_enter_standout_mode (CSI "7m"); + oa.set_exit_standout_mode (CSI "27m"); oa.set_enter_secure_mode (0); - oa.set_exit_secure_mode (C_STR(CSI "28m")); + oa.set_exit_secure_mode (CSI "28m"); oa.set_enter_protected_mode (0); - oa.set_exit_protected_mode (C_STR(CSI "0m$<2>")); - oa.set_enter_crossed_out_mode (C_STR(CSI "9m")); - oa.set_exit_crossed_out_mode (C_STR(CSI "29m")); - oa.set_enter_dbl_underline_mode (C_STR(CSI "21m")); - oa.set_exit_dbl_underline_mode (C_STR(CSI "24m")); - oa.set_set_attributes (C_STR(CSI "0" - "%?%p1%p6%|%t;1%;" - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;$<2>")); - oa.set_exit_attribute_mode (C_STR(CSI "0m$<2>")); - oa.set_enter_alt_charset_mode (C_STR("\016")); - oa.set_exit_alt_charset_mode (C_STR("\017")); + oa.set_exit_protected_mode (CSI "0m$<2>"); + oa.set_enter_crossed_out_mode (CSI "9m"); + oa.set_exit_crossed_out_mode (CSI "29m"); + oa.set_enter_dbl_underline_mode (CSI "21m"); + oa.set_exit_dbl_underline_mode (CSI "24m"); + oa.set_set_attributes (CSI "0" + "%?%p1%p6%|%t;1%;" + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;$<2>"); + oa.set_exit_attribute_mode (CSI "0m$<2>"); + oa.set_enter_alt_charset_mode ("\016"); + oa.set_exit_alt_charset_mode ("\017"); oa.set_enter_pc_charset_mode (0); oa.set_exit_pc_charset_mode (0); - oa.set_a_foreground_color (C_STR(CSI "38;5;%p1%dm")); - oa.set_a_background_color (C_STR(CSI "48;5;%p1%dm")); + oa.set_a_foreground_color (CSI "38;5;%p1%dm"); + oa.set_a_background_color (CSI "48;5;%p1%dm"); oa.set_foreground_color (0); oa.set_background_color (0); oa.set_term_color_pair (0); - oa.set_orig_pair (C_STR(CSI "39;49m")); + oa.set_orig_pair (CSI "39;49m"); oa.set_orig_orig_colors (0); oa.initialize(); @@ -3319,7 +3317,7 @@ void FOptiAttrTest::teratermTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017$<2>") ); + , CSI "0;1m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3330,8 +3328,8 @@ void FOptiAttrTest::teratermTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>" CSI "38;5;4m" - CSI "48;5;15m") ); + , CSI "0m\017$<2>" CSI "38;5;4m" + CSI "48;5;15m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3342,8 +3340,7 @@ void FOptiAttrTest::teratermTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>" CSI "39;49m" - CSI "38;5;4m") ); + , CSI "0m$<2>" CSI "39;49m" CSI "38;5;4m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3352,7 +3349,7 @@ void FOptiAttrTest::teratermTest() to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "38;5;1m" CSI "48;5;0m") ); + , CSI "38;5;1m" CSI "48;5;0m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3361,7 +3358,7 @@ void FOptiAttrTest::teratermTest() to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "38;5;10m" CSI "48;5;4m") ); + , CSI "38;5;10m" CSI "48;5;4m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3371,7 +3368,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1m\017$<2>") ); + , CSI "0;1m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3379,7 +3376,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3387,7 +3384,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3395,7 +3392,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3403,7 +3400,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3411,7 +3408,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3419,7 +3416,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;4m\017$<2>") ); + , CSI "0;4m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3427,7 +3424,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3435,7 +3432,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;5m\017$<2>") ); + , CSI "0;5m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3443,7 +3440,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3451,7 +3448,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;7m\017$<2>") ); + , CSI "0;7m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3459,7 +3456,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3467,7 +3464,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;7m\017$<2>") ); + , CSI "0;1;7m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3475,7 +3472,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3483,7 +3480,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( to->encoded_char == ' ' ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3492,7 +3489,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3500,7 +3497,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3508,7 +3505,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3516,7 +3513,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>" CSI "9m") ); + , CSI "0m\017$<2>" CSI "9m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3524,7 +3521,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3532,7 +3529,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>" CSI "21m") ); + , CSI "0m\017$<2>" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3540,7 +3537,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3548,7 +3545,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\016$<2>") ); + , CSI "0m\016$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3556,7 +3553,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017" CSI "0m$<2>") ); + , "\017" CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3564,7 +3561,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m\017$<2>") ); + , CSI "0m\017$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3572,7 +3569,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>") ); + , CSI "0m$<2>") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3593,8 +3590,8 @@ void FOptiAttrTest::teratermTest() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0;1;4;7;5m\016$<2>" - CSI "9m" CSI "21m") ); + , CSI "0;1;4;7;5m\016$<2>" + CSI "9m" CSI "21m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3603,7 +3600,7 @@ void FOptiAttrTest::teratermTest() to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "38;5;6m" CSI "48;5;4m") ); + , CSI "38;5;6m" CSI "48;5;4m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3616,21 +3613,21 @@ void FOptiAttrTest::teratermTest() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Italic off to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Underline off to->attr.bit.underline = false; CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "24m" CSI "21m") ); + , CSI "24m" CSI "21m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3643,7 +3640,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3656,7 +3653,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "28m") ); + , CSI "28m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3664,8 +3661,8 @@ void FOptiAttrTest::teratermTest() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>" CSI "38;5;6m" CSI "48;5;4m" - "\016" CSI "9m" CSI "21m") ); + , CSI "0m$<2>" CSI "38;5;6m" CSI "48;5;4m" + "\016" CSI "9m" CSI "21m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3673,7 +3670,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "29m") ); + , CSI "29m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3681,7 +3678,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "24m") ); + , CSI "24m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3689,7 +3686,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR("\017") ); + , "\017") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3697,15 +3694,14 @@ void FOptiAttrTest::teratermTest() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "0m$<2>" CSI "38;5;6m" - CSI "48;5;4m") ); + , CSI "0m$<2>" CSI "38;5;6m" CSI "48;5;4m" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "38;5;2m") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), CSI "38;5;2m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3713,7 +3709,7 @@ void FOptiAttrTest::teratermTest() to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() - , C_STR("Esc [ 3 9 ; 4 9 m Esc [ 4 8 ; 5 ; 4 m ") ); + , "Esc [ 3 9 ; 4 9 m Esc [ 4 8 ; 5 ; 4 m ") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3761,24 +3757,24 @@ void FOptiAttrTest::ibmColorTest() oa.set_exit_pc_charset_mode (0); oa.set_a_foreground_color (0); oa.set_a_background_color (0); - oa.set_foreground_color (C_STR(CSI "%?%p1%{0}%=%t30m" - "%e%p1%{1}%=%t31m" - "%e%p1%{2}%=%t32m" - "%e%p1%{3}%=%t33m" - "%e%p1%{4}%=%t34m" - "%e%p1%{5}%=%t35m" - "%e%p1%{6}%=%t36m" - "%e%p1%{7}%=%t97m%;")); - oa.set_background_color (C_STR(CSI "%?%p1%{0}%=%t40m" - "%e%p1%{1}%=%t41m" - "%e%p1%{2}%=%t42m" - "%e%p1%{3}%=%t43m" - "%e%p1%{4}%=%t44m" - "%e%p1%{5}%=%t45m" - "%e%p1%{6}%=%t46m" - "%e%p1%{7}%=%t107m%;")); + oa.set_foreground_color (CSI "%?%p1%{0}%=%t30m" + "%e%p1%{1}%=%t31m" + "%e%p1%{2}%=%t32m" + "%e%p1%{3}%=%t33m" + "%e%p1%{4}%=%t34m" + "%e%p1%{5}%=%t35m" + "%e%p1%{6}%=%t36m" + "%e%p1%{7}%=%t97m%;"); + oa.set_background_color (CSI "%?%p1%{0}%=%t40m" + "%e%p1%{1}%=%t41m" + "%e%p1%{2}%=%t42m" + "%e%p1%{3}%=%t43m" + "%e%p1%{4}%=%t44m" + "%e%p1%{5}%=%t45m" + "%e%p1%{6}%=%t46m" + "%e%p1%{7}%=%t107m%;"); oa.set_term_color_pair (0); - oa.set_orig_pair (C_STR(CSI "32;40m")); + oa.set_orig_pair (CSI "32;40m"); oa.set_orig_orig_colors (0); oa.initialize(); @@ -3794,7 +3790,7 @@ void FOptiAttrTest::ibmColorTest() to->fg_color = finalcut::fc::Default; to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3805,7 +3801,7 @@ void FOptiAttrTest::ibmColorTest() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "31m" CSI "107m") ); + , CSI "31m" CSI "107m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3816,7 +3812,7 @@ void FOptiAttrTest::ibmColorTest() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "32;40m" CSI "31m") ); + , CSI "32;40m" CSI "31m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3825,7 +3821,7 @@ void FOptiAttrTest::ibmColorTest() to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "34m" CSI "40m") ); + , CSI "34m" CSI "40m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3834,7 +3830,7 @@ void FOptiAttrTest::ibmColorTest() to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "32m" CSI "41m") ); + , CSI "32m" CSI "41m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3844,105 +3840,105 @@ void FOptiAttrTest::ibmColorTest() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "32;40m") ); + , CSI "32;40m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold off (with default colors) to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Dim on (with default colors) to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Dim off (with default colors) to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Italic on (with default colors) to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Italic off (with default colors) to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Underline on (with default colors) to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Underline off (with default colors) to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blink on (with default colors) to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blink off (with default colors) to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Reverse on (with default colors) to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Reverse off (with default colors) to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Standout on (with default colors) to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Standout off (with default colors) to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Invisible on (with default colors) to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( to->encoded_char == ' ' ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -3950,77 +3946,77 @@ void FOptiAttrTest::ibmColorTest() // Invisible off (with default colors) to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Protect on (with default colors) to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Protect off (with default colors) to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Crossed out on (with default colors) to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Crossed out off (with default colors) to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Double underline on (with default colors) to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Double underline off (with default colors) to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Alternate character set on (with default colors) to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Alternate character set off (with default colors) to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // PC character set on (with default colors) to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // PC character set off (with default colors) to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4040,7 +4036,7 @@ void FOptiAttrTest::ibmColorTest() to->attr.bit.alt_charset = true; to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4049,28 +4045,28 @@ void FOptiAttrTest::ibmColorTest() to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "33m" CSI "41m") ); + , CSI "33m" CSI "41m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold off to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Dim off to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Italic off to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4082,14 +4078,14 @@ void FOptiAttrTest::ibmColorTest() // Blink off to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Reverse off to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4101,42 +4097,42 @@ void FOptiAttrTest::ibmColorTest() // Invisible off to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Protect off to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Crossed out off to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Double underline off to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Alternate character set off to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // PC character set off to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4144,7 +4140,7 @@ void FOptiAttrTest::ibmColorTest() to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(CSI "32m") ); + , CSI "32m") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4152,7 +4148,7 @@ void FOptiAttrTest::ibmColorTest() to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() - , C_STR("Esc [ 3 2 ; 4 0 m Esc [ 4 1 m ") ); + , "Esc [ 3 2 ; 4 0 m Esc [ 4 1 m ") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4169,58 +4165,58 @@ void FOptiAttrTest::wyse50Test() finalcut::FOptiAttr oa; finalcut::FOptiAttr::termEnv optiattr_env = { - 0, // Enter bold - C_STR(ESC "(" ESC "H\003" - ESC "G0" ESC "cD"), // Exit bold - C_STR(ESC "Gp"), // Enter dim - C_STR(ESC "(" ESC "H\003" - ESC "G0" ESC "cD"), // Exit dim - 0, // Enter italics - 0, // Exit italics - C_STR(ESC "G8"), // Enter underline - C_STR(ESC "G0"), // Exit underline - C_STR(ESC "G2"), // Enter blink - C_STR(ESC "(" ESC "H\003" - ESC "G0" ESC "cD"), // Exit blink - C_STR(ESC "G2"), // Enter reverse - C_STR(ESC "(" ESC "H\003" - ESC "G0" ESC "cD"), // Exit reverse - C_STR(ESC "Gt"), // Enter standout - C_STR(ESC "G0"), // Exit standout - C_STR(ESC "G1"), // Enter secure - C_STR(ESC "(" ESC "H\003" - ESC "G0" ESC "cD"), // Exit secure - C_STR(ESC ")"), // Enter protected - C_STR(ESC "(" ESC "H\003" - ESC "G0" ESC "cD"), // Exit protected - 0, // Enter crossed out - C_STR(ESC "(" ESC "H\003" - ESC "G0" ESC "cD"), // Exit crossed out - 0, // Enter double underline - 0, // Exit double underline - C_STR("%?%p8%t\033)%e\033(%;" - "%?%p9%t\033cE%e\033cD%;\033G%'0'" - "%?%p2%t%{8}%|%;" - "%?%p1%p3%|%p6%|%t%{4}%|%;" - "%?%p4%t%{2}%|%;" - "%?%p1%p5%|%t%'@'%|%;" - "%?%p7%t%{1}%|%;%c"), // Set attributes - C_STR(ESC "(" ESC "H\003" - ESC "G0" ESC "cD"), // Exit attribute - C_STR(ESC "cE"), // Enter alt charset - C_STR(ESC "cD"), // Exit alt charset - 0, // Enter pc charset - 0, // Exit pc charset - 0, // Ansi foreground color - 0, // Ansi background color - 0, // Foreground color - 0, // Background color - 0, // Term color pair - 0, // Orig pair - 0, // Orig orig colors - 1, // Max color - 0, // No color video - false // No ANSI default color + 0, // Enter bold + ESC "(" ESC "H\003" + ESC "G0" ESC "cD", // Exit bold + ESC "Gp", // Enter dim + ESC "(" ESC "H\003" + ESC "G0" ESC "cD", // Exit dim + 0, // Enter italics + 0, // Exit italics + ESC "G8", // Enter underline + ESC "G0", // Exit underline + ESC "G2", // Enter blink + ESC "(" ESC "H\003" + ESC "G0" ESC "cD", // Exit blink + ESC "G2", // Enter reverse + ESC "(" ESC "H\003" + ESC "G0" ESC "cD", // Exit reverse + ESC "Gt", // Enter standout + ESC "G0", // Exit standout + ESC "G1", // Enter secure + ESC "(" ESC "H\003" + ESC "G0" ESC "cD", // Exit secure + ESC ")", // Enter protected + ESC "(" ESC "H\003" + ESC "G0" ESC "cD", // Exit protected + 0, // Enter crossed out + ESC "(" ESC "H\003" + ESC "G0" ESC "cD", // Exit crossed out + 0, // Enter double underline + 0, // Exit double underline + "%?%p8%t\033)%e\033(%;" + "%?%p9%t\033cE%e\033cD%;\033G%'0'" + "%?%p2%t%{8}%|%;" + "%?%p1%p3%|%p6%|%t%{4}%|%;" + "%?%p4%t%{2}%|%;" + "%?%p1%p5%|%t%'@'%|%;" + "%?%p7%t%{1}%|%;%c", // Set attributes + ESC "(" ESC "H\003" + ESC "G0" ESC "cD", // Exit attribute + ESC "cE", // Enter alt charset + ESC "cD", // Exit alt charset + 0, // Enter pc charset + 0, // Exit pc charset + 0, // Ansi foreground color + 0, // Ansi background color + 0, // Foreground color + 0, // Background color + 0, // Term color pair + 0, // Orig pair + 0, // Orig orig colors + 1, // Max color + 0, // No color video + false // No ANSI default color }; oa.setTermEnvironment(optiattr_env); @@ -4237,7 +4233,7 @@ void FOptiAttrTest::wyse50Test() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G4") ); + , ESC "(" ESC "cD" ESC "G4") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4248,7 +4244,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "Gt") ); + , ESC "(" ESC "cD" ESC "Gt") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4259,7 +4255,7 @@ void FOptiAttrTest::wyse50Test() to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4267,7 +4263,7 @@ void FOptiAttrTest::wyse50Test() to->fg_color = finalcut::fc::Red; to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4275,7 +4271,7 @@ void FOptiAttrTest::wyse50Test() to->fg_color = finalcut::fc::SpringGreen3; to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4285,7 +4281,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G4") ); + , ESC "(" ESC "cD" ESC "G4") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4293,7 +4289,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.bold = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4301,7 +4297,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.dim = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "Gp") ); + , ESC "(" ESC "cD" ESC "Gp") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4309,7 +4305,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4317,7 +4313,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G0") ); + , ESC "(" ESC "cD" ESC "G0") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4325,7 +4321,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4333,7 +4329,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G8") ); + , ESC "(" ESC "cD" ESC "G8") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4341,7 +4337,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4349,7 +4345,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.blink = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G2") ); + , ESC "(" ESC "cD" ESC "G2") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4357,7 +4353,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4365,7 +4361,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.reverse = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G4") ); + , ESC "(" ESC "cD" ESC "G4") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4373,7 +4369,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4381,7 +4377,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.standout = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "Gt") ); + , ESC "(" ESC "cD" ESC "Gt") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4389,7 +4385,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4397,7 +4393,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.invisible = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G1") ); + , ESC "(" ESC "cD" ESC "G1") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4405,7 +4401,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4413,7 +4409,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.protect = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC ")" ESC "cD" ESC "G0") ); + , ESC ")" ESC "cD" ESC "G0" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4421,7 +4417,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4429,7 +4425,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.crossed_out = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G0") ); + , ESC "(" ESC "cD" ESC "G0") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4437,7 +4433,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4445,7 +4441,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.dbl_underline = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G0") ); + , ESC "(" ESC "cD" ESC "G0") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4453,7 +4449,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4461,7 +4457,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.alt_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cE" ESC "G0") ); + , ESC "(" ESC "cE" ESC "G0") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4469,8 +4465,8 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "cD" ESC "(" ESC "H\003" ESC "G0" - ESC "cD") ); + , ESC "cD" ESC "(" ESC "H\003" ESC "G0" + ESC "cD" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4478,7 +4474,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "cD" ESC "G0") ); + , ESC "(" ESC "cD" ESC "G0") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4486,7 +4482,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4507,7 +4503,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.pc_charset = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC ")" ESC "cE" ESC "G\177") ); + , ESC ")" ESC "cE" ESC "G\177") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4515,7 +4511,7 @@ void FOptiAttrTest::wyse50Test() to->fg_color = finalcut::fc::Cyan; to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4524,9 +4520,9 @@ void FOptiAttrTest::wyse50Test() CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD" - ESC "cE" ESC "Gp" ESC "G8" ESC "G2" - ESC "G2" ESC "Gt" ESC "G1" ESC ")" ) ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD" + ESC "cE" ESC "Gp" ESC "G8" ESC "G2" + ESC "G2" ESC "Gt" ESC "G1" ESC ")" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4534,16 +4530,16 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.dim = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD" - ESC "cE" ESC "G8" ESC "G2" ESC "G2" - ESC "Gt" ESC "G1" ESC ")" ) ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD" + ESC "cE" ESC "G8" ESC "G2" ESC "G2" + ESC "Gt" ESC "G1" ESC ")" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Italic off to->attr.bit.italic = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4551,8 +4547,8 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.underline = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "G0" ESC "cE" ESC "G2" ESC "G2" - ESC "Gt" ESC "G1" ESC ")" ) ); + , ESC "G0" ESC "cE" ESC "G2" ESC "G2" + ESC "Gt" ESC "G1" ESC ")" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4560,9 +4556,9 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.blink = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD" - ESC "cE" ESC "G2" ESC "Gt" ESC "G1" - ESC ")" ) ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD" + ESC "cE" ESC "G2" ESC "Gt" ESC "G1" + ESC ")" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4570,8 +4566,8 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.reverse = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD" - ESC "cE" ESC "Gt" ESC "G1" ESC ")" ) ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD" + ESC "cE" ESC "Gt" ESC "G1" ESC ")" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4579,7 +4575,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.standout = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "G0" ESC "cE" ESC "G1" ESC ")") ); + , ESC "G0" ESC "cE" ESC "G1" ESC ")") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4587,8 +4583,8 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.invisible = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD" - ESC "cE" ESC ")" ) ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD" + ESC "cE" ESC ")" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4596,8 +4592,8 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.protect = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD" - ESC "cE") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD" + ESC "cE" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4605,22 +4601,22 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.crossed_out = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD" - ESC "cE") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD" + ESC "cE" ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Double underline off to->attr.bit.dbl_underline = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Alternate character set off to->attr.bit.alt_charset = false; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(ESC "cD") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -4628,14 +4624,14 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.pc_charset = false; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) - , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); + , ESC "(" ESC "H\003" ESC "G0" ESC "cD") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); - CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), "") ; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); diff --git a/test/foptimove-test.cpp b/test/foptimove-test.cpp index 559bb888..deaed59e 100644 --- a/test/foptimove-test.cpp +++ b/test/foptimove-test.cpp @@ -117,8 +117,8 @@ void FOptiMoveTest::classNameTest() void FOptiMoveTest::noArgumentTest() { finalcut::FOptiMove om; - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 1, 5, 5), C_STR(CSI "6;6H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 9, 9), C_STR(CSI "10;10H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 1, 5, 5), CSI "6;6H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 9, 9), CSI "10;10H"); // Delete all presets om.set_tabular (0); @@ -147,22 +147,22 @@ void FOptiMoveTest::homeTest() int baud = 4800; finalcut::FOptiMove om(baud); om.setTermSize (80, 24); - om.set_cursor_home (C_STR(CSI "H")); - om.set_cursor_to_ll (C_STR(CSI "X")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(CSI "A")); - om.set_cursor_down (C_STR(CSI "B")); - om.set_cursor_right (C_STR(CSI "C")); - om.set_cursor_left (C_STR(CSI "D")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_cursor_home (CSI "H"); + om.set_cursor_to_ll (CSI "X"); + om.set_carriage_return ("\r"); + om.set_cursor_up (CSI "A"); + om.set_cursor_down (CSI "B"); + om.set_cursor_right (CSI "C"); + om.set_cursor_left (CSI "D"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); // Upper home (first line, first column) - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 10, 0, 0), C_STR(CSI "H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 10, 0, 0), CSI "H"); // Lower home (last line, first column) - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 10, 0, 23), C_STR(CSI "X")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 10, 0, 23), CSI "X"); } //---------------------------------------------------------------------- @@ -174,21 +174,21 @@ void FOptiMoveTest::fromLeftToRightTest() om.setTabStop (8); om.set_auto_left_margin (true); om.set_eat_newline_glitch (false); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(ESC "M")); - om.set_cursor_down (C_STR(ESC "D")); - om.set_cursor_right (C_STR(CSI "C")); - om.set_cursor_left (C_STR("\b")); - om.set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH")); - om.set_column_address (C_STR(CSI "%i%p1%dG")); - om.set_row_address (C_STR(CSI "%i%p1%dd")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_carriage_return ("\r"); + om.set_cursor_up (ESC "M"); + om.set_cursor_down (ESC "D"); + om.set_cursor_right (CSI "C"); + om.set_cursor_left ("\b"); + om.set_cursor_address (CSI "%i%p1%d;%p2%dH"); + om.set_column_address (CSI "%i%p1%dG"); + om.set_row_address (CSI "%i%p1%dd"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 1), C_STR("\r\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR("\r\b" ESC "D")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 1), "\r\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), "\r\b" ESC "D"); } //---------------------------------------------------------------------- @@ -198,55 +198,55 @@ void FOptiMoveTest::ansiTest() om.setTermSize (80, 25); om.setBaudRate (19200); om.setTabStop (8); - om.set_tabular (C_STR("\t")); - om.set_back_tab (C_STR(CSI "Z")); - om.set_cursor_home (C_STR(CSI "H")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(CSI "A")); - om.set_cursor_down (C_STR(CSI "B")); - om.set_cursor_right (C_STR(CSI "C")); - om.set_cursor_left (C_STR(CSI "D")); - om.set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH")); - om.set_column_address (C_STR(CSI "%i%p1%dG")); - om.set_row_address (C_STR(CSI "%i%p1%dd")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_tabular ("\t"); + om.set_back_tab (CSI "Z"); + om.set_cursor_home (CSI "H"); + om.set_carriage_return ("\r"); + om.set_cursor_up (CSI "A"); + om.set_cursor_down (CSI "B"); + om.set_cursor_right (CSI "C"); + om.set_cursor_left (CSI "D"); + om.set_cursor_address (CSI "%i%p1%d;%p2%dH"); + om.set_column_address (CSI "%i%p1%dG"); + om.set_row_address (CSI "%i%p1%dd"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(CSI "6;6H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR(CSI "H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r" CSI "B")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR(CSI "C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR(CSI "D")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR(CSI "12G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR(CSI "10G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR("\t")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR(CSI "B")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR(CSI "A")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR(CSI "3d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR(CSI "1d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(CSI "21;76H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(CSI "Z")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\r\t")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), CSI "6;6H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), CSI "H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r" CSI "B"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), CSI "C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), CSI "D"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), CSI "12G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), CSI "10G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), "\t"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), CSI "B"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), CSI "A"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), CSI "3d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), CSI "1d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), CSI "21;76H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), CSI "Z"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\r\t"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(CSI "11;80H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(CSI "11;51H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), CSI "11;80H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), CSI "11;51H"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(CSI "11;24H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(CSI "11;13H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), CSI "11;24H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), CSI "11;13H"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 53, 40), C_STR(CSI "25d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR(CSI "1d")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 53, 40), CSI "25d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), CSI "1d"); } //---------------------------------------------------------------------- @@ -257,52 +257,52 @@ void FOptiMoveTest::vt100Test() om.setBaudRate (1200); om.setTabStop (8); om.set_eat_newline_glitch (true); - om.set_tabular (C_STR("\t")); - om.set_cursor_home (C_STR(CSI "H")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(CSI "A$<2>")); - om.set_cursor_down (C_STR("\n")); - om.set_cursor_right (C_STR(CSI "C$<2>")); - om.set_cursor_left (C_STR("\b")); - om.set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH$<5>")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_tabular ("\t"); + om.set_cursor_home (CSI "H"); + om.set_carriage_return ("\r"); + om.set_cursor_up (CSI "A$<2>"); + om.set_cursor_down ("\n"); + om.set_cursor_right (CSI "C$<2>"); + om.set_cursor_left ("\b"); + om.set_cursor_address (CSI "%i%p1%d;%p2%dH$<5>"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(CSI "6;6H$<5>")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR(CSI "H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR(CSI "C$<2>")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR(CSI "2C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR("\b\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR("\t")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR(CSI "A$<2>")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR("\n\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR(CSI "2A")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR(CSI "76C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(CSI "21;76H$<5>")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(CSI "7D")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\b\b")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), CSI "6;6H$<5>"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), CSI "H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), CSI "C$<2>"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), "\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), CSI "2C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), "\b\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), "\t"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), CSI "A$<2>"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), "\n\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), CSI "2A"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), CSI "76C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), CSI "21;76H$<5>"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), CSI "7D"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\b\b"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(CSI "11;80H$<5>")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(CSI "11;51H$<5>")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), CSI "11;80H$<5>"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), CSI "11;51H$<5>"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(CSI "11;24H$<5>")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(CSI "11;13H$<5>")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), CSI "11;24H$<5>"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), CSI "11;13H$<5>"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR(CSI "26C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), CSI "26C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 53, 40), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR(CSI "2A")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 53, 40), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), CSI "2A"); } //---------------------------------------------------------------------- @@ -313,55 +313,55 @@ void FOptiMoveTest::xtermTest() om.setBaudRate (38400); om.setTabStop (8); om.set_eat_newline_glitch (true); - om.set_tabular (C_STR("\t")); - om.set_back_tab (C_STR(CSI "Z")); - om.set_cursor_home (C_STR(CSI "H")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(CSI "A")); - om.set_cursor_down (C_STR("\n")); - om.set_cursor_right (C_STR(CSI "C")); - om.set_cursor_left (C_STR("\b")); - om.set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH")); - om.set_column_address (C_STR(CSI "%i%p1%dG")); - om.set_row_address (C_STR(CSI "%i%p1%dd")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_tabular ("\t"); + om.set_back_tab (CSI "Z"); + om.set_cursor_home (CSI "H"); + om.set_carriage_return ("\r"); + om.set_cursor_up (CSI "A"); + om.set_cursor_down ("\n"); + om.set_cursor_right (CSI "C"); + om.set_cursor_left ("\b"); + om.set_cursor_address (CSI "%i%p1%d;%p2%dH"); + om.set_column_address (CSI "%i%p1%dG"); + om.set_row_address (CSI "%i%p1%dd"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(CSI "6;6H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR(CSI "H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR(CSI "C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR(CSI "12G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR("\b\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR("\t")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR(CSI "A")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR("\n\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR(CSI "1d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(CSI "21;76H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(CSI "Z")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\r\t")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), CSI "6;6H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), CSI "H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), CSI "C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), "\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), CSI "12G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), "\b\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), "\t"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), CSI "A"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), "\n\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), CSI "1d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), CSI "21;76H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), CSI "Z"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\r\t"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(CSI "11;80H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(CSI "11;51H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), CSI "11;80H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), CSI "11;51H"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(CSI "11;24H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(CSI "11;13H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), CSI "11;24H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), CSI "11;13H"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR(CSI "1d")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), CSI "1d"); } //---------------------------------------------------------------------- @@ -372,54 +372,54 @@ void FOptiMoveTest::rxvtTest() om.setBaudRate (38400); om.setTabStop (8); om.set_eat_newline_glitch (true); - om.set_tabular (C_STR("\t")); - om.set_cursor_home (C_STR(CSI "H")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(CSI "A")); - om.set_cursor_down (C_STR("\n")); - om.set_cursor_right (C_STR(CSI "C")); - om.set_cursor_left (C_STR("\b")); - om.set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH")); - om.set_column_address (C_STR(CSI "%i%p1%dG")); - om.set_row_address (C_STR(CSI "%i%p1%dd")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_tabular ("\t"); + om.set_cursor_home (CSI "H"); + om.set_carriage_return ("\r"); + om.set_cursor_up (CSI "A"); + om.set_cursor_down ("\n"); + om.set_cursor_right (CSI "C"); + om.set_cursor_left ("\b"); + om.set_cursor_address (CSI "%i%p1%d;%p2%dH"); + om.set_column_address (CSI "%i%p1%dG"); + om.set_row_address (CSI "%i%p1%dd"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(CSI "6;6H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR(CSI "H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR(CSI "C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR(CSI "12G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR("\b\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR("\t")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR(CSI "A")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR("\n\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR(CSI "1d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(CSI "21;76H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(CSI "33G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\b\b")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), CSI "6;6H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), CSI "H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), CSI "C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), "\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), CSI "12G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), "\b\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), "\t"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), CSI "A"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), "\n\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), CSI "1d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), CSI "21;76H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), CSI "33G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\b\b"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(CSI "11;80H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(CSI "11;51H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), CSI "11;80H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), CSI "11;51H"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(CSI "11;24H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(CSI "11;13H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), CSI "11;24H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), CSI "11;13H"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR(CSI "1d")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), CSI "1d"); } //---------------------------------------------------------------------- @@ -430,55 +430,55 @@ void FOptiMoveTest::linuxTest() om.setBaudRate (38400); om.setTabStop (8); om.set_eat_newline_glitch (true); - om.set_tabular (C_STR("\t")); - om.set_back_tab (C_STR(CSI "Z")); - om.set_cursor_home (C_STR(CSI "H")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(CSI "A")); - om.set_cursor_down (C_STR("\n")); - om.set_cursor_right (C_STR(CSI "C")); - om.set_cursor_left (C_STR("\b")); - om.set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH")); - om.set_column_address (C_STR(CSI "%i%p1%dG")); - om.set_row_address (C_STR(CSI "%i%p1%dd")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_tabular ("\t"); + om.set_back_tab (CSI "Z"); + om.set_cursor_home (CSI "H"); + om.set_carriage_return ("\r"); + om.set_cursor_up (CSI "A"); + om.set_cursor_down ("\n"); + om.set_cursor_right (CSI "C"); + om.set_cursor_left ("\b"); + om.set_cursor_address (CSI "%i%p1%d;%p2%dH"); + om.set_column_address (CSI "%i%p1%dG"); + om.set_row_address (CSI "%i%p1%dd"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(CSI "6;6H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR(CSI "H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR(CSI "C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR(CSI "12G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR("\b\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR("\t")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR(CSI "A")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR("\n\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR(CSI "1d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(CSI "21;76H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(CSI "Z")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\r\t")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), CSI "6;6H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), CSI "H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), CSI "C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), "\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), CSI "12G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), "\b\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), "\t"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), CSI "A"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), "\n\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), CSI "1d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), CSI "21;76H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), CSI "Z"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\r\t"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(CSI "11;80H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(CSI "11;51H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), CSI "11;80H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), CSI "11;51H"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(CSI "11;24H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(CSI "11;13H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), CSI "11;24H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), CSI "11;13H"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR(CSI "1d")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), CSI "1d"); } //---------------------------------------------------------------------- @@ -488,57 +488,57 @@ void FOptiMoveTest::cygwinTest() om.setTermSize (80, 25); om.setBaudRate (38400); om.setTabStop (8); - om.set_tabular (C_STR("\t")); - om.set_back_tab (C_STR(CSI "Z")); - om.set_cursor_home (C_STR(CSI "H")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(CSI "A")); - om.set_cursor_down (C_STR(CSI "B")); - om.set_cursor_right (C_STR(CSI "C")); - om.set_cursor_left (C_STR("\b")); - om.set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH")); - om.set_column_address (C_STR(CSI "%i%p1%dG")); - om.set_row_address (C_STR(CSI "%i%p1%dd")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_tabular ("\t"); + om.set_back_tab (CSI "Z"); + om.set_cursor_home (CSI "H"); + om.set_carriage_return ("\r"); + om.set_cursor_up (CSI "A"); + om.set_cursor_down (CSI "B"); + om.set_cursor_right (CSI "C"); + om.set_cursor_left ("\b"); + om.set_cursor_address (CSI "%i%p1%d;%p2%dH"); + om.set_column_address (CSI "%i%p1%dG"); + om.set_row_address (CSI "%i%p1%dd"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); CPPUNIT_ASSERT_CSTRING ( printSequence(om.moveCursor (1, 2, 3, 4)).c_str() - , C_STR("Esc [ 5 ; 4 H ") ); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(CSI "6;6H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR(CSI "H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r" CSI "B")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR(CSI "C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR(CSI "12G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR("\b\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR("\t")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR(CSI "B")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR(CSI "A")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR(CSI "3d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR(CSI "1d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(CSI "21;76H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(CSI "Z")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\r\t")); + , "Esc [ 5 ; 4 H ") ; + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), CSI "6;6H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), CSI "H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r" CSI "B"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), CSI "C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), "\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), CSI "12G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), "\b\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), "\t"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), CSI "B"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), CSI "A"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), CSI "3d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), CSI "1d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), CSI "21;76H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), CSI "Z"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\r\t"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(CSI "11;80H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(CSI "11;51H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), CSI "11;80H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), CSI "11;51H"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(CSI "11;24H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(CSI "11;13H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), CSI "11;24H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), CSI "11;13H"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), C_STR(CSI "B")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR(CSI "1d")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), CSI "B"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), CSI "1d"); } //---------------------------------------------------------------------- @@ -550,55 +550,55 @@ void FOptiMoveTest::puttyTest() om.setTabStop (8); om.set_auto_left_margin (true); om.set_eat_newline_glitch (true); - om.set_tabular (C_STR("\t")); - om.set_back_tab (C_STR(CSI "Z")); - om.set_cursor_home (C_STR(CSI "H")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR(ESC "M")); - om.set_cursor_down (C_STR(ESC "D")); - om.set_cursor_right (C_STR(CSI "C")); - om.set_cursor_left (C_STR("\b")); - om.set_cursor_address (C_STR(CSI "%i%p1%d;%p2%dH")); - om.set_column_address (C_STR(CSI "%i%p1%dG")); - om.set_row_address (C_STR(CSI "%i%p1%dd")); - om.set_parm_up_cursor (C_STR(CSI "%p1%dA")); - om.set_parm_down_cursor (C_STR(CSI "%p1%dB")); - om.set_parm_right_cursor (C_STR(CSI "%p1%dC")); - om.set_parm_left_cursor (C_STR(CSI "%p1%dD")); + om.set_tabular ("\t"); + om.set_back_tab (CSI "Z"); + om.set_cursor_home (CSI "H"); + om.set_carriage_return ("\r"); + om.set_cursor_up (ESC "M"); + om.set_cursor_down (ESC "D"); + om.set_cursor_right (CSI "C"); + om.set_cursor_left ("\b"); + om.set_cursor_address (CSI "%i%p1%d;%p2%dH"); + om.set_column_address (CSI "%i%p1%dG"); + om.set_row_address (CSI "%i%p1%dd"); + om.set_parm_up_cursor (CSI "%p1%dA"); + om.set_parm_down_cursor (CSI "%p1%dB"); + om.set_parm_right_cursor (CSI "%p1%dC"); + om.set_parm_left_cursor (CSI "%p1%dD"); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(CSI "6;6H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR(CSI "H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r" ESC "D")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR(CSI "C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR(CSI "12G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR("\b\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR("\t")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR(ESC "D")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR(ESC "M")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR(ESC "D" ESC "D")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR(ESC "M" ESC "M")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(CSI "21;76H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(CSI "Z")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\r\t")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), CSI "6;6H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), CSI "H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r" ESC "D"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), CSI "C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), "\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), CSI "12G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), "\b\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), "\t"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), ESC "D"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), ESC "M"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), ESC "D" ESC "D"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), ESC "M" ESC "M"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), CSI "21;76H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), CSI "Z"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\r\t"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(CSI "11;80H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(CSI "11;51H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), CSI "11;80H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), CSI "11;51H"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(CSI "11;24H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(CSI "11;13H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), CSI "11;24H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), CSI "11;13H"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), C_STR(ESC "D")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR(ESC "M" ESC "M")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), ESC "D"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), ESC "M" ESC "M"); } //---------------------------------------------------------------------- @@ -610,26 +610,26 @@ void FOptiMoveTest::teratermTest() finalcut::FOptiMove::termEnv optimove_env = { - C_STR(CSI "H"), // Cursor home - C_STR("\r"), // Carriage return + CSI "H", // Cursor home + "\r", // Carriage return 0, // Cursor to ll - C_STR("\t"), // Tabular + "\t", // Tabular 0, // Back tabular - C_STR(CSI "A"), // Cursor up - C_STR("\n"), // Cursor down - C_STR("\b"), // Cursor left - C_STR(CSI "C"), // Cursor right - C_STR(CSI "%i%p1%d;%p2%dH"), // Cursor address - C_STR(CSI "%i%p1%dG"), // Column address - C_STR(CSI "%i%p1%dd"), // Row address - C_STR(CSI "%p1%dA"), // Parm up cursor - C_STR(CSI "%p1%dB"), // Parm down cursor - C_STR(CSI "%p1%dD"), // Parm left cursor - C_STR(CSI "%p1%dC"), // Parm right cursor - C_STR(CSI "%p1%dX"), // Erase characters + CSI "A", // Cursor up + "\n", // Cursor down + "\b", // Cursor left + CSI "C", // Cursor right + CSI "%i%p1%d;%p2%dH", // Cursor address + CSI "%i%p1%dG", // Column address + CSI "%i%p1%dd", // Row address + CSI "%p1%dA", // Parm up cursor + CSI "%p1%dB", // Parm down cursor + CSI "%p1%dD", // Parm left cursor + CSI "%p1%dC", // Parm right cursor + CSI "%p1%dX", // Erase characters 0, // Repeat character - C_STR(CSI "1K"), // Clear to beginning of line - C_STR(CSI "K"), // Clear to end of line + CSI "1K", // Clear to beginning of line + CSI "K", // Clear to end of line 8, // Tab stop false, // Automatic left margin true // Eat newline glitch @@ -637,39 +637,39 @@ void FOptiMoveTest::teratermTest() om.setTermEnvironment(optimove_env); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(CSI "6;6H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR(CSI "H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR(CSI "C")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR(CSI "12G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR("\b\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR("\t")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR(CSI "A")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR("\n\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR(CSI "1d")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(CSI "21;76H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(CSI "33G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\b\b")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), CSI "6;6H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), CSI "H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), CSI "C"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), "\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), CSI "12G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), "\b\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), "\t"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), CSI "A"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), "\n\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), CSI "1d"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), CSI "21;76H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), CSI "33G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\b\b"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(CSI "11;80H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(CSI "11;51H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), CSI "11;80H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), CSI "11;51H"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(CSI "11;24H")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(CSI "11;13H")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), CSI "11;24H"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), CSI "11;13H"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR(CSI "80G")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), CSI "80G"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR(CSI "1d")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), CSI "1d"); } @@ -680,54 +680,54 @@ void FOptiMoveTest::wyse50Test() om.setTermSize (80, 25); om.setBaudRate (38400); om.set_auto_left_margin (true); - om.set_tabular (C_STR("\t")); - om.set_back_tab (C_STR(ESC "I")); - om.set_cursor_home (C_STR("\036")); - om.set_cursor_to_ll (C_STR("\036\v")); - om.set_carriage_return (C_STR("\r")); - om.set_cursor_up (C_STR("\v")); - om.set_cursor_down (C_STR("\n")); - om.set_cursor_right (C_STR("\f")); - om.set_cursor_left (C_STR("\b")); - om.set_cursor_address (C_STR(ESC "=%p1%' '%+%c%p2%' '%+%c")); + om.set_tabular ("\t"); + om.set_back_tab (ESC "I"); + om.set_cursor_home ("\036"); + om.set_cursor_to_ll ("\036\v"); + om.set_carriage_return ("\r"); + om.set_cursor_up ("\v"); + om.set_cursor_down ("\n"); + om.set_cursor_right ("\f"); + om.set_cursor_left ("\b"); + om.set_cursor_address (ESC "=%p1%' '%+%c%p2%' '%+%c"); //std::cout << "\nSequence: " // << printSequence(om.moveCursor (1, 2, 3, 4)) // << "\n"; - CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(ESC "=%%")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR("\036")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR("\f")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR("\f\f")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), C_STR("\b\b")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), C_STR(ESC "= (")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), C_STR("\v")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), C_STR("\n\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), C_STR("\v\v")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), C_STR("\r\b\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), C_STR(ESC "=4k")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), C_STR(ESC "= @")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), C_STR("\b\b")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), ESC "=%%"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), "\036"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), "\r"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), "\r\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), "\f"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), "\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), "\f\f"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (11, 4, 9, 4), "\b\b"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 0, 8, 0), ESC "= ("); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 1), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 1, 16, 0), "\v"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 0, 16, 2), "\n\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (16, 2, 16, 0), "\v\v"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 2, 79, 2), "\r\b\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 75, 20), ESC "=4k"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (39, 0, 32, 0), ESC "= @"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 0, 8, 0), "\b\b"); // xold is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), C_STR(ESC "=*o")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), C_STR(ESC "=*R")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (99, 10, 79, 10), ESC "=*o"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (-3, 33, 50, 10), ESC "=*R"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), C_STR(ESC "=*7")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), C_STR(ESC "=*,")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, 33, 23, 10), ESC "=*7"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (23, -3, 12, 10), ESC "=*,"); // xnew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), C_STR("\r\b\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), C_STR("\r")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 22, 100, 22), "\r\b\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (3, 22, -5, 22), "\r"); // ynew is outside screen - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), C_STR("\n")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), C_STR("\v\v")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 23, 53, 40), "\n"); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (53, 2, 53, -3), "\v\v"); } //---------------------------------------------------------------------- diff --git a/test/fstring-test.cpp b/test/fstring-test.cpp index 377f391e..74cf4647 100644 --- a/test/fstring-test.cpp +++ b/test/fstring-test.cpp @@ -484,6 +484,9 @@ void FStringTest::additionTest() { // finalcut::FString member operator const finalcut::FString s1("abc"); + CPPUNIT_ASSERT ( s1.getLength() == 3 ); + CPPUNIT_ASSERT ( *(s1.c_str() + s1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(s1.wc_str() + s1.getLength()) == L'\0' ); CPPUNIT_ASSERT ( s1 + finalcut::FString("def") == L"abcdef" ); CPPUNIT_ASSERT ( s1 + std::wstring(L"def") == L"abcdef" ); CPPUNIT_ASSERT ( s1 + const_cast(L"def") == L"abcdef" ); @@ -492,8 +495,12 @@ void FStringTest::additionTest() CPPUNIT_ASSERT ( s1 + wchar_t(L'd') == L"abcd" ); CPPUNIT_ASSERT ( s1 + char('d') == L"abcd" ); + // finalcut::FString non-member operator finalcut::FString s2("abc"); + CPPUNIT_ASSERT ( s2.getLength() == 3 ); + CPPUNIT_ASSERT ( *(s2.c_str() + s2.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(s2.wc_str() + s2.getLength()) == L'\0' ); CPPUNIT_ASSERT ( s2 + finalcut::FString("def") == L"abcdef" ); CPPUNIT_ASSERT ( s2 + std::wstring(L"def") == L"abcdef" ); CPPUNIT_ASSERT ( s2 + const_cast(L"def") == L"abcdef" ); @@ -541,12 +548,16 @@ void FStringTest::equalTest() finalcut::FString fs = s1; const std::string s2 = fs.toString(); CPPUNIT_ASSERT ( s1 == s2 ); + CPPUNIT_ASSERT ( s1.size() == 6 ); + CPPUNIT_ASSERT ( *(s1.c_str() + s1.size()) == '\0' ); // std::wstring -> finalcut::FString -> std::wstring const std::wstring ws1 = L"wide string"; fs = ws1; std::wstring ws2 = fs.wc_str(); CPPUNIT_ASSERT ( ws1 == ws2 ); + CPPUNIT_ASSERT ( ws1.size() == 11 ); + CPPUNIT_ASSERT ( *(ws1.c_str() + ws1.size()) == L'\0' ); const finalcut::FString one_char('a'); constexpr char ch = 'a'; @@ -803,6 +814,9 @@ void FStringTest::streamInsertionTest() finalcut::FString out; out << finalcut::FString("ABC"); CPPUNIT_ASSERT ( out == L"ABC" ); + CPPUNIT_ASSERT ( out.getLength() == 3 ); + CPPUNIT_ASSERT ( *(out.c_str() + out.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(out.wc_str() + out.getLength()) == L'\0' ); out.clear(); out << std::string("ABC"); @@ -949,6 +963,9 @@ void FStringTest::streamExtractionTest() finalcut::FString in_1; finalcut::FString("ABC") >> in_1; CPPUNIT_ASSERT ( in_1 == "ABC" ); + CPPUNIT_ASSERT ( in_1.getLength() == 3 ); + CPPUNIT_ASSERT ( *(in_1.c_str() + in_1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(in_1.wc_str() + in_1.getLength()) == L'\0' ); std::wstring in_2; finalcut::FString("ABC") >> in_2; @@ -1024,6 +1041,9 @@ void FStringTest::subscriptOperatorTest() CPPUNIT_ASSERT ( s[2] == L'C' ); CPPUNIT_ASSERT ( s[3] == L'\0' ); // pos == size CPPUNIT_ASSERT ( s == L"ABC" ); + CPPUNIT_ASSERT ( s.getLength() == 3 ); + CPPUNIT_ASSERT ( *(s.c_str() + s.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(s.wc_str() + s.getLength()) == L'\0' ); } //---------------------------------------------------------------------- @@ -1370,23 +1390,39 @@ void FStringTest::exceptionTest() void FStringTest::trimTest() { const finalcut::FString& trim_str1 = L"\r\n\t A string \n\t"; + CPPUNIT_ASSERT ( trim_str1.getLength() == 16 ); + CPPUNIT_ASSERT ( *(trim_str1.c_str() + trim_str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(trim_str1.wc_str() + trim_str1.getLength()) == L'\0' ); CPPUNIT_ASSERT ( trim_str1.rtrim() == L"\r\n\t A string" ); + CPPUNIT_ASSERT ( trim_str1.rtrim().getLength() == 13 ); + CPPUNIT_ASSERT ( *(trim_str1.rtrim().c_str() + trim_str1.rtrim().getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(trim_str1.rtrim().wc_str() + trim_str1.rtrim().getLength()) == L'\0' ); CPPUNIT_ASSERT ( trim_str1.ltrim() == L"A string \n\t" ); + CPPUNIT_ASSERT ( trim_str1.ltrim().getLength() == 11 ); + CPPUNIT_ASSERT ( *(trim_str1.ltrim().c_str() + trim_str1.ltrim().getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(trim_str1.ltrim().wc_str() + trim_str1.ltrim().getLength()) == L'\0' ); CPPUNIT_ASSERT ( trim_str1.trim() == L"A string" ); + CPPUNIT_ASSERT ( trim_str1.trim().getLength() == 8 ); + CPPUNIT_ASSERT ( *(trim_str1.trim().c_str() + trim_str1.trim().getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(trim_str1.trim().wc_str() + trim_str1.trim().getLength()) == L'\0' ); const finalcut::FString& trim_str2 = L"\n \n\n"; CPPUNIT_ASSERT ( trim_str2.rtrim().isEmpty() ); CPPUNIT_ASSERT ( ! trim_str2.rtrim().isNull() ); CPPUNIT_ASSERT ( trim_str2.rtrim().getLength() == 0 ); CPPUNIT_ASSERT ( trim_str2.rtrim().capacity() == 0 ); + CPPUNIT_ASSERT ( *(trim_str2.rtrim().c_str() + trim_str2.rtrim().getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(trim_str2.rtrim().wc_str() + trim_str2.rtrim().getLength()) == L'\0' ); CPPUNIT_ASSERT ( trim_str2.ltrim().isEmpty() ); CPPUNIT_ASSERT ( ! trim_str2.ltrim().isNull() ); CPPUNIT_ASSERT ( trim_str2.ltrim().getLength() == 0 ); CPPUNIT_ASSERT ( trim_str2.ltrim().capacity() == 0 ); + CPPUNIT_ASSERT ( *(trim_str2.ltrim().c_str() + trim_str2.ltrim().getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(trim_str2.ltrim().wc_str() + trim_str2.ltrim().getLength()) == L'\0' ); const finalcut::FString trim_str3{}; CPPUNIT_ASSERT ( trim_str3.ltrim().isEmpty() ); - CPPUNIT_ASSERT ( trim_str3.ltrim().isEmpty() ); + CPPUNIT_ASSERT ( trim_str3.ltrim().isNull() ); CPPUNIT_ASSERT ( trim_str3.ltrim().getLength() == 0 ); CPPUNIT_ASSERT ( trim_str3.ltrim().capacity() == 0 ); CPPUNIT_ASSERT ( trim_str3.rtrim().isEmpty() ); @@ -1405,36 +1441,52 @@ void FStringTest::subStringTest() finalcut::FString str1("Look behind you, a three-headed monkey!"); CPPUNIT_ASSERT ( str1.left(uInt(11)) == L"Look behind" ); CPPUNIT_ASSERT ( str1.left(int(11)) == L"Look behind" ); + CPPUNIT_ASSERT ( str1.left(11).getLength() == 11 ); + CPPUNIT_ASSERT ( *(str1.left(11).c_str() + str1.left(11).getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.left(11).wc_str() + str1.left(11).getLength()) == L'\0' ); CPPUNIT_ASSERT ( str1.left(999) == L"Look behind you, a three-headed monkey!" ); + CPPUNIT_ASSERT ( str1.left(999).getLength() == 39 ); CPPUNIT_ASSERT ( str1.left(-5) == L"Look behind you, a three-headed monkey!" ); + CPPUNIT_ASSERT ( str1.left(-5).getLength() == 39 ); CPPUNIT_ASSERT ( str1.left(0) == L"" ); CPPUNIT_ASSERT ( str1.left(0).isEmpty() ); CPPUNIT_ASSERT ( ! str1.left(0).isNull() ); CPPUNIT_ASSERT ( finalcut::FString().left(5).isNull() ); CPPUNIT_ASSERT ( ! finalcut::FString("").left(5).isNull() ); CPPUNIT_ASSERT ( finalcut::FString("").left(5).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString("").left(5).getLength() == 0 ); CPPUNIT_ASSERT ( str1.right(uInt(7)) == L"monkey!" ); CPPUNIT_ASSERT ( str1.right(int(7)) == L"monkey!" ); + CPPUNIT_ASSERT ( str1.right(7).getLength() == 7 ); + CPPUNIT_ASSERT ( *(str1.right(7).c_str() + str1.right(7).getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.right(7).wc_str() + str1.right(7).getLength()) == L'\0' ); CPPUNIT_ASSERT ( str1.right(999) == L"Look behind you, a three-headed monkey!" ); + CPPUNIT_ASSERT ( str1.right(999).getLength() == 39 ); CPPUNIT_ASSERT ( str1.right(-5) == L"Look behind you, a three-headed monkey!" ); + CPPUNIT_ASSERT ( str1.right(-5).getLength() == 39 ); CPPUNIT_ASSERT ( str1.right(0) == L"" ); CPPUNIT_ASSERT ( str1.right(0).isEmpty() ); CPPUNIT_ASSERT ( ! str1.right(0).isNull() ); CPPUNIT_ASSERT ( finalcut::FString().right(5).isNull() ); CPPUNIT_ASSERT ( ! finalcut::FString("").right(5).isNull() ); CPPUNIT_ASSERT ( finalcut::FString("").right(5).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString("").right(5).getLength() == 0 ); CPPUNIT_ASSERT ( str1.mid(uInt(18), uInt(21)) == L"a three-headed monkey" ); CPPUNIT_ASSERT ( str1.mid(int(18), int(21)) == L"a three-headed monkey" ); + CPPUNIT_ASSERT ( str1.mid(18, 21).getLength() == 21 ); + CPPUNIT_ASSERT ( *(str1.mid(18, 21).c_str() + str1.mid(18, 21).getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.mid(18, 21).wc_str() + str1.mid(18, 21).getLength()) == L'\0' ); CPPUNIT_ASSERT ( str1.mid(1, 999) == L"Look behind you, a three-headed monkey!" ); + CPPUNIT_ASSERT ( str1.mid(1, 999).getLength() == 39 ); CPPUNIT_ASSERT ( str1.mid(5, 0) == L"" ); CPPUNIT_ASSERT ( str1.mid(-5, 2) == L"" ); CPPUNIT_ASSERT ( str1.mid(0, 0) == L"" ); @@ -1444,6 +1496,7 @@ void FStringTest::subStringTest() CPPUNIT_ASSERT ( finalcut::FString().mid(5, 0).isNull() ); CPPUNIT_ASSERT ( ! finalcut::FString("").mid(5, 0).isNull() ); CPPUNIT_ASSERT ( finalcut::FString("").mid(5, 0).isEmpty() ); + CPPUNIT_ASSERT ( str1.mid(5, 0).getLength() == 0 ); finalcut::FStringList string_parts = str1.split(" "); finalcut::FStringList string_list; @@ -1455,13 +1508,13 @@ void FStringTest::subStringTest() string_list.push_back("monkey!"); CPPUNIT_ASSERT ( string_parts == string_list ); - string_parts = str1.split(L','); + string_parts = str1.split(L','); // wchar_t string_list.clear(); string_list.push_back("Look behind you"); string_list.push_back(" a three-headed monkey!"); CPPUNIT_ASSERT ( string_parts == string_list ); - string_parts = str1.split(','); + string_parts = str1.split(','); // char CPPUNIT_ASSERT ( string_parts == string_list ); string_parts = finalcut::FString().split(':'); @@ -1474,53 +1527,133 @@ void FStringTest::insertTest() { finalcut::FString str1 = "ABC"; const finalcut::FString str2 = "xyz"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str2, 0) == "xyzABC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str2, 1) == "AxyzBC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str2, 2) == "ABxyzC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str2, 3) == "ABCxyz" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; constexpr wchar_t str3[] = L"xyz"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str3, 0) == "xyzABC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str3, 1) == "AxyzBC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str3, 2) == "ABxyzC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str3, 3) == "ABCxyz" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; constexpr char str4[] = "xyz"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str4, 0) == "xyzABC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str4, 1) == "AxyzBC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str4, 2) == "ABxyzC" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(str4, 3) == "ABCxyz" ); + CPPUNIT_ASSERT ( str1.getLength() == 6 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; constexpr wchar_t wc = L'*'; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(wc, 0) == "*ABC" ); + CPPUNIT_ASSERT ( str1.getLength() == 4 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(wc, 1) == "A*BC" ); + CPPUNIT_ASSERT ( str1.getLength() == 4 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(wc, 2) == "AB*C" ); + CPPUNIT_ASSERT ( str1.getLength() == 4 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(wc, 3) == "ABC*" ); + CPPUNIT_ASSERT ( str1.getLength() == 4 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; constexpr char c = '*'; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(c, 0) == "*ABC" ); + CPPUNIT_ASSERT ( str1.getLength() == 4 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(c, 1) == "A*BC" ); + CPPUNIT_ASSERT ( str1.getLength() == 4 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(c, 2) == "AB*C" ); + CPPUNIT_ASSERT ( str1.getLength() == 4 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); str1 = "ABC"; + CPPUNIT_ASSERT ( str1.getLength() == 3 ); CPPUNIT_ASSERT ( str1.insert(c, 3) == "ABC*" ); + CPPUNIT_ASSERT ( str1.getLength() == 4 ); + CPPUNIT_ASSERT ( *(str1.c_str() + str1.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str1.wc_str() + str1.getLength()) == L'\0' ); } //---------------------------------------------------------------------- @@ -1693,16 +1826,31 @@ void FStringTest::replaceTest() s1 = "A big ball and a small ball"; CPPUNIT_ASSERT ( s1.replace("ball", "globe") == "A big globe and a small globe" ); + CPPUNIT_ASSERT ( s1.getLength() == 27 ); + CPPUNIT_ASSERT ( s1.replace("ball", "globe").getLength() == 29 ); + CPPUNIT_ASSERT ( *(s1.replace("ball", "globe").c_str() + + s1.replace("ball", "globe").getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(s1.replace("ball", "globe").wc_str() + + s1.replace("ball", "globe").getLength()) == L'\0' ); s1 = "ABC"; finalcut::FString empty; CPPUNIT_ASSERT ( s1.replace('B', "") == "AC" ); + CPPUNIT_ASSERT ( s1.replace('B', "").getLength() == 2 ); CPPUNIT_ASSERT ( s1.replace(L'B', "") == "AC" ); - CPPUNIT_ASSERT ( s1.replace(from1, empty) == "ABC" ); + CPPUNIT_ASSERT ( s1.replace(L'B', "").getLength() == 2 ); CPPUNIT_ASSERT ( s1.replace(from3, empty) == "ABC" ); + CPPUNIT_ASSERT ( s1.replace(from3, empty).getLength() == 3 ); + CPPUNIT_ASSERT ( s1.replace(from1, empty) == "ABC" ); + CPPUNIT_ASSERT ( s1.replace(from1, empty).getLength() == 3 ); + CPPUNIT_ASSERT ( s1.replace(from3, empty) == "ABC" ); + CPPUNIT_ASSERT ( s1.replace(from3, empty).getLength() == 3 ); CPPUNIT_ASSERT ( s1.replace(from5, to5) == "ABC" ); + CPPUNIT_ASSERT ( s1.replace(from5, to5).getLength() == 3 ); CPPUNIT_ASSERT ( s1.replace(empty, to1) == "ABC" ); + CPPUNIT_ASSERT ( s1.replace(empty, to1).getLength() == 3 ); CPPUNIT_ASSERT ( s1.replace(from6, empty) == "ABC" ); + CPPUNIT_ASSERT ( s1.replace(from6, empty).getLength() == 3 ); empty = ""; CPPUNIT_ASSERT ( s1.replace(from1, empty) == "ABC" ); @@ -1728,13 +1876,30 @@ void FStringTest::overwriteTest() { // finalcut::FString finalcut::FString str = "abcdefghijklm"; + CPPUNIT_ASSERT ( str.getLength() == 13 ); CPPUNIT_ASSERT ( str.overwrite("+++++++", 3) == "abc+++++++klm" ); + CPPUNIT_ASSERT ( str.getLength() == 13 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); CPPUNIT_ASSERT ( str.overwrite(".............") == "............." ); + CPPUNIT_ASSERT ( str.getLength() == 13 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); CPPUNIT_ASSERT ( str.overwrite(",,,,,,,,,,,,,,,") == ",,,,,,,,,,,,,,," ); + CPPUNIT_ASSERT ( str.getLength() == 15 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); str = "abc"; + CPPUNIT_ASSERT ( str.getLength() == 3 ); CPPUNIT_ASSERT ( str.overwrite("+++++", 99) == "abc+++++" ); + CPPUNIT_ASSERT ( str.getLength() == 8 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); str = "abc"; CPPUNIT_ASSERT ( str.overwrite("+++", -5) == "+++" ); + CPPUNIT_ASSERT ( str.getLength() == 3 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); // Wide string str = "abcdefghijklm"; @@ -1763,12 +1928,40 @@ void FStringTest::removeTest() { finalcut::FString str = "ABCDE"; CPPUNIT_ASSERT ( str.remove(2, 2) == "ABE" ); + CPPUNIT_ASSERT ( str.getLength() == 3 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); + + // Remove last character CPPUNIT_ASSERT ( str.remove(2, 1) == "AB" ); + CPPUNIT_ASSERT ( str.getLength() == 2 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); + + // Remove after the last character CPPUNIT_ASSERT ( str.remove(2, 1) == "AB" ); + CPPUNIT_ASSERT ( str.getLength() == 2 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); + + // Remove after the last character CPPUNIT_ASSERT ( str.remove(2, 5) == "AB" ); + CPPUNIT_ASSERT ( str.getLength() == 2 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); + str = "ABCDE"; + CPPUNIT_ASSERT ( str.getLength() == 5 ); CPPUNIT_ASSERT ( str.remove(2, 99) == "AB" ); + CPPUNIT_ASSERT ( str.getLength() == 2 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); + + // Remove after the last character CPPUNIT_ASSERT ( str.remove(99, 1) == "AB" ); + CPPUNIT_ASSERT ( str.getLength() == 2 ); + CPPUNIT_ASSERT ( *(str.c_str() + str.getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(str.wc_str() + str.getLength()) == L'\0' ); } //---------------------------------------------------------------------- @@ -1822,85 +2015,127 @@ void FStringTest::includesTest() void FStringTest::controlCodesTest() { finalcut::FString bs_str = "t\b\bTesT\bt"; + CPPUNIT_ASSERT ( bs_str.getLength() == 9 ); CPPUNIT_ASSERT ( bs_str.removeBackspaces() == "Test" ); + CPPUNIT_ASSERT ( bs_str.removeBackspaces().getLength() == 4 ); + CPPUNIT_ASSERT ( *(bs_str.removeBackspaces().c_str() + + bs_str.removeBackspaces().getLength()) == '\0' ); + CPPUNIT_ASSERT ( *(bs_str.removeBackspaces().wc_str() + + bs_str.removeBackspaces().getLength()) == L'\0' ); bs_str = "ABC\b\b\b\b"; CPPUNIT_ASSERT ( bs_str.removeBackspaces() == "" ); CPPUNIT_ASSERT ( bs_str.removeBackspaces().isEmpty() ); + CPPUNIT_ASSERT ( bs_str.removeBackspaces().getLength() == 0 ); finalcut::FString del_str = "apple \177\177\177pietree"; + CPPUNIT_ASSERT ( del_str.getLength() == 16 ); CPPUNIT_ASSERT ( del_str.removeDel() == "apple tree" ); + CPPUNIT_ASSERT ( del_str.removeDel().getLength() == 10 ); del_str = "\177\177\177\177ABC"; + CPPUNIT_ASSERT ( del_str.getLength() == 7 ); CPPUNIT_ASSERT ( del_str.removeDel() == "" ); CPPUNIT_ASSERT ( del_str.removeDel().isEmpty() ); + CPPUNIT_ASSERT ( del_str.removeDel().getLength() == 0 ); finalcut::FString tab_str = "one line"; + CPPUNIT_ASSERT ( tab_str.getLength() == 8 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "one line" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 8 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "one line" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "one line" ); tab_str = "one\ttwo"; + CPPUNIT_ASSERT ( tab_str.getLength() == 7 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "one two" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 11 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "one two" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "one two" ); tab_str = "one\t\btwo"; + CPPUNIT_ASSERT ( tab_str.getLength() == 8 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "one \btwo" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 12 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "one \btwo" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "one \btwo" ); tab_str = "1\t2\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 5 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "1 2 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "1 2 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "1 2 2" ); tab_str = "12\t22\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 7 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "12 22 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "12 22 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "12 22 2" ); tab_str = "123\t222\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 9 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "123 222 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "123 222 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "123 222 2" ); tab_str = "1234\t2222\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 11 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "1234 2222 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "1234 2222 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "1234 2222 2" ); tab_str = "12345\t22222\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 13 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "12345 22222 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "12345 22222 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "12345 22222 2" ); tab_str = "123456\t222222\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 15 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "123456 222222 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "123456 222222 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "123456 222222 2" ); tab_str = "1234567\t2222222\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "1234567 2222222 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "1234567 2222222 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "1234567 2222222 2" ); tab_str = "12345678\t22222222\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 19 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "12345678 22222222 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 33 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "12345678 22222222 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "12345678 22222222 2" ); tab_str = "12345678\t2"; + CPPUNIT_ASSERT ( tab_str.getLength() == 10 ); CPPUNIT_ASSERT ( tab_str.expandTabs() == "12345678 2" ); + CPPUNIT_ASSERT ( tab_str.expandTabs().getLength() == 17 ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "12345678 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "12345678 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(0) == "12345678\t2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(-1) == "12345678\t2" ); - finalcut::FString cc(0x20); + + // C0 control codes (0x01 - 0x1f) - without null (0x00) + finalcut::FString c0(0x1f); for (int i = 0; i < 0x1f; i++) - cc[i] = i + 1; + c0[i] = i + 1; - CPPUNIT_ASSERT ( cc.replaceControlCodes() + CPPUNIT_ASSERT ( c0.getLength() == 31 ); + CPPUNIT_ASSERT ( c0.replaceControlCodes() == "␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟" ); + CPPUNIT_ASSERT ( c0.replaceControlCodes().getLength() == 31 ); + c0 = "t\b\bTes\177Tt"; + CPPUNIT_ASSERT ( c0.replaceControlCodes() == "t␈␈Tes␡Tt" ); + + // C1 control codes (0x80 - 0x9f) + // Used as print characters in some character sets + finalcut::FString c1(0x20); for (int i = 0; i <= 0x1f; i++) - cc[i] = i + 0x80; + c1[i] = i + 0x80; - CPPUNIT_ASSERT ( cc.replaceControlCodes() == finalcut::FString(32, L' ') ); - - cc = "t\b\bTes\177Tt"; - CPPUNIT_ASSERT ( cc.replaceControlCodes() == "t␈␈Tes␡Tt" ); + CPPUNIT_ASSERT ( c1.replaceControlCodes() == finalcut::FString(32, L' ') ); } // Put the test suite in the registry diff --git a/test/ftermcapquirks-test.cpp b/test/ftermcapquirks-test.cpp index d6d23d6c..fcef6438 100644 --- a/test/ftermcapquirks-test.cpp +++ b/test/ftermcapquirks-test.cpp @@ -54,7 +54,7 @@ namespace test typedef struct { - char* string; + const char* string; char tname[3]; } tcap_map; @@ -237,48 +237,48 @@ void FTermcapQuirksTest::generalTest() CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 0 ); CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string - , C_STR(CSI "3%p1%dm") ); + , CSI "3%p1%dm") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string - , C_STR(CSI "4%p1%dm") ); + , CSI "4%p1%dm") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string - , C_STR(OSC "P%p1%x" - "%p2%{255}%*%{1000}%/%02x" - "%p3%{255}%*%{1000}%/%02x" - "%p4%{255}%*%{1000}%/%02x") ); + , OSC "P%p1%x" + "%p2%{255}%*%{1000}%/%02x" + "%p3%{255}%*%{1000}%/%02x" + "%p4%{255}%*%{1000}%/%02x" ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_ca_mode].string - , C_STR(ESC "7" CSI "?47h" ) ); + , ESC "7" CSI "?47h" ) ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_ca_mode].string - , C_STR(CSI "?47l" ESC "8" CSI "m") ); + , CSI "?47l" ESC "8" CSI "m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_address].string - , C_STR(CSI "%i%p1%d;%p2%dH") ); + , CSI "%i%p1%d;%p2%dH") ; // Non standard ECMA-48 (ANSI X3.64) terminal CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_dbl_underline_mode].string , 0 ); - caps[finalcut::fc::t_exit_underline_mode].string = C_STR(CSI "24m"); + caps[finalcut::fc::t_exit_underline_mode].string = CSI "24m"; quirks.terminalFixup(); // Standard ECMA-48 (ANSI X3.64) terminal CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_dbl_underline_mode].string - , C_STR(CSI "21m") ); + , CSI "21m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_dbl_underline_mode].string - , C_STR(CSI "24m") ); + , CSI "24m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_bold_mode].string - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_dim_mode].string - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_underline_mode].string - , C_STR(CSI "24m") ); + , CSI "24m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_blink_mode].string - , C_STR(CSI "25m") ); + , CSI "25m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_reverse_mode].string - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_secure_mode].string - , C_STR(CSI "28m") ); + , CSI "28m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_crossed_out_mode].string - , C_STR(CSI "9m") ); + , CSI "9m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_crossed_out_mode].string - , C_STR(CSI "29m") ); + , CSI "29m") ; CPPUNIT_ASSERT_CSTRING ( printSequence(caps[finalcut::fc::t_enter_ca_mode].string).c_str() - , C_STR("Esc 7 Esc [ ? 4 7 h ") ); + , "Esc 7 Esc [ ? 4 7 h ") ; } //---------------------------------------------------------------------- @@ -300,14 +300,14 @@ void FTermcapQuirksTest::xtermTest() CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string - , C_STR(OSC "4;%p1%d;rgb:" - "%p2%{255}%*%{1000}%/%2.2X/" - "%p3%{255}%*%{1000}%/%2.2X/" - "%p4%{255}%*%{1000}%/%2.2X" ESC "\\") ); + , OSC "4;%p1%d;rgb:" + "%p2%{255}%*%{1000}%/%2.2X/" + "%p3%{255}%*%{1000}%/%2.2X/" + "%p4%{255}%*%{1000}%/%2.2X" ESC "\\"); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_invisible].string - , C_STR(CSI "?25l") ); + , CSI "?25l") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_normal].string - , C_STR(CSI "?12l" CSI "?25h") ); + , CSI "?12l" CSI "?25h") ; detect.setXTerminal (false); } @@ -333,20 +333,20 @@ void FTermcapQuirksTest::freebsdTest() CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 18 ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_acs_chars].string - , C_STR("-\036.\0370\333" - "a\260f\370g\361" - "h\261j\331k\277" - "l\332m\300n\305" - "q\304t\303u\264" - "v\301w\302x\263" - "y\363z\362~\371") ); + , "-\036.\0370\333" + "a\260f\370g\361" + "h\261j\331k\277" + "l\332m\300n\305" + "q\304t\303u\264" + "v\301w\302x\263" + "y\363z\362~\371" ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_attributes].string - , C_STR(CSI "0" - "%?%p1%p6%|%t;1%;" - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;") ); + , CSI "0" + "%?%p1%p6%|%t;1%;" + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;" ); detect.setFreeBSDTerm (false); } #endif @@ -370,9 +370,9 @@ void FTermcapQuirksTest::cygwinTest() CPPUNIT_ASSERT ( finalcut::FTermcap::background_color_erase == true ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_invisible].string - , C_STR(CSI "?25l") ); + , CSI "?25l") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_visible].string - , C_STR(CSI "?25h") ); + , CSI "?25h") ; detect.setCygwinTerminal (false); } @@ -396,9 +396,9 @@ void FTermcapQuirksTest::linuxTest() // 8 colors CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string - , C_STR(CSI "3%p1%dm") ); + , CSI "3%p1%dm") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string - , C_STR(CSI "4%p1%dm") ); + , CSI "4%p1%dm") ; CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 18 ); // 16 colors @@ -406,29 +406,29 @@ void FTermcapQuirksTest::linuxTest() quirks.terminalFixup(); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string - , C_STR(CSI "3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;22%;m") ); + , CSI "3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;22%;m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string - , C_STR(CSI "4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m") ); + , CSI "4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m") ; CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 30 ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_attributes].string - , C_STR(CSI "0" - "%?%p6%t;1%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;") ); + , CSI "0" + "%?%p6%t;1%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;" ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_alt_charset_mode].string - , C_STR("\016") ); + , "\016") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_alt_charset_mode].string - , C_STR("\017") ); + , "\017") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_attribute_mode].string - , C_STR(CSI "0m\017") ); + , CSI "0m\017") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_bold_mode].string - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_blink_mode].string - , C_STR(CSI "25m") ); + , CSI "25m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_reverse_mode].string - , C_STR(CSI "27m") ); + , CSI "27m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_secure_mode].string , 0 ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_protected_mode].string @@ -436,7 +436,7 @@ void FTermcapQuirksTest::linuxTest() CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_crossed_out_mode].string , 0 ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_orig_pair].string - , C_STR(CSI "39;49;25m") ); + , CSI "39;49;25m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_dim_mode].string , 0 ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_dim_mode].string @@ -473,17 +473,17 @@ void FTermcapQuirksTest::rxvtTest() data.setTermType ("rxvt-16color"); quirks.terminalFixup(); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_alt_charset_mode].string - , C_STR(ESC "(0") ); + , ESC "(0") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_alt_charset_mode].string - , C_STR(ESC "(B") ); + , ESC "(B") ; // urxvt detect.setUrxvtTerminal (true); quirks.terminalFixup(); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string - , C_STR(CSI "%?%p1%{8}%<%t%p1%{30}%+%e%p1%'R'%+%;%dm") ); + , CSI "%?%p1%{8}%<%t%p1%{30}%+%e%p1%'R'%+%;%dm") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string - , C_STR(CSI "%?%p1%{8}%<%t%p1%'('%+%e%p1%{92}%+%;%dm") ); + , CSI "%?%p1%{8}%<%t%p1%'('%+%e%p1%{92}%+%;%dm") ; detect.setUrxvtTerminal (false); detect.setRxvtTerminal (false); @@ -508,7 +508,7 @@ void FTermcapQuirksTest::vteTest() CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 0 ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_underline_mode].string - , C_STR(CSI "24m") ); + , CSI "24m") ; detect.setGnomeTerminal (false); } @@ -538,67 +538,67 @@ void FTermcapQuirksTest::puttyTest() CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 0 ); CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string - , C_STR(OSC "P%p1%x" - "%p2%{255}%*%{1000}%/%02x" - "%p3%{255}%*%{1000}%/%02x" - "%p4%{255}%*%{1000}%/%02x") ); + , OSC "P%p1%x" + "%p2%{255}%*%{1000}%/%02x" + "%p3%{255}%*%{1000}%/%02x" + "%p4%{255}%*%{1000}%/%02x" ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string - , C_STR(CSI "%?%p1%{8}%<" - "%t3%p1%d" - "%e%p1%{16}%<" - "%t9%p1%{8}%-%d" - "%e38;5;%p1%d%;m") ); + , CSI "%?%p1%{8}%<" + "%t3%p1%d" + "%e%p1%{16}%<" + "%t9%p1%{8}%-%d" + "%e38;5;%p1%d%;m" ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string - , C_STR(CSI "%?%p1%{8}%<" - "%t4%p1%d" - "%e%p1%{16}%<" - "%t10%p1%{8}%-%d" - "%e48;5;%p1%d%;m") ); + , CSI "%?%p1%{8}%<" + "%t4%p1%d" + "%e%p1%{16}%<" + "%t10%p1%{8}%-%d" + "%e48;5;%p1%d%;m" ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_attributes].string - , C_STR(CSI "0" - "%?%p1%p6%|%t;1%;" - "%?%p5%t;2%;" - "%?%p2%t;4%;" - "%?%p1%p3%|%t;7%;" - "%?%p4%t;5%;m" - "%?%p9%t\016%e\017%;") ); + , CSI "0" + "%?%p1%p6%|%t;1%;" + "%?%p5%t;2%;" + "%?%p2%t;4%;" + "%?%p1%p3%|%t;7%;" + "%?%p4%t;5%;m" + "%?%p9%t\016%e\017%;" ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_dim_mode].string - , C_STR(CSI "2m") ); + , CSI "2m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_dim_mode].string - , C_STR(CSI "22m") ); + , CSI "22m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_clr_bol].string - , C_STR(CSI "1K") ); + , CSI "1K") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_orig_pair].string - , C_STR(CSI "39;49m") ); + , CSI "39;49m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_orig_colors].string - , C_STR(OSC "R") ); + , OSC "R") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_column_address].string - , C_STR(CSI "%i%p1%dG") ); + , CSI "%i%p1%dG") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_row_address].string - , C_STR(CSI "%i%p1%dd") ); + , CSI "%i%p1%dd") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enable_acs].string - , C_STR(ESC "(B" ESC ")0") ); + , ESC "(B" ESC ")0") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_am_mode].string - , C_STR(CSI "?7h") ); + , CSI "?7h") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_am_mode].string - , C_STR(CSI "?7l") ); + , CSI "?7l") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_pc_charset_mode].string - , C_STR(CSI "11m") ); + , CSI "11m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_pc_charset_mode].string - , C_STR(CSI "10m") ); + , CSI "10m") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_key_mouse].string - , C_STR(CSI "M") ); + , CSI "M") ; detect.setPuttyTerminal (false); } @@ -622,13 +622,13 @@ void FTermcapQuirksTest::teratermTest() CPPUNIT_ASSERT ( finalcut::FTermcap::eat_nl_glitch == true ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string - , C_STR(CSI "38;5;%p1%dm") ); + , CSI "38;5;%p1%dm") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string - , C_STR(CSI "48;5;%p1%dm") ); + , CSI "48;5;%p1%dm") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_attribute_mode].string - , C_STR(CSI "0m" SI) ); + , CSI "0m" SI) ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_orig_pair].string - , C_STR(CSI "39;49m") ); + , CSI "39;49m") ; detect.setTeraTerm (false); } @@ -652,100 +652,100 @@ void FTermcapQuirksTest::sunTest() CPPUNIT_ASSERT ( finalcut::FTermcap::eat_nl_glitch == true ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_parm_up_cursor].string - , C_STR(CSI "%p1%dA") ); + , CSI "%p1%dA") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_parm_down_cursor].string - , C_STR(CSI "%p1%dB") ); + , CSI "%p1%dB") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_parm_right_cursor].string - , C_STR(CSI "%p1%dC") ); + , CSI "%p1%dC") ; CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_parm_left_cursor].string - , C_STR(CSI "%p1%dD") ); + , CSI "%p1%dD") ; for (std::size_t i = 0; finalcut::fc::fkey[i].tname[0] != 0; i++) { if ( std::strncmp(finalcut::fc::fkey[i].tname, "K2", 2) == 0 ) // center of keypad CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "218z") ); + , CSI "218z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "kb", 2) == 0 ) // backspace key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR("\b") ); + , "\b") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "kD", 2) == 0 && std::strlen(finalcut::fc::fkey[i].tname) == 2 ) // delete-character key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR("\177") ); + , "\177") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "@7", 2) == 0 ) // end key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "220z") ); + , CSI "220z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "k;", 2) == 0 ) // F10 function key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "233z") ); + , CSI "233z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "F1", 2) == 0 ) // F11 function key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "234z") ); + , CSI "234z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "F2", 2) == 0 ) // F12 function key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "235z") ); + , CSI "235z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "kh", 2) == 0 ) // home key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "214z") ); + , CSI "214z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "kI", 2) == 0 ) // insert-character key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "247z") ); + , CSI "247z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "kN", 2) == 0 ) // next-page key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "222z") ); + , CSI "222z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "%7", 2) == 0 ) // options key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "194z") ); + , CSI "194z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "kP", 2) == 0 ) // prev-page key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "216z") ); + , CSI "216z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "&5", 2) == 0 ) // resume key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "193z") ); + , CSI "193z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "&8", 2) == 0 ) // undo key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "195z") ); + , CSI "195z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "K2", 2) == 0 ) // center of keypad CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "218z") ); + , CSI "218z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "kDx", 3) == 0 ) // keypad delete CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "249z") ); + , CSI "249z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "@8x", 3) == 0 ) // enter/send key CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "250z") ); + , CSI "250z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "KP1", 3) == 0 ) // keypad slash CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "212z") ); + , CSI "212z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "KP2", 3) == 0 ) // keypad asterisk CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "213z") ); + , CSI "213z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "KP3", 3) == 0 ) // keypad minus sign CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "254z") ); + , CSI "254z") ; if ( std::strncmp(finalcut::fc::fkey[i].tname, "KP4", 3) == 0 ) // keypad plus sign CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string - , C_STR(CSI "253z") ); + , CSI "253z") ; } detect.setSunTerminal (false); @@ -770,10 +770,10 @@ void FTermcapQuirksTest::screenTest() CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string - , C_STR(ESC "P" OSC "4;%p1%d;rgb:" - "%p2%{255}%*%{1000}%/%2.2X/" - "%p3%{255}%*%{1000}%/%2.2X/" - "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\") ); + , ESC "P" OSC "4;%p1%d;rgb:" + "%p2%{255}%*%{1000}%/%2.2X/" + "%p3%{255}%*%{1000}%/%2.2X/" + "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\" ); detect.setTmuxTerm (true); caps[finalcut::fc::t_initialize_color].string = 0; @@ -782,10 +782,10 @@ void FTermcapQuirksTest::screenTest() CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string - , C_STR(ESC "Ptmux;" ESC OSC "4;%p1%d;rgb:" - "%p2%{255}%*%{1000}%/%2.2X/" - "%p3%{255}%*%{1000}%/%2.2X/" - "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\") ); + , ESC "Ptmux;" ESC OSC "4;%p1%d;rgb:" + "%p2%{255}%*%{1000}%/%2.2X/" + "%p3%{255}%*%{1000}%/%2.2X/" + "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\" ); detect.setTmuxTerm (false); detect.setScreenTerm (false); } diff --git a/test/ftermdata-test.cpp b/test/ftermdata-test.cpp index 72e9754b..0991896c 100644 --- a/test/ftermdata-test.cpp +++ b/test/ftermdata-test.cpp @@ -93,8 +93,8 @@ void FTermDataTest::defaultDataTest() CPPUNIT_ASSERT ( data.getTermGeometry() == finalcut::FRect() ); CPPUNIT_ASSERT ( data.getTTYFileDescriptor() == -1 ); CPPUNIT_ASSERT ( data.getBaudrate() == 0 ); - CPPUNIT_ASSERT_CSTRING ( data.getTermType(), C_STR("") ); - CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( data.getTermType(), "") ; + CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), "") ; CPPUNIT_ASSERT ( data.getXtermFont() == finalcut::FString() ); CPPUNIT_ASSERT ( data.getXtermTitle() == finalcut::FString() ); CPPUNIT_ASSERT ( data.getExitMessage() == finalcut::FString() ); @@ -177,13 +177,13 @@ void FTermDataTest::dataTest() CPPUNIT_ASSERT ( data.getBaudrate() != 9600 ); CPPUNIT_ASSERT ( data.getBaudrate() == 38400 ); - CPPUNIT_ASSERT_CSTRING ( data.getTermType(), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( data.getTermType(), "") ; data.setTermType("linux"); - CPPUNIT_ASSERT_CSTRING ( data.getTermType(), C_STR("linux") ); + CPPUNIT_ASSERT_CSTRING ( data.getTermType(), "linux") ; - CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), C_STR("") ); + CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), "") ; data.setTermFileName("/dev/pts/2"); - CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), C_STR("/dev/pts/2") ); + CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), "/dev/pts/2") ; CPPUNIT_ASSERT ( data.getXtermFont() == finalcut::FString() ); data.setXtermFont("terminus-20"); diff --git a/test/ftermdetection-test.cpp b/test/ftermdetection-test.cpp index 2524def6..20254db6 100644 --- a/test/ftermdetection-test.cpp +++ b/test/ftermdetection-test.cpp @@ -140,7 +140,7 @@ void FTermDetectionTest::ansiTest() finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; setenv ("TERM", "ansi", 1); - data.setTermType(C_STR("ansi")); + data.setTermType("ansi"); pid_t pid = forkConEmu(); @@ -180,14 +180,14 @@ void FTermDetectionTest::ansiTest() CPPUNIT_ASSERT ( ! detect.canDisplay256Colors() ); CPPUNIT_ASSERT ( ! detect.hasTerminalDetection() ); CPPUNIT_ASSERT ( ! detect.hasSetCursorStyleSupport() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("ansi") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "ansi") ; // Test fallback to vt100 without TERM environment variable unsetenv("TERM"); detect.setAnsiTerminal(false); detect.detect(); CPPUNIT_ASSERT ( ! detect.isAnsiTerminal() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -208,7 +208,7 @@ void FTermDetectionTest::xtermTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("xterm")); + data.setTermType("xterm"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -269,7 +269,7 @@ void FTermDetectionTest::rxvtTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("rxvt-cygwin-native")); + data.setTermType("rxvt-cygwin-native"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -310,7 +310,7 @@ void FTermDetectionTest::rxvtTest() CPPUNIT_ASSERT ( detect.canDisplay256Colors() ); CPPUNIT_ASSERT ( detect.hasTerminalDetection() ); CPPUNIT_ASSERT ( ! detect.hasSetCursorStyleSupport() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("rxvt-cygwin-native") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "rxvt-cygwin-native") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -331,7 +331,7 @@ void FTermDetectionTest::urxvtTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("rxvt-unicode-256color")); + data.setTermType("rxvt-unicode-256color"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -392,7 +392,7 @@ void FTermDetectionTest::mltermTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("mlterm")); + data.setTermType("mlterm"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -434,13 +434,13 @@ void FTermDetectionTest::mltermTest() CPPUNIT_ASSERT ( detect.canDisplay256Colors() ); CPPUNIT_ASSERT ( detect.hasTerminalDetection() ); CPPUNIT_ASSERT ( ! detect.hasSetCursorStyleSupport() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("mlterm-256color") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "mlterm-256color") ; setenv ("TERM", "mlterm", 1); unsetenv("COLORFGBG"); detect.detect(); CPPUNIT_ASSERT ( detect.canDisplay256Colors() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("xterm-256color") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "xterm-256color") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -461,7 +461,7 @@ void FTermDetectionTest::puttyTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("xterm")); + data.setTermType("xterm"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -523,7 +523,7 @@ void FTermDetectionTest::kdeKonsoleTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("xterm-256color")); + data.setTermType("xterm-256color"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -584,7 +584,7 @@ void FTermDetectionTest::gnomeTerminalTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("xterm-256color")); + data.setTermType("xterm-256color"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -646,7 +646,7 @@ void FTermDetectionTest::newerVteTerminalTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("xterm-256color")); + data.setTermType("xterm-256color"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -708,7 +708,7 @@ void FTermDetectionTest::ktermTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("kterm")); + data.setTermType("kterm"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -756,7 +756,7 @@ void FTermDetectionTest::ktermTest() detect.setKtermTerminal(false); detect.detect(); CPPUNIT_ASSERT ( ! detect.isKtermTerminal() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -777,7 +777,7 @@ void FTermDetectionTest::teraTermTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("xterm")); + data.setTermType("xterm"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -839,7 +839,7 @@ void FTermDetectionTest::cygwinTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("cygwin")); + data.setTermType("cygwin"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -901,7 +901,7 @@ void FTermDetectionTest::minttyTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("xterm-256color")); + data.setTermType("xterm-256color"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -963,7 +963,7 @@ void FTermDetectionTest::linuxTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("linux")); + data.setTermType("linux"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -1011,7 +1011,7 @@ void FTermDetectionTest::linuxTest() detect.setLinuxTerm(false); detect.detect(); CPPUNIT_ASSERT ( ! detect.isLinuxTerm() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -1032,7 +1032,7 @@ void FTermDetectionTest::freebsdTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("xterm")); + data.setTermType("xterm"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -1083,7 +1083,7 @@ void FTermDetectionTest::freebsdTest() detect.detect(); CPPUNIT_ASSERT ( ! detect.isXTerminal() ); CPPUNIT_ASSERT ( ! detect.isFreeBSDTerm() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -1104,7 +1104,7 @@ void FTermDetectionTest::netbsdTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("wsvt25")); + data.setTermType("wsvt25"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -1153,7 +1153,7 @@ void FTermDetectionTest::netbsdTest() detect.setNetBSDTerm(false); detect.detect(); CPPUNIT_ASSERT ( ! detect.isFreeBSDTerm() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -1174,7 +1174,7 @@ void FTermDetectionTest::openbsdTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("vt220")); + data.setTermType("vt220"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -1223,7 +1223,7 @@ void FTermDetectionTest::openbsdTest() detect.setOpenBSDTerm(false); detect.detect(); CPPUNIT_ASSERT ( ! detect.isOpenBSDTerm() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -1244,7 +1244,7 @@ void FTermDetectionTest::sunTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("sun-color")); + data.setTermType("sun-color"); pid_t pid = forkConEmu(); @@ -1291,7 +1291,7 @@ void FTermDetectionTest::sunTest() detect.setSunTerminal(false); detect.detect(); CPPUNIT_ASSERT ( ! detect.isSunTerminal() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -1312,7 +1312,7 @@ void FTermDetectionTest::screenTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("screen")); + data.setTermType("screen"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -1354,12 +1354,12 @@ void FTermDetectionTest::screenTest() CPPUNIT_ASSERT ( ! detect.canDisplay256Colors() ); CPPUNIT_ASSERT ( detect.hasTerminalDetection() ); CPPUNIT_ASSERT ( ! detect.hasSetCursorStyleSupport() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("screen") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "screen") ; setenv ("XTERM_VERSION", "XTerm(312)", 1); detect.detect(); CPPUNIT_ASSERT ( detect.canDisplay256Colors() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("screen-256color") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "screen-256color") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -1380,7 +1380,7 @@ void FTermDetectionTest::tmuxTest() { finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); finalcut::FTermDetection detect; - data.setTermType(C_STR("screen")); + data.setTermType("screen"); detect.setTerminalDetection(true); pid_t pid = forkConEmu(); @@ -1423,12 +1423,12 @@ void FTermDetectionTest::tmuxTest() CPPUNIT_ASSERT ( ! detect.canDisplay256Colors() ); CPPUNIT_ASSERT ( detect.hasTerminalDetection() ); CPPUNIT_ASSERT ( ! detect.hasSetCursorStyleSupport() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("screen") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "screen") ; setenv ("VTE_VERSION", "3801", 1); detect.detect(); CPPUNIT_ASSERT ( detect.canDisplay256Colors() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("screen-256color") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "screen-256color") ; printConEmuDebug(); closeConEmuStdStreams(); @@ -1484,7 +1484,7 @@ void FTermDetectionTest::ttytypeTest() finalcut::FTermDetection detect; detect.setTerminalDetection(true); - detect.setTtyTypeFileName(C_STR("new-root-dir/etc/ttytype")); + detect.setTtyTypeFileName("new-root-dir/etc/ttytype"); pid_t pid = forkConEmu(); @@ -1503,19 +1503,19 @@ void FTermDetectionTest::ttytypeTest() finalcut::FTermData& data = *finalcut::FTerm::getFTermData(); // Test /dev/tty3 with linux - data.setTermFileName(C_STR("/dev/tty3")); + data.setTermFileName("/dev/tty3"); detect.detect(); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("linux") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "linux") ; // Test /dev/ttyp0 with vt100 - data.setTermFileName(C_STR("/dev/ttyp0")); + data.setTermFileName("/dev/ttyp0"); detect.detect(); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; // Test non-existent /dev/tty8 with fallback to vt100 - data.setTermFileName(C_STR("/dev/tty8")); + data.setTermFileName("/dev/tty8"); detect.detect(); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), C_STR("vt100") ); + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "vt100") ; printConEmuDebug(); closeConEmuStdStreams(); diff --git a/test/ftermopenbsd-test.cpp b/test/ftermopenbsd-test.cpp index 170318b9..14c8739a 100644 --- a/test/ftermopenbsd-test.cpp +++ b/test/ftermopenbsd-test.cpp @@ -523,7 +523,7 @@ void ftermopenbsdTest::openbsdConsoleTest() CPPUNIT_ASSERT ( data->getTermGeometry().getHeight() == 25 ); CPPUNIT_ASSERT ( ! data->hasShadowCharacter() ); CPPUNIT_ASSERT ( ! data->hasHalfBlockCharacter() ); - CPPUNIT_ASSERT_CSTRING ( term_detection->getTermType(), C_STR("pccon") ); + CPPUNIT_ASSERT_CSTRING ( term_detection->getTermType(), "pccon" ); openbsd.finish();