2018-05-06 15:21:45 +02:00
|
|
|
#include "tests.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "fort.h"
|
|
|
|
|
2018-05-06 15:28:18 +02:00
|
|
|
#ifdef FORT_WB_TESTING_ENABLED
|
|
|
|
struct test_case wb_test_suit [] = {
|
|
|
|
{"test_vector_basic", test_vector_basic},
|
|
|
|
{"test_vector_stress", test_vector_stress},
|
|
|
|
{"test_string_buffer", test_string_buffer},
|
|
|
|
{"test_table_sizes", test_table_sizes},
|
|
|
|
{"test_table_geometry", test_table_geometry},
|
2018-11-03 10:41:58 +01:00
|
|
|
{"test_table_copy", test_table_copy},
|
2018-05-06 15:28:18 +02:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
struct test_case bb_test_suit [] = {
|
|
|
|
{"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},
|
2018-05-06 17:25:53 +02:00
|
|
|
{"test_table_builtin_border_styles", test_table_builtin_border_styles},
|
2018-11-03 21:50:30 +01:00
|
|
|
{"test_table_cell_properties", test_table_cell_properties},
|
|
|
|
{"test_table_tbl_properties", test_table_tbl_properties},
|
2018-11-10 07:58:21 +01:00
|
|
|
{"test_table_text_styles", test_table_text_styles},
|
2018-05-06 15:28:18 +02:00
|
|
|
{"test_memory_errors", test_memory_errors},
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef FORT_WB_TESTING_ENABLED
|
|
|
|
int run_wb_test_suit(void)
|
|
|
|
{
|
|
|
|
int wb_n_tests = sizeof(wb_test_suit) / sizeof(wb_test_suit[0]);
|
|
|
|
run_test_suit("WHITE BOX TEST SUITE", wb_n_tests, wb_test_suit);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
int run_bb_test_suit(void)
|
|
|
|
{
|
|
|
|
int bb_n_tests = sizeof(bb_test_suit) / sizeof(bb_test_suit[0]);
|
|
|
|
run_test_suit("BLACK BOX TEST SUITE", bb_n_tests, bb_test_suit);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-05-06 15:21:45 +02:00
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
int status = 0;
|
|
|
|
|
2018-05-09 12:29:29 +02:00
|
|
|
/*
|
|
|
|
* Essential for OSX, because swprintf can fail in case of real unicode
|
|
|
|
* chars.
|
|
|
|
*/
|
2018-11-14 20:50:36 +01:00
|
|
|
#if defined(FT_HAVE_WCHAR)
|
2018-05-09 12:29:29 +02:00
|
|
|
setlocale(LC_CTYPE, "");
|
2018-11-14 20:50:36 +01:00
|
|
|
#endif
|
2018-05-09 12:29:29 +02:00
|
|
|
|
2018-11-14 20:50:36 +01:00
|
|
|
#ifdef FORT_WB_TESTING_ENABLED
|
|
|
|
status |= run_wb_test_suit();
|
|
|
|
fprintf(stderr, "\n");
|
|
|
|
#endif
|
|
|
|
status |= run_bb_test_suit();
|
2018-11-10 07:58:21 +01:00
|
|
|
|
2018-05-06 15:21:45 +02:00
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|