summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_code_test_text.c
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2016-08-03 23:43:23 +0100
committerAndy Williams <andy@andywilliams.me>2016-08-03 23:43:23 +0100
commitf2a4ff154fc67a4e5982d84c33440ea5c0705252 (patch)
tree2e4ff331e5921f1e5daff54db1e9ef6b373fb0d4 /src/tests/elementary/elm_code_test_text.c
parent7925c56ec96f600d77b108d296c20bc3a9b1d3bd (diff)
Fix further text checks in Elm_Code T4264
An incorrect assumption in how unused memory may be initialised @fix
Diffstat (limited to 'src/tests/elementary/elm_code_test_text.c')
-rw-r--r--src/tests/elementary/elm_code_test_text.c7
1 files changed, 5 insertions, 2 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)
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}
50END_TEST 53END_TEST