diff options
author | Andy Williams <andy@andywilliams.me> | 2016-08-03 23:43:23 +0100 |
---|---|---|
committer | Andy Williams <andy@andywilliams.me> | 2016-08-03 23:43:23 +0100 |
commit | f2a4ff154fc67a4e5982d84c33440ea5c0705252 (patch) | |
tree | 2e4ff331e5921f1e5daff54db1e9ef6b373fb0d4 /src | |
parent | 7925c56ec96f600d77b108d296c20bc3a9b1d3bd (diff) |
Fix further text checks in Elm_Code T4264
An incorrect assumption in how unused memory may be initialised
@fix
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/elementary/elm_code_test_text.c | 7 | ||||
-rw-r--r-- | src/tests/elementary/elm_code_test_widget_selection.c | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/tests/elementary/elm_code_test_text.c b/src/tests/elementary/elm_code_test_text.c index 51dbf8d0b7..fb198c9649 100644 --- a/src/tests/elementary/elm_code_test_text.c +++ b/src/tests/elementary/elm_code_test_text.c | |||
@@ -15,7 +15,7 @@ START_TEST (elm_code_text_get_test) | |||
15 | Elm_Code_Line *line; | 15 | Elm_Code_Line *line; |
16 | 16 | ||
17 | const char *str; | 17 | const char *str; |
18 | int len; | 18 | unsigned int len; |
19 | 19 | ||
20 | elm_init(1, NULL); | 20 | elm_init(1, NULL); |
21 | code = elm_code_create(); | 21 | code = elm_code_create(); |
@@ -35,6 +35,8 @@ START_TEST (elm_code_text_insert_test) | |||
35 | Elm_Code *code; | 35 | Elm_Code *code; |
36 | Elm_Code_File *file; | 36 | Elm_Code_File *file; |
37 | Elm_Code_Line *line; | 37 | Elm_Code_Line *line; |
38 | const char *text; | ||
39 | unsigned int length; | ||
38 | 40 | ||
39 | elm_init(1, NULL); | 41 | elm_init(1, NULL); |
40 | code = elm_code_create(); | 42 | code = elm_code_create(); |
@@ -44,7 +46,8 @@ START_TEST (elm_code_text_insert_test) | |||
44 | line = elm_code_file_line_get(file, 1); | 46 | line = elm_code_file_line_get(file, 1); |
45 | 47 | ||
46 | elm_code_line_text_insert(line, 4, "ing", 3); | 48 | elm_code_line_text_insert(line, 4, "ing", 3); |
47 | ck_assert_str_eq("testing", elm_code_line_text_get(line, NULL)); | 49 | text = elm_code_line_text_get(line, &length); |
50 | ck_assert_strn_eq("testing", text, length); | ||
48 | elm_shutdown(); | 51 | elm_shutdown(); |
49 | } | 52 | } |
50 | END_TEST | 53 | END_TEST |
diff --git a/src/tests/elementary/elm_code_test_widget_selection.c b/src/tests/elementary/elm_code_test_widget_selection.c index 9cb4b90e33..562a106595 100644 --- a/src/tests/elementary/elm_code_test_widget_selection.c +++ b/src/tests/elementary/elm_code_test_widget_selection.c | |||
@@ -376,6 +376,7 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_twoline) | |||
376 | Elm_Code_Widget *widget; | 376 | Elm_Code_Widget *widget; |
377 | Evas_Object *win; | 377 | Evas_Object *win; |
378 | const char *text; | 378 | const char *text; |
379 | unsigned int length; | ||
379 | 380 | ||
380 | elm_init(1, NULL); | 381 | elm_init(1, NULL); |
381 | code = elm_code_create(); | 382 | code = elm_code_create(); |
@@ -395,8 +396,8 @@ START_TEST (elm_code_test_widget_selection_reverse_delete_twoline) | |||
395 | elm_code_widget_selection_delete(widget); | 396 | elm_code_widget_selection_delete(widget); |
396 | 397 | ||
397 | line = elm_code_file_line_get(file, 1); | 398 | line = elm_code_file_line_get(file, 1); |
398 | text = elm_code_line_text_get(line, NULL); | 399 | text = elm_code_line_text_get(line, &length); |
399 | ck_assert_str_eq("teXT", text); | 400 | ck_assert_strn_eq("teXT", text, length); |
400 | ck_assert_int_eq(1, elm_code_file_lines_get(file)); | 401 | ck_assert_int_eq(1, elm_code_file_lines_get(file)); |
401 | 402 | ||
402 | elm_code_free(code); | 403 | elm_code_free(code); |