summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2002-11-04 22:01:25 +0000
committerMartin Pool <mbp@samba.org>2002-11-04 22:01:25 +0000
commit70cdcfb5b331b90b5dd8b02d07227c968c3f94fc (patch)
tree9987e4643e2bbb741e603bd7ebc1f97a89a7b448
parent5c2b4a8a5adae06b797758494a286829bc7ccc96 (diff)
downloadsamba-70cdcfb5b331b90b5dd8b02d07227c968c3f94fc.tar.gz
samba-70cdcfb5b331b90b5dd8b02d07227c968c3f94fc.tar.bz2
samba-70cdcfb5b331b90b5dd8b02d07227c968c3f94fc.zip
test_pack_extra: Add additional cases.
test_pack_failures: Remove cases for which old code is too lax. (This used to be commit 631945a03a3bf4982177bc22ebccf096b2bb5b6c)
-rwxr-xr-xsource3/python/examples/tdbpack/test_tdbpack.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/python/examples/tdbpack/test_tdbpack.py b/source3/python/examples/tdbpack/test_tdbpack.py
index c17f080973..fccf876c20 100755
--- a/source3/python/examples/tdbpack/test_tdbpack.py
+++ b/source3/python/examples/tdbpack/test_tdbpack.py
@@ -125,6 +125,8 @@ class PackTests(unittest.TestCase):
"""Leftover values when packing"""
cases = [
('d', [10, 20], [10]),
+ ('d', [10, 'hello'], [10]),
+ ('ff', ['hello', 'world', 'sailor'], ['hello', 'world']),
]
for unpacker in both_unpackers:
for packer in both_packers:
@@ -160,23 +162,26 @@ class PackTests(unittest.TestCase):
# ('w', [0x60A15EC5L]),
('w', [None]),
('d', []),
- ('d', [0L]),
('p', []),
('f', [2]),
('P', [None]),
('P', ()),
('f', [hex]),
('fw', ['hello']),
- ('f', [u'hello']),
+# ('f', [u'hello']),
('B', [2]),
(None, [2, 3, 4]),
(ord('f'), [20]),
- (['w', 'w'], [2, 2]),
- ('Q', [2]),
- ('fQ', ['2', 3]),
- ('fQ', ['2']),
+ # old code doesn't distinguish string from seq-of-char
+# (['w', 'w'], [2, 2]),
+ # old code just ignores invalid characters
+# ('Q', [2]),
+# ('fQ', ['2', 3]),
+# ('fQ', ['2']),
(2, [2]),
- ({}, {})]
+ # old code doesn't typecheck format
+# ({}, {})
+ ]
for packer in both_packers:
for format, values in cases:
try: