summaryrefslogtreecommitdiff
path: root/tests/libtest/lib1511.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2013-07-11 17:01:02 +0200
committerYang Tse <yangsita@gmail.com>2013-07-11 17:01:02 +0200
commitc983aa9efc8f8c84e38a82aa34a5a103936a0a5f (patch)
tree6e9af66bce5b902b3379b6dc61232cf2e84802ff /tests/libtest/lib1511.c
parentb16b7f9d3a139cc7665208e4d19e4f90287f1e8a (diff)
downloadgnurl-c983aa9efc8f8c84e38a82aa34a5a103936a0a5f.tar.gz
gnurl-c983aa9efc8f8c84e38a82aa34a5a103936a0a5f.tar.bz2
gnurl-c983aa9efc8f8c84e38a82aa34a5a103936a0a5f.zip
test 1511: fix enumerated type mixed with another type
Diffstat (limited to 'tests/libtest/lib1511.c')
-rw-r--r--tests/libtest/lib1511.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/tests/libtest/lib1511.c b/tests/libtest/lib1511.c
index c75a8c271..a46f9ab5b 100644
--- a/tests/libtest/lib1511.c
+++ b/tests/libtest/lib1511.c
@@ -21,53 +21,55 @@
***************************************************************************/
#include "test.h"
-#include "testtrace.h"
#include "memdebug.h"
int test(char *URL)
{
- int i = -1;
long unmet;
- CURLcode res = 0;
CURL* curl = NULL;
+ int res = 0;
global_init(CURL_GLOBAL_ALL);
+
easy_init(curl);
easy_setopt(curl, CURLOPT_URL, URL);
easy_setopt(curl, CURLOPT_HEADER, 1L);
- easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
+ easy_setopt(curl, CURLOPT_TIMECONDITION, (long)CURL_TIMECOND_IFMODSINCE);
/* TIMEVALUE in the future */
- easy_setopt(curl, CURLOPT_TIMEVALUE, 1566210680);
+ easy_setopt(curl, CURLOPT_TIMEVALUE, 1566210680L);
res = curl_easy_perform(curl);
- if(res != CURLE_OK)
+ if(res)
goto test_cleanup;
curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
- if(unmet != 1)
+ if(unmet != 1L) {
+ res = TEST_ERR_FAILURE; /* not correct */
goto test_cleanup;
+ }
/* TIMEVALUE in the past */
- easy_setopt(curl, CURLOPT_TIMEVALUE, 1);
+ easy_setopt(curl, CURLOPT_TIMEVALUE, 1L);
res = curl_easy_perform(curl);
- if (res != CURLE_OK)
+ if(res)
goto test_cleanup;
curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
- if(unmet != 0)
+ if(unmet != 0L) {
+ res = TEST_ERR_FAILURE; /* not correct */
goto test_cleanup;
+ }
- i = 0;
+ res = TEST_ERR_SUCCESS; /* this is where we should be */
test_cleanup:
- if(res)
- i = res;
+ /* always cleanup */
curl_easy_cleanup(curl);
curl_global_cleanup();
- return i; /* return the final return code */
+ return res;
}