[F] Fixed buf

This commit is contained in:
seleznevae
2018-11-25 17:25:48 +03:00
parent 64abbfd41b
commit dc7640a9e4
9 changed files with 158 additions and 45 deletions

View File

@@ -3,6 +3,29 @@
#include <wchar.h>
#include "fort.h"
#ifdef FT_HAVE_WCHAR
void test_bug_fixes(void)
{
SCENARIO("Bug 1") {
ft_table_t *table = ft_create_table();
ft_table_t *table_tmp_1 = ft_create_table();
// ft_set_border_style(table_tmp_1, FT_EMPTY_STYLE);
ft_set_cell_prop(table_tmp_1, 0, FT_ANY_COLUMN, FT_CPROP_ROW_TYPE, FT_ROW_HEADER);
ft_wwrite_ln(table_tmp_1, L"Rank", L"Title", L"Year", L"Rating");
ft_wwrite_ln(table_tmp_1, L"1", L"The Shawshank Redemption", L"3");
const wchar_t *str = ft_to_wstring(table_tmp_1);
(void)str;
ft_wprintf_ln(table, str);
ft_destroy_table(table_tmp_1);
ft_destroy_table(table);
}
}
#endif
void test_table_basic(void)
{
ft_table_t *table = NULL;

View File

@@ -3,6 +3,9 @@
#include "fort.h"
/* Test cases */
#ifdef FT_HAVE_WCHAR
void test_bug_fixes(void);
#endif
void test_vector_basic(void);
void test_vector_stress(void);
void test_string_buffer(void);
@@ -35,6 +38,9 @@ struct test_case wb_test_suit [] = {
struct test_case bb_test_suit [] = {
#ifdef FT_HAVE_WCHAR
{"test_bug_fixes", test_bug_fixes},
#endif
{"test_table_basic", test_table_basic},
#ifdef FT_HAVE_WCHAR
{"test_wcs_table_boundaries", test_wcs_table_boundaries},

View File

@@ -13,7 +13,7 @@ fort_status_t str_n_substring(const char *str, char ch_separator, size_t n, cons
void wstr_n_substring(const wchar_t *str, wchar_t ch_separator, size_t n, const wchar_t **begin, const wchar_t **end);
size_t buffer_text_width(string_buffer_t *buffer);
//size_t buffer_text_width(string_buffer_t *buffer);
void test_strchr_count(void);