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.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/zephyr_tests.txt') 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: -- cgit v1.2.3