From b14eabb679d6fbd8eb8b30a8427c9fb92aff877c Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 3 Feb 2015 13:55:20 +0000 Subject: [PATCH] Fix the tests to work with widget improvements --- elm_code/lib/elm_code_widget_text.c | 3 +++ elm_code/tests/elm_code_test_widget.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/elm_code/lib/elm_code_widget_text.c b/elm_code/lib/elm_code_widget_text.c index 30872c8..e96b5d1 100644 --- a/elm_code/lib/elm_code_widget_text.c +++ b/elm_code/lib/elm_code_widget_text.c @@ -26,6 +26,9 @@ elm_code_widget_text_left_gutter_width_get(Elm_Code_Widget *widget) Elm_Code_Widget_Data *pd; int width = 1; // the status icon, for now + if (!widget) + return width; + pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); if (pd->show_line_numbers) diff --git a/elm_code/tests/elm_code_test_widget.c b/elm_code/tests/elm_code_test_widget.c index 6efdce8..22ab5b5 100644 --- a/elm_code/tests/elm_code_test_widget.c +++ b/elm_code/tests/elm_code_test_widget.c @@ -29,7 +29,7 @@ START_TEST (elm_code_widget_token_render_simple_test) elm_code_file_line_token_add(file, 1, 6+1, 17+1, ELM_CODE_TOKEN_TYPE_COMMENT); elm_code_file_line_token_add(file, 1, 21+1, 22+1, ELM_CODE_TOKEN_TYPE_COMMENT); - _elm_code_widget_fill_line_tokens(cells, length+1, line); + _elm_code_widget_fill_line_tokens(NULL, cells, length+1, line); _assert_cell_type(cells[1], ELM_CODE_TOKEN_TYPE_DEFAULT, 1); _assert_cell_type(cells[4], ELM_CODE_TOKEN_TYPE_DEFAULT, 4); _assert_cell_type(cells[6], ELM_CODE_TOKEN_TYPE_DEFAULT, 6);