summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_struct.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-06-13 01:26:35 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-06-13 01:26:35 (GMT)
commitda9c5b35a3ee5fc5bc1d1c64e04bfa8c5bf35886 (patch)
tree76dfa6b16e03b19ccec61c8f5a4864311f211965 /Lib/test/test_struct.py
parentd1a7da6c0d377d2296b79c4203d267ffe1664bfb (diff)
downloadcpython-da9c5b35a3ee5fc5bc1d1c64e04bfa8c5bf35886.zip
cpython-da9c5b35a3ee5fc5bc1d1c64e04bfa8c5bf35886.tar.gz
cpython-da9c5b35a3ee5fc5bc1d1c64e04bfa8c5bf35886.tar.bz2
The new {b,l}p_{u,}longlong() didn't check get_pylong()'s return for NULL.
Repaired that, and added appropriate tests for it to test_struct.py.
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r--Lib/test/test_struct.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index e6c8bb2..31f4dd7 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -314,4 +314,10 @@ def test_std_qQ():
pass
test_one_qQ(x)
+ # Some error cases.
+ for direction in "<>":
+ for letter in "qQ":
+ for badobject in "a string", 3+42j, randrange:
+ any_err(struct.pack, direction + letter, badobject)
+
test_std_qQ()