summaryrefslogtreecommitdiff
path: root/tests/memory_mgmt_test.py
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2015-10-22 21:26:16 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2015-10-22 21:26:16 -0400
commitb9a0953d45edd2fba037bb5c6ebaf2e6172c8dae (patch)
tree8ac8a074b6984b4cab949e8195d801b8cc6bb290 /tests/memory_mgmt_test.py
parentdfeda8258ea329f7dc32b89f74a20558f7094249 (diff)
downloadpycurl-b9a0953d45edd2fba037bb5c6ebaf2e6172c8dae.tar.gz
Make the test work on libcurl 7.19.0
Diffstat (limited to 'tests/memory_mgmt_test.py')
-rw-r--r--tests/memory_mgmt_test.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/memory_mgmt_test.py b/tests/memory_mgmt_test.py
index 476ed61..e44da1b 100644
--- a/tests/memory_mgmt_test.py
+++ b/tests/memory_mgmt_test.py
@@ -286,7 +286,14 @@ class MemoryMgmtTest(unittest.TestCase):
before_object_count = len(gc.get_objects())
for i in range(100000):
- c.setopt(pycurl.HTTPPOST, [("post1", (pycurl.FORM_BUFFERPTR, "data1")), ("post2", (pycurl.FORM_BUFFERPTR, "data2"))])
+ c.setopt(pycurl.HTTPPOST, [
+ # Newer versions of libcurl accept FORM_BUFFERPTR
+ # without FORM_BUFFER and reproduce the memory leak;
+ # libcurl 7.19.0 requires FORM_BUFFER to be given before
+ # FORM_BUFFERPTR.
+ ("post1", (pycurl.FORM_BUFFER, 'foo.txt', pycurl.FORM_BUFFERPTR, "data1")),
+ ("post2", (pycurl.FORM_BUFFER, 'bar.txt', pycurl.FORM_BUFFERPTR, "data2")),
+ ])
gc.collect()
after_object_count = len(gc.get_objects())