diff options
author | Mark W. Eichin <eichin@thok.org> | 2009-04-17 05:33:49 +0000 |
---|---|---|
committer | Mark W. Eichin <eichin@thok.org> | 2009-04-17 05:33:49 +0000 |
commit | 7dffd27e0267e0585c35c5f1b59497a1431501a3 (patch) | |
tree | de7a9c533dfc7177ba76a95b6f69771dacd99da8 /lib/zephyr_tests.py | |
parent | 15de7f028f59ff0a7cdf3b5457c85b7d74c9b7bf (diff) |
basic Zcode test
Diffstat (limited to 'lib/zephyr_tests.py')
-rwxr-xr-x | lib/zephyr_tests.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/zephyr_tests.py b/lib/zephyr_tests.py index 12864e0..791dccc 100755 --- a/lib/zephyr_tests.py +++ b/lib/zephyr_tests.py @@ -326,6 +326,7 @@ class libZephyr(object): "ZOpenPort", "ZClosePort", "ZMakeAscii", + "ZMakeZcode", ] def __init__(self, library_path=None): """connect to the library and build the wrappers""" @@ -418,6 +419,18 @@ class libZephyr(object): c_int, # num ] + # Code_t + # ZMakeZcode(register char *ptr, + # int len, + # unsigned char *field, + # int num) + self.ZMakeZcode.argtypes = [ + c_char_p, # ptr + c_int, # len + c_char_p, # field; c_uchar_p? + c_int, # num + ] + # library-specific setup... self.ZInitialize() @@ -430,7 +443,9 @@ def py_make_ascii(input): output.append("0x" + "".join(hexes[i:i+4])) return " ".join(output) - +def py_make_zcode(input): + """reference ZMakeZcode expressed as python...""" + return "Z" + input.replace("\xff", "\xff\xf1").replace("\0", "\xff\xf0") class ZephyrTestSuite(TestSuite): |