summaryrefslogtreecommitdiff
path: root/eo_parser/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'eo_parser/tests.py')
-rw-r--r--eo_parser/tests.py77
1 files changed, 0 insertions, 77 deletions
diff --git a/eo_parser/tests.py b/eo_parser/tests.py
deleted file mode 100644
index 2427658..0000000
--- a/eo_parser/tests.py
+++ /dev/null
@@ -1,77 +0,0 @@
1import unittest
2from XMLparser import XMLparser
3from eo_parser.Cparser import Cparser
4
5class testP(unittest.TestCase):
6
7 def setUp(self):
8 self.c_parser = Cparser(False)
9
10 def test_strip(self):
11 s = """
12 #define MY_TEST_CLASS_NAME "test_class_name"
13
14static const Eo_Op_Description _elm_pan_op_desc[] = {
15 EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_POS_SET, "description here"),
16 EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_POS_GET, "description here"),
17 EO_OP_DESCRIPTION_SENTINEL
18};
19
20static const Eo_Event_Description *event_desc[] = {
21 EO_EV_CALLBACK_ADD,
22 EO_EV_CALLBACK_DEL,
23 EO_EV_DEL,
24 NULL
25};
26
27static const Eo_Class_Description test_class_desc = {
28 EO_VERSION,
29 MY_TEST_CLASS_NAME,
30 EO_CLASS_TYPE_REGULAR,
31 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PAN_BASE_ID, _elm_pan_op_desc, ELM_OBJ_PAN_SUB_ID_LAST),
32 event_desc,
33 sizeof(Elm_Pan_Smart_Data),
34 _elm_pan_class_constructor,
35 NULL
36};
37
38 EO_DEFINE_CLASS(class_get, &test_class_desc, parent, brother, NULL)
39
40 """
41 class_def_answer = {"class_get" : ["parent",
42 ["brother"],
43 "test_class_name",
44 "EO_CLASS_TYPE_REGULAR",
45 ["ELM_OBJ_PAN_BASE_ID",
46 [("ELM_OBJ_PAN_SUB_ID_POS_SET", "pos_set"), ("ELM_OBJ_PAN_SUB_ID_POS_GET", "pos_get")],
47 "ELM_OBJ_PAN_SUB_ID_LAST"],
48 ["EO_EV_CALLBACK_ADD", "EO_EV_CALLBACK_DEL", "EO_EV_DEL"]
49 ]}
50 answer = class_def_answer
51
52 ret = self.c_parser.fetch_data(s)
53 self.assertEqual(ret, answer)
54# self.assertEqual(self.prs.strip_replace("{test str}", "{} "), "teststr" )
55 """
56 def test_strip2(self):
57 s = "(teststr)"
58 self.assertEqual(self.prs.strip_replace(" [te stst r] ", "[] "), "teststr")
59
60 def test_parse(self):
61 s = "EO_DEFINE_CLASS(elm_button_class_get, &desc)"
62 self.assertEqual(self.prs.parse_class_desc(s), ["elm_button_class_get", "desc"])
63 self.assertEqual(self.prs.defs, ["elm_button_class_get", "desc"])
64 self.assertEqual(self.prs.dic, {"a" : "b" , 1 :34} )
65"""
66
67def suite():
68
69 suite = unittest.TestSuite()
70 suite.addTest(unittest.makeSuite(testP))
71 return suite
72
73
74
75if __name__ == '__main__':
76
77 unittest.main()