From 7dffd27e0267e0585c35c5f1b59497a1431501a3 Mon Sep 17 00:00:00 2001 From: "Mark W. Eichin" Date: Fri, 17 Apr 2009 05:33:49 +0000 Subject: basic Zcode test --- lib/zephyr_tests.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/zephyr_tests.py') 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): -- cgit v1.2.3