fix widget_do_exec

This commit is contained in:
lixianjing 2019-11-07 09:44:26 +08:00
parent 590f89100d
commit 39678db0eb
2 changed files with 2 additions and 1 deletions

View File

@ -1289,7 +1289,7 @@ ret_t widget_paint(widget_t* widget, canvas_t* c) {
static const widget_cmd_t s_widget_cmds[] = {{"start_animator", widget_start_animator},
{"stop_animator", widget_stop_animator},
{"pause_animator", widget_pause_animator},
{"pause_animator", widget_destroy_animator}};
{"destroy_animator", widget_destroy_animator}};
static ret_t widget_do_exec(widget_t* widget, const char* cmd, const char* args) {
uint32_t i = 0;

View File

@ -1189,6 +1189,7 @@ TEST(Widget, exec) {
ASSERT_EQ(widget_set_prop_str(w, WIDGET_PROP_EXEC, "pause_animator:move"), RET_OK);
ASSERT_EQ(widget_set_prop_str(w, WIDGET_PROP_EXEC, "stop_animator:move"), RET_OK);
ASSERT_EQ(widget_set_prop_str(w, WIDGET_PROP_EXEC, "start_animator:move"), RET_OK);
ASSERT_EQ(widget_set_prop_str(w, WIDGET_PROP_EXEC, "destroy_animator:move"), RET_OK);
ASSERT_EQ(widget_set_prop_str(w, WIDGET_PROP_EXEC, "not found"), RET_NOT_FOUND);
ASSERT_EQ(widget_set_prop_str(w, WIDGET_PROP_EXEC, NULL), RET_NOT_FOUND);