Skip to content

Commit

Permalink
refactor: clear compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Dec 7, 2023
1 parent a1f45b7 commit 07f82f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/css/tests/test_css_computed.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static void check_length(const char *str, css_numeric_value_t actual,
ctest_equal_int(str, (int)actual, (int)expected);
}

static test_button_focus_style(void)
static void test_button_focus_style(void)
{
css_selector_t *selector;
css_style_decl_t *result;
Expand Down
18 changes: 10 additions & 8 deletions lib/i18n/tests/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ void test_i18n(void)
{
size_t len;
wchar_t lang[32];
wchar_t text_ok[] = {30830, 23450, 0};
wchar_t text_cn[] = {20013, 25991, 0};

len = i18n_detect_language(lang, 32);
ctest_equal_bool("i18n_detect_language()", len > 0, true);
Expand All @@ -22,29 +24,29 @@ void test_i18n(void)

i18n_change_language(L"en");

ctest_equal_bool("i18n_translate(L\"name\") == L\"English\")",
ctest_equal_bool("en: i18n_translate(L\"name\") == L\"English\")",
wcscmp(i18n_translate(L"name"), L"English") == 0,
true);

ctest_equal_bool("i18n_translate(L\"button.ok\") == L\"Ok\")",
ctest_equal_bool("en: i18n_translate(L\"button.ok\") == L\"Ok\")",
wcscmp(i18n_translate(L"button.ok"), L"Ok") == 0,
true);

ctest_equal_bool("i18n_translate(L\"button.notfound\") == NULL)",
ctest_equal_bool("en: i18n_translate(L\"button.notfound\") == NULL)",
i18n_translate(L"button.notfound")== NULL,
true);

i18n_change_language(L"zh-CN");

ctest_equal_bool("i18n_translate(L\"name\") == L\"中文\")",
wcscmp(i18n_translate(L"name"), L"中文") == 0,
ctest_equal_bool("zh-CN: i18n_translate(L\"name\")",
wcscmp(i18n_translate(L"name"), text_cn) == 0,
true);

ctest_equal_bool("i18n_translate(L\"button.ok\") == L\"确定\")",
wcscmp(i18n_translate(L"button.ok"), L"确定") == 0,
ctest_equal_bool("zh-CN: i18n_translate(L\"button.ok\")",
wcscmp(i18n_translate(L"button.ok"), text_ok) == 0,
true);

ctest_equal_bool("i18n_translate(L\"button.notfound\") == NULL)",
ctest_equal_bool("zh-CN: i18n_translate(L\"button.notfound\") == NULL",
i18n_translate(L"button.notfound")== NULL,
true);
i18n_clear();
Expand Down

0 comments on commit 07f82f5

Please sign in to comment.