ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f2a4ff154fc67a4e5982d84c33440ea5c0705252

commit f2a4ff154fc67a4e5982d84c33440ea5c0705252
Author: Andy Williams <[email protected]>
Date:   Wed Aug 3 23:43:23 2016 +0100

    Fix further text checks in Elm_Code T4264
    
        An incorrect assumption in how unused memory may be initialised
        @fix
---
 src/tests/elementary/elm_code_test_text.c             | 7 +++++--
 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 51dbf8d..fb198c9 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)
    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
diff --git a/src/tests/elementary/elm_code_test_widget_selection.c 
b/src/tests/elementary/elm_code_test_widget_selection.c
index 9cb4b90..562a106 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)
    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);

-- 


Reply via email to