diff options
author | Quentin Glidic <sardemff7+git@sardemff7.net> | 2017-05-30 13:40:03 +0200 |
---|---|---|
committer | Quentin Glidic <sardemff7+git@sardemff7.net> | 2017-05-30 13:45:20 +0200 |
commit | 4e448eac45188079028e03577bb45dce624ffd9c (patch) | |
tree | bf1c3ed2cd1831eac73756a2f3edfc34a08e81a2 | |
parent | c68dc38c362dcbb69728b92856fd0e48f1fe8500 (diff) |
widget.test: Add NULL tests for trigger_action functions
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
-rw-r--r-- | source/widgets/widget.c | 3 | ||||
-rw-r--r-- | test/widget-test.c | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source/widgets/widget.c b/source/widgets/widget.c index 353ab754..2638c0e2 100644 --- a/source/widgets/widget.c +++ b/source/widgets/widget.c @@ -463,6 +463,9 @@ WidgetTriggerActionResult widget_trigger_action ( widget *wid, guint action, gin void widget_set_trigger_action_handler ( widget *wid, widget_trigger_action_cb cb, void * cb_data ) { + if ( wid == NULL ) { + return; + } wid->trigger_action = cb; wid->trigger_action_cb_data = cb_data; } diff --git a/test/widget-test.c b/test/widget-test.c index 89eab728..e8c4b2ae 100644 --- a/test/widget-test.c +++ b/test/widget-test.c @@ -189,10 +189,8 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv ) widget_update ( NULL ); widget_queue_redraw ( NULL ); TASSERT (widget_need_redraw ( NULL ) == FALSE); - /* FIXME: add relevant code for binding rework - widget_clicked ( NULL, NULL ); - widget_set_clicked_handler ( NULL, NULL, NULL ); - */ + widget_trigger_action ( NULL, 0, 0, 0 ); + widget_set_trigger_action_handler ( NULL, NULL, NULL ); g_free(wid); |