forked from fanchy/ffpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfftest.py
More file actions
78 lines (66 loc) · 2.15 KB
/
fftest.py
File metadata and controls
78 lines (66 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
def test_base(a1, a2, a3):
print('test_base', a1, a2, a3)
return 0
def test_stl(a1, a2, a3):
print('test_stl', a1, a2, a3)
return True
def test_return_stl():
print('test_return_stl')
#map<string, list<vector<int> > >
ret = {'Oh':[[111,222], [333, 444] ] }
return ret
def test_reg_function():
import ext1
ext1.print_val(123, 45.6 , "----789---", [3.14])
ret = ext1.return_stl()
print('test_reg_function', ret)
def test_register_base_class():
import ext2
foo = ext2.foo_t(20130426)
print("test_register_base_class get_val:", foo.get_value())
foo.set_value(778899)
print("test_register_base_class get_val:", foo.get_value(), foo.m_value)
foo.test_stl({"key": [11,22,33] })
print('test_register_base_class test_register_base_class', foo)
def test_register_inherit_class():
import ext2
dumy = ext2.dumy_t(20130426)
print("test_register_inherit_class get_val:", dumy.get_value())
dumy.set_value(778899)
print("test_register_inherit_class get_val:", dumy.get_value(), dumy.m_value)
dumy.test_stl({"key": [11,22,33] })
dumy.dump()
print('test_register_inherit_class', dumy)
def test_cpp_obj_to_py_ext(foo):
print('test_cpp_obj_to_py_ext', len(foo))
for k in range(0, len(foo)):
print('test_cpp_obj_to_py_ext', k, foo[k].m_value)
def test_cpp_obj_to_py(foo):
import ext2
print("test_cpp_obj_to_py get_val:", foo.get_value())
foo.set_value(778899)
print("test_cpp_obj_to_py get_val:", foo.get_value(), foo.m_value)
foo.test_stl({"key": [11,22,33] })
foo.m_value = 100
print('test_cpp_obj_to_py test_register_base_class', foo)
def test_cpp_obj_py_obj(dumy):
import ext2
print("test_cpp_obj_py_obj get_val:", dumy.get_value())
dumy.set_value(778899)
print("test_cpp_obj_py_obj get_val:", dumy.get_value(), dumy.m_value)
dumy.test_stl({"key": [11,22,33] })
dumy.dump()
ext2.obj_test(dumy)
print('test_cpp_obj_py_obj', dumy)
return dumy
class pyclass_t:
def __init__(self):
print('pyclass_t init....')
def sayHi(self, a1, a2):
print('sayHi..', a1, a2)
def test_cpp_obj_return_py_obj():
return pyclass_t()
def test_cpp_obj_return_py_lambda():
def test_lambda(a1):
print('test_lambda....', a1)
return test_lambda