From b19479c228a8c72c58a54851cd9f763164a7be5a Mon Sep 17 00:00:00 2001 From: seleznevae Date: Wed, 17 Jul 2019 22:33:56 +0300 Subject: [PATCH] [F] Fixed reset style tag --- lib/fort.c | 88 ++++++------------ src/properties.c | 84 ++++++----------- src/properties.h | 4 +- tests/bb_tests/test_table_properties.c | 96 ++++++++++---------- tests/bb_tests_cpp/test_table_properties.cpp | 48 +++++----- tests/main_test_cpp.cpp | 8 +- 6 files changed, 132 insertions(+), 196 deletions(-) diff --git a/lib/fort.c b/lib/fort.c index d0daa30..4cf906a 100644 --- a/lib/fort.c +++ b/lib/fort.c @@ -396,7 +396,7 @@ int buffer_wprintf(string_buffer_t *buffer, size_t buffer_row, wchar_t *buf, siz #define PROP_SET(ft_props, property) ((ft_props) |=(property)) #define PROP_UNSET(ft_props, property) ((ft_props) &= ~((uint32_t)(property))) -#define TEXT_STYLE_TAG_MAX_SIZE 64 +#define TEXT_STYLE_TAG_MAX_SIZE (64 * 2) FT_INTERNAL void get_style_tag_for_cell(const fort_table_properties_t *props, @@ -460,7 +460,7 @@ FT_INTERNAL fort_status_t set_default_cell_property(uint32_t property, int value); -/* TABLE BORDER DESRIPTION +/* TABLE BORDER DESСRIPTION * * * TL TT TT TT TV TT TT TT TT TT TT TT TR @@ -2476,26 +2476,6 @@ static const char *fg_colors[] = { "\033[97m", }; -static const char *reset_fg_colors[] = { - "", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", -}; - static const char *bg_colors[] = { "", "\033[40m", @@ -2516,27 +2496,6 @@ static const char *bg_colors[] = { "\033[107m", }; -static const char *reset_bg_colors[] = { - "", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", -}; - - static const char *text_styles[] = { "", "\033[1m", @@ -2548,17 +2507,7 @@ static const char *text_styles[] = { "\033[8m", }; -static const char *reset_text_styles[] = { - "", - "\033[21m", - "\033[22m", - "\033[23m", - "\033[24m", - "\033[25m", - "\033[27m", - "\033[28m", -}; - +#define UNIVERSAL_RESET_TAG "\033[0m" static const size_t n_fg_colors = sizeof(fg_colors) / sizeof(fg_colors[0]); static const size_t n_bg_colors = sizeof(bg_colors) / sizeof(bg_colors[0]); @@ -2614,7 +2563,8 @@ void get_reset_style_tag_for_cell(const fort_table_properties_t *props, if (text_style < (1U << n_styles)) { for (i = 0; i < n_styles; ++i) { if (text_style & (1 << i)) { - strcat(reset_style_tag, reset_text_styles[i]); + if (i != 0) // FT_TSTYLE_DEFAULT + goto reset_style; } } } else { @@ -2622,13 +2572,19 @@ void get_reset_style_tag_for_cell(const fort_table_properties_t *props, } if (bg_color_number < n_bg_colors) { - strcat(reset_style_tag, reset_bg_colors[bg_color_number]); + if (bg_color_number) + goto reset_style; } else { goto error; } return; + +reset_style: + strcat(reset_style_tag, UNIVERSAL_RESET_TAG); + return; + error: /* shouldn't be here */ assert(0); @@ -2660,7 +2616,8 @@ void get_style_tag_for_content(const fort_table_properties_t *props, } if (fg_color_number < n_fg_colors) { - strcat(style_tag, fg_colors[fg_color_number]); + if (fg_color_number) + strcat(style_tag, fg_colors[fg_color_number]); } else { goto error; } @@ -2685,6 +2642,7 @@ void get_reset_style_tag_for_content(const fort_table_properties_t *props, { (void)sz; size_t i = 0; + size_t len = 0; unsigned text_style = get_cell_property_value_hierarcial(props, row, col, FT_CPROP_CONT_TEXT_STYLE); unsigned fg_color_number = get_cell_property_value_hierarcial(props, row, col, FT_CPROP_CONT_FG_COLOR); @@ -2695,7 +2653,8 @@ void get_reset_style_tag_for_content(const fort_table_properties_t *props, if (text_style < (1U << n_styles)) { for (i = 0; i < n_styles; ++i) { if (text_style & (1 << i)) { - strcat(reset_style_tag, reset_text_styles[i]); + if (i != 0) // FT_TSTYLE_DEFAULT + goto reset_style; } } } else { @@ -2703,19 +2662,28 @@ void get_reset_style_tag_for_content(const fort_table_properties_t *props, } if (fg_color_number < n_fg_colors) { - strcat(reset_style_tag, reset_fg_colors[fg_color_number]); + if (fg_color_number) + goto reset_style; } else { goto error; } if (bg_color_number < n_bg_colors) { - strcat(reset_style_tag, reset_bg_colors[bg_color_number]); + if (bg_color_number) + goto reset_style; } else { goto error; } return; + +reset_style: + strcat(reset_style_tag, UNIVERSAL_RESET_TAG); + len = strlen(reset_style_tag); + get_style_tag_for_cell(props, row, col, reset_style_tag + len, sz - len); + return; + error: /* shouldn't be here */ assert(0); diff --git a/src/properties.c b/src/properties.c index a193355..88402d5 100644 --- a/src/properties.c +++ b/src/properties.c @@ -25,26 +25,6 @@ static const char *fg_colors[] = { "\033[97m", }; -static const char *reset_fg_colors[] = { - "", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", - "\033[39m", -}; - static const char *bg_colors[] = { "", "\033[40m", @@ -65,27 +45,6 @@ static const char *bg_colors[] = { "\033[107m", }; -static const char *reset_bg_colors[] = { - "", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", - "\033[49m", -}; - - static const char *text_styles[] = { "", "\033[1m", @@ -97,17 +56,7 @@ static const char *text_styles[] = { "\033[8m", }; -static const char *reset_text_styles[] = { - "", - "\033[21m", - "\033[22m", - "\033[23m", - "\033[24m", - "\033[25m", - "\033[27m", - "\033[28m", -}; - +#define UNIVERSAL_RESET_TAG "\033[0m" static const size_t n_fg_colors = sizeof(fg_colors) / sizeof(fg_colors[0]); static const size_t n_bg_colors = sizeof(bg_colors) / sizeof(bg_colors[0]); @@ -163,7 +112,8 @@ void get_reset_style_tag_for_cell(const fort_table_properties_t *props, if (text_style < (1U << n_styles)) { for (i = 0; i < n_styles; ++i) { if (text_style & (1 << i)) { - strcat(reset_style_tag, reset_text_styles[i]); + if (i != 0) // FT_TSTYLE_DEFAULT + goto reset_style; } } } else { @@ -171,13 +121,19 @@ void get_reset_style_tag_for_cell(const fort_table_properties_t *props, } if (bg_color_number < n_bg_colors) { - strcat(reset_style_tag, reset_bg_colors[bg_color_number]); + if (bg_color_number) + goto reset_style; } else { goto error; } return; + +reset_style: + strcat(reset_style_tag, UNIVERSAL_RESET_TAG); + return; + error: /* shouldn't be here */ assert(0); @@ -209,7 +165,8 @@ void get_style_tag_for_content(const fort_table_properties_t *props, } if (fg_color_number < n_fg_colors) { - strcat(style_tag, fg_colors[fg_color_number]); + if (fg_color_number) + strcat(style_tag, fg_colors[fg_color_number]); } else { goto error; } @@ -234,6 +191,7 @@ void get_reset_style_tag_for_content(const fort_table_properties_t *props, { (void)sz; size_t i = 0; + size_t len = 0; unsigned text_style = get_cell_property_value_hierarcial(props, row, col, FT_CPROP_CONT_TEXT_STYLE); unsigned fg_color_number = get_cell_property_value_hierarcial(props, row, col, FT_CPROP_CONT_FG_COLOR); @@ -244,7 +202,8 @@ void get_reset_style_tag_for_content(const fort_table_properties_t *props, if (text_style < (1U << n_styles)) { for (i = 0; i < n_styles; ++i) { if (text_style & (1 << i)) { - strcat(reset_style_tag, reset_text_styles[i]); + if (i != 0) // FT_TSTYLE_DEFAULT + goto reset_style; } } } else { @@ -252,19 +211,28 @@ void get_reset_style_tag_for_content(const fort_table_properties_t *props, } if (fg_color_number < n_fg_colors) { - strcat(reset_style_tag, reset_fg_colors[fg_color_number]); + if (fg_color_number) + goto reset_style; } else { goto error; } if (bg_color_number < n_bg_colors) { - strcat(reset_style_tag, reset_bg_colors[bg_color_number]); + if (bg_color_number) + goto reset_style; } else { goto error; } return; + +reset_style: + strcat(reset_style_tag, UNIVERSAL_RESET_TAG); + len = strlen(reset_style_tag); + get_style_tag_for_cell(props, row, col, reset_style_tag + len, sz - len); + return; + error: /* shouldn't be here */ assert(0); diff --git a/src/properties.h b/src/properties.h index 1b4e795..4315e9a 100644 --- a/src/properties.h +++ b/src/properties.h @@ -9,7 +9,7 @@ #define PROP_SET(ft_props, property) ((ft_props) |=(property)) #define PROP_UNSET(ft_props, property) ((ft_props) &= ~((uint32_t)(property))) -#define TEXT_STYLE_TAG_MAX_SIZE 64 +#define TEXT_STYLE_TAG_MAX_SIZE (64 * 2) FT_INTERNAL void get_style_tag_for_cell(const fort_table_properties_t *props, @@ -73,7 +73,7 @@ FT_INTERNAL fort_status_t set_default_cell_property(uint32_t property, int value); -/* TABLE BORDER DESRIPTION +/* TABLE BORDER DESСRIPTION * * * TL TT TT TT TV TT TT TT TT TT TT TT TR diff --git a/tests/bb_tests/test_table_properties.c b/tests/bb_tests/test_table_properties.c index 6d16b74..0910e4a 100644 --- a/tests/bb_tests/test_table_properties.c +++ b/tests/bb_tests/test_table_properties.c @@ -748,9 +748,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const char *table_str_etalon = "+----+\n" - "|\033[33m\033[39m |\n" - "| \033[33m42\033[39m |\n" - "|\033[33m\033[39m |\n" + "|\033[33m\033[0m |\n" + "| \033[33m42\033[0m |\n" + "|\033[33m\033[0m |\n" "+----+\n"; assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -767,9 +767,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const wchar_t *table_str_etalon = L"+----+\n" - L"|\033[33m\033[39m |\n" - L"| \033[33m42\033[39m |\n" - L"|\033[33m\033[39m |\n" + L"|\033[33m\033[0m |\n" + L"| \033[33m42\033[0m |\n" + L"|\033[33m\033[0m |\n" L"+----+\n"; assert_wcs_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -786,9 +786,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const char *table_str_etalon = "+----+\n" - "|\033[43m\033[49m |\n" - "| \033[43m42\033[49m |\n" - "|\033[43m\033[49m |\n" + "|\033[43m\033[0m |\n" + "| \033[43m42\033[0m |\n" + "|\033[43m\033[0m |\n" "+----+\n"; assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -805,9 +805,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const wchar_t *table_str_etalon = L"+----+\n" - L"|\033[43m\033[49m |\n" - L"| \033[43m42\033[49m |\n" - L"|\033[43m\033[49m |\n" + L"|\033[43m\033[0m |\n" + L"| \033[43m42\033[0m |\n" + L"|\033[43m\033[0m |\n" L"+----+\n"; assert_wcs_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -824,9 +824,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const char *table_str_etalon = "+----+\n" - "|\033[43m \033[49m|\n" - "|\033[43m 42 \033[49m|\n" - "|\033[43m \033[49m|\n" + "|\033[43m \033[0m|\n" + "|\033[43m 42 \033[0m|\n" + "|\033[43m \033[0m|\n" "+----+\n"; assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -843,9 +843,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const wchar_t *table_str_etalon = L"+----+\n" - L"|\033[43m \033[49m|\n" - L"|\033[43m 42 \033[49m|\n" - L"|\033[43m \033[49m|\n" + L"|\033[43m \033[0m|\n" + L"|\033[43m 42 \033[0m|\n" + L"|\033[43m \033[0m|\n" L"+----+\n"; assert_wcs_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -862,9 +862,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const char *table_str_etalon = "+----+\n" - "|\033[4m\033[24m |\n" - "| \033[4m42\033[24m |\n" - "|\033[4m\033[24m |\n" + "|\033[4m\033[0m |\n" + "| \033[4m42\033[0m |\n" + "|\033[4m\033[0m |\n" "+----+\n"; assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -881,9 +881,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const wchar_t *table_str_etalon = L"+----+\n" - L"|\033[4m\033[24m |\n" - L"| \033[4m42\033[24m |\n" - L"|\033[4m\033[24m |\n" + L"|\033[4m\033[0m |\n" + L"| \033[4m42\033[0m |\n" + L"|\033[4m\033[0m |\n" L"+----+\n"; assert_wcs_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -901,9 +901,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const char *table_str_etalon = "+----+\n" - "|\033[1m\033[4m\033[21m\033[24m |\n" - "| \033[1m\033[4m42\033[21m\033[24m |\n" - "|\033[1m\033[4m\033[21m\033[24m |\n" + "|\033[1m\033[4m\033[0m |\n" + "| \033[1m\033[4m42\033[0m |\n" + "|\033[1m\033[4m\033[0m |\n" "+----+\n"; assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -921,9 +921,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const wchar_t *table_str_etalon = L"+----+\n" - L"|\033[1m\033[4m\033[21m\033[24m |\n" - L"| \033[1m\033[4m42\033[21m\033[24m |\n" - L"|\033[1m\033[4m\033[21m\033[24m |\n" + L"|\033[1m\033[4m\033[0m |\n" + L"| \033[1m\033[4m42\033[0m |\n" + L"|\033[1m\033[4m\033[0m |\n" L"+----+\n"; assert_wcs_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -940,9 +940,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const char *table_str_etalon = "+----+\n" - "|\033[4m \033[24m|\n" - "|\033[4m 42 \033[24m|\n" - "|\033[4m \033[24m|\n" + "|\033[4m \033[0m|\n" + "|\033[4m 42 \033[0m|\n" + "|\033[4m \033[0m|\n" "+----+\n"; assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -959,9 +959,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const wchar_t *table_str_etalon = L"+----+\n" - L"|\033[4m \033[24m|\n" - L"|\033[4m 42 \033[24m|\n" - L"|\033[4m \033[24m|\n" + L"|\033[4m \033[0m|\n" + L"|\033[4m 42 \033[0m|\n" + L"|\033[4m \033[0m|\n" L"+----+\n"; assert_wcs_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -979,9 +979,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const char *table_str_etalon = "+----+\n" - "|\033[1m\033[4m \033[21m\033[24m|\n" - "|\033[1m\033[4m 42 \033[21m\033[24m|\n" - "|\033[1m\033[4m \033[21m\033[24m|\n" + "|\033[1m\033[4m \033[0m|\n" + "|\033[1m\033[4m 42 \033[0m|\n" + "|\033[1m\033[4m \033[0m|\n" "+----+\n"; assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -999,9 +999,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const wchar_t *table_str_etalon = L"+----+\n" - L"|\033[1m\033[4m \033[21m\033[24m|\n" - L"|\033[1m\033[4m 42 \033[21m\033[24m|\n" - L"|\033[1m\033[4m \033[21m\033[24m|\n" + L"|\033[1m\033[4m \033[0m|\n" + L"|\033[1m\033[4m 42 \033[0m|\n" + L"|\033[1m\033[4m \033[0m|\n" L"+----+\n"; assert_wcs_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -1023,9 +1023,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const char *table_str_etalon = "+----+\n" - "|\033[41m\033[4m\033[33m\033[24m\033[39m \033[49m|\n" - "|\033[41m \033[4m\033[33m42\033[24m\033[39m \033[49m|\n" - "|\033[41m\033[4m\033[33m\033[24m\033[39m \033[49m|\n" + "|\033[41m\033[4m\033[33m\033[0m\033[41m \033[0m|\n" + "|\033[41m \033[4m\033[33m42\033[0m\033[41m \033[0m|\n" + "|\033[41m\033[4m\033[33m\033[0m\033[41m \033[0m|\n" "+----+\n"; assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); @@ -1046,9 +1046,9 @@ void test_table_text_styles(void) assert_true(table_str != NULL); const wchar_t *table_str_etalon = L"+----+\n" - L"|\033[41m\033[4m\033[33m\033[24m\033[39m \033[49m|\n" - L"|\033[41m \033[4m\033[33m42\033[24m\033[39m \033[49m|\n" - L"|\033[41m\033[4m\033[33m\033[24m\033[39m \033[49m|\n" + L"|\033[41m\033[4m\033[33m\033[0m\033[41m \033[0m|\n" + L"|\033[41m \033[4m\033[33m42\033[0m\033[41m \033[0m|\n" + L"|\033[41m\033[4m\033[33m\033[0m\033[41m \033[0m|\n" L"+----+\n"; assert_wcs_equal(table_str, table_str_etalon); ft_destroy_table(table); diff --git a/tests/bb_tests_cpp/test_table_properties.cpp b/tests/bb_tests_cpp/test_table_properties.cpp index 18a438d..6dffe89 100644 --- a/tests/bb_tests_cpp/test_table_properties.cpp +++ b/tests/bb_tests_cpp/test_table_properties.cpp @@ -558,9 +558,9 @@ void test_cpp_table_text_styles(void) std::string table_str = table.to_string(); std::string table_str_etalon = "+----+\n" - "|\033[33m\033[39m |\n" - "| \033[33m42\033[39m |\n" - "|\033[33m\033[39m |\n" + "|\033[33m\033[0m |\n" + "| \033[33m42\033[0m |\n" + "|\033[33m\033[0m |\n" "+----+\n"; assert_string_equal(table_str, table_str_etalon); } @@ -574,9 +574,9 @@ void test_cpp_table_text_styles(void) std::string table_str = table.to_string(); std::string table_str_etalon = "+----+\n" - "|\033[43m\033[49m |\n" - "| \033[43m42\033[49m |\n" - "|\033[43m\033[49m |\n" + "|\033[43m\033[0m |\n" + "| \033[43m42\033[0m |\n" + "|\033[43m\033[0m |\n" "+----+\n"; assert_string_equal(table_str, table_str_etalon); } @@ -590,9 +590,9 @@ void test_cpp_table_text_styles(void) std::string table_str = table.to_string(); std::string table_str_etalon = "+----+\n" - "|\033[43m \033[49m|\n" - "|\033[43m 42 \033[49m|\n" - "|\033[43m \033[49m|\n" + "|\033[43m \033[0m|\n" + "|\033[43m 42 \033[0m|\n" + "|\033[43m \033[0m|\n" "+----+\n"; assert_string_equal(table_str, table_str_etalon); } @@ -606,9 +606,9 @@ void test_cpp_table_text_styles(void) std::string table_str = table.to_string(); std::string table_str_etalon = "+----+\n" - "|\033[4m\033[24m |\n" - "| \033[4m42\033[24m |\n" - "|\033[4m\033[24m |\n" + "|\033[4m\033[0m |\n" + "| \033[4m42\033[0m |\n" + "|\033[4m\033[0m |\n" "+----+\n"; assert_string_equal(table_str, table_str_etalon); } @@ -623,9 +623,9 @@ void test_cpp_table_text_styles(void) std::string table_str = table.to_string(); std::string table_str_etalon = "+----+\n" - "|\033[1m\033[4m\033[21m\033[24m |\n" - "| \033[1m\033[4m42\033[21m\033[24m |\n" - "|\033[1m\033[4m\033[21m\033[24m |\n" + "|\033[1m\033[4m\033[0m |\n" + "| \033[1m\033[4m42\033[0m |\n" + "|\033[1m\033[4m\033[0m |\n" "+----+\n"; assert_string_equal(table_str, table_str_etalon); } @@ -639,9 +639,9 @@ void test_cpp_table_text_styles(void) std::string table_str = table.to_string(); std::string table_str_etalon = "+----+\n" - "|\033[4m \033[24m|\n" - "|\033[4m 42 \033[24m|\n" - "|\033[4m \033[24m|\n" + "|\033[4m \033[0m|\n" + "|\033[4m 42 \033[0m|\n" + "|\033[4m \033[0m|\n" "+----+\n"; assert_string_equal(table_str, table_str_etalon); } @@ -656,9 +656,9 @@ void test_cpp_table_text_styles(void) std::string table_str = table.to_string(); std::string table_str_etalon = "+----+\n" - "|\033[1m\033[4m \033[21m\033[24m|\n" - "|\033[1m\033[4m 42 \033[21m\033[24m|\n" - "|\033[1m\033[4m \033[21m\033[24m|\n" + "|\033[1m\033[4m \033[0m|\n" + "|\033[1m\033[4m 42 \033[0m|\n" + "|\033[1m\033[4m \033[0m|\n" "+----+\n"; assert_string_equal(table_str, table_str_etalon); } @@ -674,9 +674,9 @@ void test_cpp_table_text_styles(void) std::string table_str = table.to_string(); std::string table_str_etalon = "+----+\n" - "|\033[41m\033[4m\033[33m\033[24m\033[39m \033[49m|\n" - "|\033[41m \033[4m\033[33m42\033[24m\033[39m \033[49m|\n" - "|\033[41m\033[4m\033[33m\033[24m\033[39m \033[49m|\n" + "|\033[41m\033[4m\033[33m\033[0m\033[41m \033[0m|\n" + "|\033[41m \033[4m\033[33m42\033[0m\033[41m \033[0m|\n" + "|\033[41m\033[4m\033[33m\033[0m\033[41m \033[0m|\n" "+----+\n"; assert_string_equal(table_str, table_str_etalon); } diff --git a/tests/main_test_cpp.cpp b/tests/main_test_cpp.cpp index 12459da..b64f7a9 100644 --- a/tests/main_test_cpp.cpp +++ b/tests/main_test_cpp.cpp @@ -12,11 +12,11 @@ void test_cpp_table_text_styles(void); struct test_case bb_test_suite [] = { -// {"test_cpp_table_basic", test_cpp_table_basic}, + {"test_cpp_table_basic", test_cpp_table_basic}, {"test_cpp_table_write", test_cpp_table_write}, -// {"test_cpp_table_tbl_properties", test_cpp_table_tbl_properties}, -// {"test_cpp_table_cell_properties", test_cpp_table_cell_properties}, -// {"test_cpp_table_text_styles", test_cpp_table_text_styles}, + {"test_cpp_table_tbl_properties", test_cpp_table_tbl_properties}, + {"test_cpp_table_cell_properties", test_cpp_table_cell_properties}, + {"test_cpp_table_text_styles", test_cpp_table_text_styles}, };