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.txt | |
parent | 15de7f028f59ff0a7cdf3b5457c85b7d74c9b7bf (diff) |
basic Zcode test
Diffstat (limited to 'lib/zephyr_tests.txt')
-rw-r--r-- | lib/zephyr_tests.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/zephyr_tests.txt b/lib/zephyr_tests.txt index 5ae3e31..4762c6c 100644 --- a/lib/zephyr_tests.txt +++ b/lib/zephyr_tests.txt @@ -131,6 +131,19 @@ A few simple string tests: >>> zma("jK__\0") '0x6A4B5F5F 0x00' +Same thing with ZMakeZcode, a compact binary format that is still NUL-terminated... + + >>> sample = "test\0message" + >>> ref = zephyr_tests.py_make_zcode(sample) + >>> from ctypes import create_string_buffer + >>> outlen = len(sample) * 2 + >>> outbuf = create_string_buffer(outlen) + >>> st = _z.ZMakeZcode(outbuf, outlen, sample, len(sample)) + >>> assert st == 0 + >>> assert outbuf.value == ref, "%r != %r" % (outbuf.value, ref) + + + Coverage: Files complete: |