summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2016-08-02 23:23:31 +0100
committerAndy Williams <andy@andywilliams.me>2016-08-02 23:23:31 +0100
commitf7396703c5a5b27e396312466498de302537a0c2 (patch)
tree7784c44c7c610e413e1178c2014ec5d282fc7d57 /src/tests
parent716be1bae404ceab049832da679d4e0598791ae2 (diff)
Fix text check in Elm_Code T4264
An incorrect assumption in how unused memory may be initialised @fix
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/elm_code_test_text.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tests/elementary/elm_code_test_text.c b/src/tests/elementary/elm_code_test_text.c
index 934b98b..51dbf8d 100644
--- a/src/tests/elementary/elm_code_test_text.c
+++ b/src/tests/elementary/elm_code_test_text.c
@@ -14,13 +14,18 @@ START_TEST (elm_code_text_get_test)
14 Elm_Code_File *file; 14 Elm_Code_File *file;
15 Elm_Code_Line *line; 15 Elm_Code_Line *line;
16 16
17 const char *str;
18 int len;
19
17 elm_init(1, NULL); 20 elm_init(1, NULL);
18 code = elm_code_create(); 21 code = elm_code_create();
19 file = elm_code_file_new(code); 22 file = elm_code_file_new(code);
20 23
21 elm_code_file_line_append(file, "test", 4, NULL); 24 elm_code_file_line_append(file, "test", 4, NULL);
22 line = elm_code_file_line_get(file, 1); 25 line = elm_code_file_line_get(file, 1);
23 ck_assert_str_eq("test", elm_code_line_text_get(line, NULL)); 26 str = elm_code_line_text_get(line, &len);
27
28 ck_assert_strn_eq("test", str, len);
24 elm_shutdown(); 29 elm_shutdown();
25} 30}
26END_TEST 31END_TEST