Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
82080dd7
Commit
82080dd7
authored
Dec 17, 2014
by
Maxime Perrotin
Browse files
Add reference test code
parent
6276fc84
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/regression/test-debug/makelib.sh
0 → 100755
View file @
82080dd7
gnatmake
-c
orchestrator.adb
gnatbind
-n
-Lliborchestrator
orchestrator
gnatmake
-c
b~orchestrator.adb
gcc
-shared
-fPIC
-o
liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o
-lgnat
tests/regression/test-debug/test.py
0 → 100755
View file @
82080dd7
#!/usr/bin/env python
''' test script showing how to view the model's internal state '''
from
ctypes
import
*
# load the shared object
test
=
CDLL
(
'./liborchestrator.so'
)
test
.
liborchestratorinit
()
get_value
=
test
.
fixed_value
get_value
.
restype
=
c_char_p
get_size
=
test
.
fixed_size
get_size
.
restype
=
c_long
size
=
get_size
()
val
=
get_value
()
print
'size ='
,
size
# We know the size, cast it to an array of bytes that can then be converted to swig
as_bytes
=
cast
(
val
,
POINTER
((
c_byte
*
size
)))
print
'value ='
,
val
,
as_bytes
.
contents
[
0
],
as_bytes
.
contents
[
1
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment