diff options
author | Martin Pool <mbp@samba.org> | 2002-11-06 01:50:31 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2002-11-06 01:50:31 +0000 |
commit | 618db4e739ed06b8b02e5a390cd41f9a90a46807 (patch) | |
tree | c15d2543d22de267f7a76ddf28d774f576de178e /source3/python | |
parent | ea24bb2da8f643e043dc3af3ed3f16388878b57b (diff) | |
download | samba-618db4e739ed06b8b02e5a390cd41f9a90a46807.tar.gz samba-618db4e739ed06b8b02e5a390cd41f9a90a46807.tar.bz2 samba-618db4e739ed06b8b02e5a390cd41f9a90a46807.zip |
Add another test case for repeated-unpack ('$')
(This used to be commit 2a492c4854d4c6469d8c7d21aa187fef6303b641)
Diffstat (limited to 'source3/python')
-rwxr-xr-x | source3/python/examples/tdbpack/test_tdbpack.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/python/examples/tdbpack/test_tdbpack.py b/source3/python/examples/tdbpack/test_tdbpack.py index 2bad93dbc3..83282e745e 100755 --- a/source3/python/examples/tdbpack/test_tdbpack.py +++ b/source3/python/examples/tdbpack/test_tdbpack.py @@ -239,6 +239,15 @@ class PackTests(unittest.TestCase): raise AssertionError("didn't get exception: format %s, values %s, unpacker %s" % (`format`, `values`, `unpacker`)) + def test_unpack_repeated(self): + cases = [(('df$', + '\x00\x00\x00\x00HP C LaserJet 4500-PS\x00Windows 4.0\x00\\print$\\WIN40\\0\\PSCRIPT.DRV\x00\\print$\\WIN40\\0\\PSCRIPT.DRV\x00\\print$\\WIN40\\0\\PSCRIPT.DRV\x00\\print$\\WIN40\\0\\PSCRIPT.HLP\x00\x00RAW\x00\\print$\\WIN40\\0\\readme.wri\x00\\print$\\WIN40\\0\\pscript.drv\x00\\print$\\WIN40\\0\\pscript.hlp\x00'), + ([0L, 'HP C LaserJet 4500-PS', 'Windows 4.0', '\\print$\\WIN40\\0\\PSCRIPT.DRV', '\\print$\\WIN40\\0\\PSCRIPT.DRV', '\\print$\\WIN40\\0\\PSCRIPT.DRV', '\\print$\\WIN40\\0\\PSCRIPT.HLP', '', 'RAW', '\\print$\\WIN40\\0\\readme.wri', '\\print$\\WIN40\\0\\pscript.drv', '\\print$\\WIN40\\0\\pscript.hlp'], ''))] + for unpacker in both_unpackers: + for input, expected in cases: + result = apply(unpacker, input) + if result != expected: + raise AssertionError("%s:\n input: %s\n output: %s\n expected: %s" % (`unpacker`, `input`, `result`, `expected`)) if __name__ == '__main__': |