[A] Added HAVE_WCHAR config option

This commit is contained in:
seleznevae
2018-04-16 21:01:45 +03:00
parent 0c844aa143
commit 551ec6089b
8 changed files with 171 additions and 42 deletions

View File

@@ -7,7 +7,9 @@ struct test_case test_suit [] = {
{"test_table_sizes", test_table_sizes},
{"test_table_geometry", test_table_geometry},
{"test_table_basic", test_table_basic},
#ifdef FT_HAVE_WCHAR
{"test_wcs_table_boundaries", test_wcs_table_boundaries},
#endif
{"test_table_write", test_table_write},
{"test_table_border_style", test_table_border_style},
{"test_table_cell_options", test_table_cell_options},

View File

@@ -35,6 +35,7 @@ void test_table_basic(void)
ft_destroy_table(table);
}
#ifdef FT_HAVE_WCHAR
WHEN("All columns are equal and not empty (wide strings)") {
table = ft_create_table();
assert_true(table != NULL);
@@ -64,6 +65,7 @@ void test_table_basic(void)
assert_wcs_equal(table_str, table_str_etalon);
ft_destroy_table(table);
}
#endif
@@ -97,6 +99,7 @@ void test_table_basic(void)
ft_destroy_table(table);
}
#ifdef FT_HAVE_WCHAR
WHEN("All columns are not equal and not empty (wide strings)") {
table = ft_create_table();
assert_true(table != NULL);
@@ -126,6 +129,7 @@ void test_table_basic(void)
assert_wcs_equal(table_str, table_str_etalon);
ft_destroy_table(table);
}
#endif
WHEN("All columns are not equal and some cells are empty") {
table = ft_create_table();
@@ -157,6 +161,7 @@ void test_table_basic(void)
ft_destroy_table(table);
}
#ifdef FT_HAVE_WCHAR
WHEN("All columns are not equal and some cells are empty (wide strings)") {
table = ft_create_table();
assert_true(table != NULL);
@@ -186,6 +191,7 @@ void test_table_basic(void)
assert_wcs_equal(table_str, table_str_etalon);
ft_destroy_table(table);
}
#endif
WHEN("All cells are empty") {
table = ft_create_table();
@@ -217,6 +223,7 @@ void test_table_basic(void)
ft_destroy_table(table);
}
#ifdef FT_HAVE_WCHAR
WHEN("All cells are empty (wide strings)") {
table = ft_create_table();
assert_true(table != NULL);
@@ -246,11 +253,12 @@ void test_table_basic(void)
assert_wcs_equal(table_str, table_str_etalon);
ft_destroy_table(table);
}
#endif
}
#ifdef FT_HAVE_WCHAR
void test_wcs_table_boundaries(void)
{
FTABLE *table = NULL;
@@ -285,6 +293,7 @@ void test_wcs_table_boundaries(void)
ft_destroy_table(table);
}
}
#endif
void test_table_write(void)
@@ -332,6 +341,7 @@ void test_table_write(void)
ft_destroy_table(table);
}
#ifdef FT_HAVE_WCHAR
SCENARIO("Test wwrite functions(wide strings)") {
table = ft_create_table();
assert_true(table != NULL);
@@ -372,6 +382,7 @@ void test_table_write(void)
assert_wcs_equal(table_str, table_str_etalon);
ft_destroy_table(table);
}
#endif
SCENARIO("Test nwrite functions") {
table = ft_create_table();
@@ -404,6 +415,7 @@ void test_table_write(void)
ft_destroy_table(table);
}
#ifdef FT_HAVE_WCHAR
SCENARIO("Test nwwrite functions(wide strings)") {
table = ft_create_table();
assert_true(table != NULL);
@@ -434,6 +446,7 @@ void test_table_write(void)
assert_wcs_equal(table_str, table_str_etalon);
ft_destroy_table(table);
}
#endif
SCENARIO("Test row_write functions") {
@@ -470,6 +483,7 @@ void test_table_write(void)
ft_destroy_table(table);
}
#ifdef FT_HAVE_WCHAR
SCENARIO("Test row_write functions(wide strings)") {
table = ft_create_table();
assert_true(table != NULL);
@@ -503,6 +517,7 @@ void test_table_write(void)
assert_wcs_equal(table_str, table_str_etalon);
ft_destroy_table(table);
}
#endif
SCENARIO("Test printf functions") {

View File

@@ -70,6 +70,9 @@ void test_table_tbl_options(void)
}
#ifdef FT_HAVE_WCHAR
WHEN("Test setting entire table options(wide strings case)") {
set_test_options_as_default();
@@ -125,6 +128,7 @@ void test_table_tbl_options(void)
ft_destroy_table(table);
}
#endif
}

View File

@@ -33,7 +33,7 @@ int set_test_options_for_table(FTABLE *table)
return ft_set_border_style(table, &brdr_style);
}
int set_test_options_as_default()
int set_test_options_as_default(void)
{
int status = FT_SUCCESS;
@@ -101,6 +101,7 @@ FTABLE *create_test_int_table(int set_test_opts)
return table;
}
#ifdef FT_HAVE_WCHAR
FTABLE *create_test_int_wtable(int set_test_opts)
{
FTABLE *table = NULL;
@@ -130,3 +131,4 @@ FTABLE *create_test_int_wtable(int set_test_opts)
return table;
}
#endif

View File

@@ -19,7 +19,9 @@ void test_string_buffer(void);
void test_table_sizes(void);
void test_table_geometry(void);
void test_table_basic(void);
#ifdef FT_HAVE_WCHAR
void test_wcs_table_boundaries(void);
#endif
void test_table_write(void);
void test_table_border_style(void);
void test_table_cell_options(void);
@@ -60,7 +62,7 @@ struct test_case
}
int set_test_options_for_table(FTABLE *table);
int set_test_options_as_default();
int set_test_options_as_default(void);
FTABLE *create_test_int_table(int set_test_opts);
FTABLE *create_test_int_wtable(int set_test_opts);