From: Dan Fandrich Date: Thu, 5 Oct 2023 20:11:08 +0000 (-0700) Subject: test1903: actually verify the cookies after the test X-Git-Tag: curl-8_4_0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12041%2Fhead;p=thirdparty%2Fcurl.git test1903: actually verify the cookies after the test The test otherwise could do just about anything (except leak memory in debug mode) and its bad behaviour wouldn't be detected. Now, check the resulting cookie file to ensure the cookies are still there. Closes #12041 --- diff --git a/tests/data/test1903 b/tests/data/test1903 index 24ad174663..6c879de961 100644 --- a/tests/data/test1903 +++ b/tests/data/test1903 @@ -33,7 +33,7 @@ CURLOPT_COOKIEFILE then reset then set again lib%TESTNUMBER -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER %LOGDIR/cookies%TESTNUMBER +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER %LOGDIR/cookies%TESTNUMBER %LOGDIR/cookiesout%TESTNUMBER cookies @@ -50,5 +50,13 @@ cookies # Verify data after the test has been "shot" + +# Netscape HTTP Cookie File +# https://curl.se/docs/http-cookies.html +# This file was generated by libcurl! Edit at your own risk. + +%HOSTIP FALSE /we/want/ FALSE 0 foobar name +%HOSTIP FALSE /we/want/ FALSE 0 secondcookie present + diff --git a/tests/libtest/lib1903.c b/tests/libtest/lib1903.c index a8a767e5c0..3c4ae30734 100644 --- a/tests/libtest/lib1903.c +++ b/tests/libtest/lib1903.c @@ -46,6 +46,7 @@ int test(char *URL) easy_setopt(ch, CURLOPT_URL, URL); easy_setopt(ch, CURLOPT_COOKIEFILE, libtest_arg2); + easy_setopt(ch, CURLOPT_COOKIEJAR, libtest_arg3); res = curl_easy_perform(ch); test_cleanup: