fix tests

This commit is contained in:
xianjimli 2020-03-05 06:22:23 +08:00
parent 01a13f401c
commit f0e2c940d0
2 changed files with 15 additions and 1 deletions

View File

@ -114,3 +114,17 @@ TEST(Path, approot) {
ASSERT_EQ(path_build(result, sizeof(result), app_root, "bin", NULL), RET_OK);
ASSERT_EQ(path_exist(result), TRUE);
}
TEST(Path, replace_basename) {
const char* filename = "a/b/test.txt";
char result[MAX_PATH + 1];
ASSERT_EQ(path_replace_basename(result, sizeof(result), filename, "abc.txt"), RET_OK);
ASSERT_STREQ(result, "a/b/abc.txt");
}
TEST(Path, replace_extname) {
const char* filename = "a/b/test.txt";
char result[MAX_PATH + 1];
ASSERT_EQ(path_replace_extname(result, sizeof(result), filename, "abc"), RET_OK);
ASSERT_STREQ(result, "a/b/test.abc");
}

View File

@ -61,7 +61,7 @@ TEST(Slider, event) {
slider->dragging = TRUE;
slider_set_value(w, 20);
ASSERT_EQ(s_log, "will_change;change;");
ASSERT_EQ(s_log, "");
slider->dragging = FALSE;
widget_destroy(w);