1
0
Fork 0

[C] Modified tests

This commit is contained in:
seleznevae 2018-02-26 21:54:36 +03:00
parent 85ffccfdb2
commit d12ea18353
1 changed files with 16 additions and 13 deletions

View File

@ -826,25 +826,28 @@ void test_table_options(void **state)
status |= ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned); status |= ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
status |= ft_set_cell_option(table, FT_ANY_ROW, 2, FT_OPT_MIN_WIDTH, 8); status |= ft_set_cell_option(table, FT_ANY_ROW, 2, FT_OPT_MIN_WIDTH, 8);
status |= ft_set_cell_option(table, FT_ANY_ROW, 2, FT_OPT_TEXT_ALIGN, CenterAligned); status |= ft_set_cell_option(table, FT_ANY_ROW, 2, FT_OPT_TEXT_ALIGN, CenterAligned);
status |= ft_set_cell_option(table, 2, 3, FT_OPT_MIN_WIDTH, 6);
status |= ft_set_cell_option(table, 2, 3, FT_OPT_TEXT_ALIGN, LeftAligned);
assert_true( status == F_SUCCESS); assert_true( status == F_SUCCESS);
const char *table_str = ft_to_string(table); const char *table_str = ft_to_string(table);
assert_true( table_str != NULL ); assert_true( table_str != NULL );
const char *table_str_etalon = const char *table_str_etalon =
"+---+-------+--------+----+\n" "+---+-------+--------+------+\n"
"| | | | |\n" "| | | | |\n"
"| 3 | 4 | 55 | 67 |\n" "| 3 | 4 | 55 | 67 |\n"
"| | | | |\n" "| | | | |\n"
"+---+-------+--------+----+\n" "+---+-------+--------+------+\n"
"| | | | |\n" "| | | | |\n"
"| 3 | 4 | 55 | 67 |\n" "| 3 | 4 | 55 | 67 |\n"
"| | | | |\n" "| | | | |\n"
"+---+-------+--------+----+\n" "+---+-------+--------+------+\n"
"| | | | |\n" "| | | | |\n"
"| 3 | 4 | 55 | 67 |\n" "| 3 | 4 | 55 | 67 |\n"
"| | | | |\n" "| | | | |\n"
"+---+-------+--------+----+\n"; "+---+-------+--------+------+\n";
// fprintf(stderr, "content:\n%s", table_str); // fprintf(stderr, "content:\n%s", table_str);
assert_true( strcmp(table_str, table_str_etalon) == 0); assert_true( strcmp(table_str, table_str_etalon) == 0);