summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_code_file_test_memory.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-06-02 17:19:08 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-06-02 17:19:08 -0700
commitd384012307881898a2df49f68fa6b46a4cd9972d (patch)
tree31706c65b8c56083a151470721cf36e8bb46939d /src/tests/elementary/elm_code_file_test_memory.c
parent9f129a8711f9bb71ee7cf6c13f7965926255c975 (diff)
elementary: merging in elm_code widget.
Theme is not there as it should be manually merged into the elementary default theme.
Diffstat (limited to 'src/tests/elementary/elm_code_file_test_memory.c')
-rw-r--r--src/tests/elementary/elm_code_file_test_memory.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_code_file_test_memory.c b/src/tests/elementary/elm_code_file_test_memory.c
new file mode 100644
index 0000000..f39228d
--- /dev/null
+++ b/src/tests/elementary/elm_code_file_test_memory.c
@@ -0,0 +1,49 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define ELM_INTERNAL_API_ARGESFSDFEFC
6
7#include "elm_suite.h"
8#include "Elementary.h"
9
10START_TEST (elm_code_file_memory_lines)
11{
12 Elm_Code *code;
13
14 elm_init(1, NULL);
15 code = elm_code_create();
16 ck_assert_uint_eq(0, elm_code_file_lines_get(code->file));
17
18 elm_code_file_line_append(code->file, "a line", 6, NULL);
19
20 ck_assert_uint_eq(1, elm_code_file_lines_get(code->file));
21 elm_code_free(code);
22 elm_shutdown();
23}
24END_TEST
25
26START_TEST (elm_code_file_memory_tokens)
27{
28 Elm_Code_File *file;
29 Elm_Code_Line *line;
30 Elm_Code *code;
31
32 elm_init(1, NULL);
33 code = elm_code_create();
34 file = code->file;
35 elm_code_file_line_append(file, "a line", 6, NULL);
36
37 line = elm_code_file_line_get(file, 1);
38 elm_code_line_token_add(line, 2, 5, 1, ELM_CODE_TOKEN_TYPE_COMMENT);
39 ck_assert_uint_eq(1, eina_list_count(line->tokens));
40 elm_code_free(code);
41 elm_shutdown();
42}
43END_TEST
44
45void elm_code_file_test_memory(TCase *tc)
46{
47 tcase_add_test(tc, elm_code_file_memory_lines);
48 tcase_add_test(tc, elm_code_file_memory_tokens);
49}