diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-10-07 18:29:42 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-10-07 18:29:42 +0200 |
commit | fc2b31b5667038efd691550ce6f582ef11cbaa1b (patch) | |
tree | 24d9feae17a4ed2f4e2229a6495a00eb59eb9c91 | |
parent | 72311bf68b750f8cdcaa81e80de6f5ea9c53ae3f (diff) | |
download | curl-bagder/mime-subparts-itself.tar.gz |
test643: verify curl_mime_subparts() adding "itself"bagder/mime-subparts-itself
-rw-r--r-- | tests/libtest/lib643.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/libtest/lib643.c b/tests/libtest/lib643.c index e26a2515f..22431a6e6 100644 --- a/tests/libtest/lib643.c +++ b/tests/libtest/lib643.c @@ -251,6 +251,21 @@ test_cleanup: return res; } +static int add_itself(void) +{ + CURL *easy = curl_easy_init(); + curl_mime *mime = curl_mime_init(easy); + curl_mimepart *part = curl_mime_addpart(mime); + CURLcode a1 = curl_mime_subparts(part, mime); + curl_mime_free(mime); + curl_easy_cleanup(easy); + if(a1 != CURLE_BAD_FUNCTION_ARGUMENT) + /* that should have failed */ + return 1; + + return 0; +} + int test(char *URL) { int res; @@ -264,6 +279,9 @@ int test(char *URL) if(!res) res = once(URL, FALSE); /* new */ + if(!res) + res = add_itself(); + curl_global_cleanup(); return res; |