Fix further text checks in Elm_Code T4264

An incorrect assumption in how unused memory may be initialised
    @fix
This commit is contained in:
Andy Williams 2016-08-03 23:43:23 +01:00
parent 7925c56ec9
commit f2a4ff154f
2 changed files with 8 additions and 4 deletions

View File

@ -15,7 +15,7 @@ START_TEST (elm_code_text_get_test)
Elm_Code_Line *line;
const char *str;
int len;
unsigned int len;
elm_init(1, NULL);
code = elm_code_create();
@ -35,6 +35,8 @@ START_TEST (elm_code_text_insert_test)
Elm_Code *code;
Elm_Code_File *file;
Elm_Code_Line *line;
const char *text;
unsigned int length;
elm_init(1, NULL);
code = elm_code_create();
@ -44,7 +46,8 @@ START_TEST (elm_code_text_insert_test)
line = elm_code_file_line_get(file, 1);
elm_code_line_text_insert(line, 4, "ing", 3);
ck_assert_str_eq("testing", elm_code_line_text_get(line, NULL));
text = elm_code_line_text_get(line, &length);
ck_assert_strn_eq("testing", text, length);
elm_shutdown();
}
END_TEST

View File

@ -376,6 +376,7 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_twoline)
Elm_Code_Widget *widget;
Evas_Object *win;
const char *text;
unsigned int length;
elm_init(1, NULL);
code = elm_code_create();
@ -395,8 +396,8 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_twoline)
elm_code_widget_selection_delete(widget);
line = elm_code_file_line_get(file, 1);
text = elm_code_line_text_get(line, NULL);
ck_assert_str_eq("teXT", text);
text = elm_code_line_text_get(line, &length);
ck_assert_strn_eq("teXT", text, length);
ck_assert_int_eq(1, elm_code_file_lines_get(file));
elm_code_free(code);