diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/eina/src/tests/eina_test_simple_xml_parser.c | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/eina/src/tests/eina_test_simple_xml_parser.c')
-rw-r--r-- | libraries/eina/src/tests/eina_test_simple_xml_parser.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/libraries/eina/src/tests/eina_test_simple_xml_parser.c b/libraries/eina/src/tests/eina_test_simple_xml_parser.c new file mode 100644 index 0000000..94e6a2a --- /dev/null +++ b/libraries/eina/src/tests/eina_test_simple_xml_parser.c | |||
@@ -0,0 +1,73 @@ | |||
1 | /* EINA - EFL data type library | ||
2 | * Copyright (C) 2008 Cedric Bail | ||
3 | * | ||
4 | * This library is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2.1 of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This library is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library; | ||
16 | * if not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifdef HAVE_CONFIG_H | ||
20 | # include "config.h" | ||
21 | #endif | ||
22 | |||
23 | #include <stdlib.h> | ||
24 | #include <stdio.h> | ||
25 | #include <string.h> | ||
26 | |||
27 | #include "eina_suite.h" | ||
28 | #include "Eina.h" | ||
29 | |||
30 | START_TEST(eina_simple_xml_parser_node_dump) | ||
31 | { | ||
32 | FILE *f; | ||
33 | |||
34 | eina_init(); | ||
35 | f = fopen("sample.gpx", "rb"); | ||
36 | if (f) | ||
37 | { | ||
38 | long sz; | ||
39 | |||
40 | fseek(f, 0, SEEK_END); | ||
41 | sz = ftell(f); | ||
42 | if (sz > 0) | ||
43 | { | ||
44 | char *buf; | ||
45 | |||
46 | fseek(f, 0, SEEK_SET); | ||
47 | buf = malloc(sz); | ||
48 | if (buf) | ||
49 | { | ||
50 | if (fread(buf, 1, sz, f)) | ||
51 | { | ||
52 | Eina_Simple_XML_Node_Root *root = eina_simple_xml_node_load | ||
53 | (buf, sz, EINA_TRUE); | ||
54 | char *out = eina_simple_xml_node_dump(&root->base, " "); | ||
55 | puts(out); | ||
56 | free(out); | ||
57 | eina_simple_xml_node_root_free(root); | ||
58 | free(buf); | ||
59 | } | ||
60 | } | ||
61 | } | ||
62 | fclose(f); | ||
63 | } | ||
64 | |||
65 | eina_shutdown(); | ||
66 | } | ||
67 | END_TEST | ||
68 | |||
69 | void | ||
70 | eina_test_simple_xml_parser(TCase *tc) | ||
71 | { | ||
72 | tcase_add_test(tc, eina_simple_xml_parser_node_dump); | ||
73 | } | ||