test1156: enable for hyper
Minor reorg of the lib1156 code and it works fine for hyper. Closes #8127
This commit is contained in:
parent
fde1f1bfe9
commit
6f73e68d18
@ -56,7 +56,6 @@
|
|||||||
673
|
673
|
||||||
718
|
718
|
||||||
1021
|
1021
|
||||||
1156
|
|
||||||
1417
|
1417
|
||||||
1525
|
1525
|
||||||
1526
|
1526
|
||||||
|
|||||||
@ -64,9 +64,8 @@ http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
|
|||||||
|
|
||||||
# Verify data after the test has been "shot"
|
# Verify data after the test has been "shot"
|
||||||
<verify>
|
<verify>
|
||||||
<stderr mode="text">
|
<stdout mode="text">
|
||||||
URL: http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
|
|
||||||
0
|
0
|
||||||
</stderr>
|
</stdout>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -93,6 +93,7 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p,
|
|||||||
replyselector += 2;
|
replyselector += 2;
|
||||||
msnprintf(urlbuf, sizeof(urlbuf), "%s%04u", url, replyselector);
|
msnprintf(urlbuf, sizeof(urlbuf), "%s%04u", url, replyselector);
|
||||||
test_setopt(curl, CURLOPT_URL, urlbuf);
|
test_setopt(curl, CURLOPT_URL, urlbuf);
|
||||||
|
test_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
test_setopt(curl, CURLOPT_RESUME_FROM, (p->flags & F_RESUME)? 3: 0);
|
test_setopt(curl, CURLOPT_RESUME_FROM, (p->flags & F_RESUME)? 3: 0);
|
||||||
test_setopt(curl, CURLOPT_RANGE, !(p->flags & F_RESUME)?
|
test_setopt(curl, CURLOPT_RANGE, !(p->flags & F_RESUME)?
|
||||||
"3-1000000": (char *) NULL);
|
"3-1000000": (char *) NULL);
|
||||||
@ -100,22 +101,22 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p,
|
|||||||
hasbody = 0;
|
hasbody = 0;
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
if(res != p->result) {
|
if(res != p->result) {
|
||||||
fprintf(stderr, "%d: bad error code (%d): resume=%s, fail=%s, http416=%s, "
|
printf("%d: bad error code (%d): resume=%s, fail=%s, http416=%s, "
|
||||||
"content-range=%s, expected=%d\n", num, res,
|
"content-range=%s, expected=%d\n", num, res,
|
||||||
(p->flags & F_RESUME)? "yes": "no",
|
(p->flags & F_RESUME)? "yes": "no",
|
||||||
(p->flags & F_FAIL)? "yes": "no",
|
(p->flags & F_FAIL)? "yes": "no",
|
||||||
(p->flags & F_HTTP416)? "yes": "no",
|
(p->flags & F_HTTP416)? "yes": "no",
|
||||||
(p->flags & F_CONTENTRANGE)? "yes": "no",
|
(p->flags & F_CONTENTRANGE)? "yes": "no",
|
||||||
p->result);
|
p->result);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(hasbody && (p->flags & F_IGNOREBODY)) {
|
if(hasbody && (p->flags & F_IGNOREBODY)) {
|
||||||
fprintf(stderr, "body should be ignored and is not: resume=%s, fail=%s, "
|
printf("body should be ignored and is not: resume=%s, fail=%s, "
|
||||||
"http416=%s, content-range=%s\n",
|
"http416=%s, content-range=%s\n",
|
||||||
(p->flags & F_RESUME)? "yes": "no",
|
(p->flags & F_RESUME)? "yes": "no",
|
||||||
(p->flags & F_FAIL)? "yes": "no",
|
(p->flags & F_FAIL)? "yes": "no",
|
||||||
(p->flags & F_HTTP416)? "yes": "no",
|
(p->flags & F_HTTP416)? "yes": "no",
|
||||||
(p->flags & F_CONTENTRANGE)? "yes": "no");
|
(p->flags & F_CONTENTRANGE)? "yes": "no");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -125,6 +126,9 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* for debugging: */
|
||||||
|
/*#define SINGLETEST 9*/
|
||||||
|
|
||||||
int test(char *URL)
|
int test(char *URL)
|
||||||
{
|
{
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
@ -137,21 +141,25 @@ int test(char *URL)
|
|||||||
return TEST_ERR_MAJOR_BAD;
|
return TEST_ERR_MAJOR_BAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
curl = curl_easy_init();
|
for(i = 0; i < sizeof(params) / sizeof(params[0]); i++) {
|
||||||
if(!curl) {
|
curl = curl_easy_init();
|
||||||
fprintf(stderr, "curl_easy_init() failed\n");
|
if(!curl) {
|
||||||
curl_global_cleanup();
|
fprintf(stderr, "curl_easy_init() failed\n");
|
||||||
return TEST_ERR_MAJOR_BAD;
|
curl_global_cleanup();
|
||||||
|
return TEST_ERR_MAJOR_BAD;
|
||||||
|
}
|
||||||
|
|
||||||
|
test_setopt(curl, CURLOPT_WRITEFUNCTION, writedata);
|
||||||
|
|
||||||
|
#ifdef SINGLETEST
|
||||||
|
if(SINGLETEST == i)
|
||||||
|
#endif
|
||||||
|
status |= onetest(curl, URL, params + i, i);
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
}
|
}
|
||||||
|
|
||||||
test_setopt(curl, CURLOPT_WRITEFUNCTION, writedata);
|
|
||||||
|
|
||||||
for(i = 0; i < sizeof(params) / sizeof(params[0]); i++)
|
|
||||||
status |= onetest(curl, URL, params + i, i);
|
|
||||||
|
|
||||||
curl_easy_cleanup(curl);
|
|
||||||
curl_global_cleanup();
|
curl_global_cleanup();
|
||||||
fprintf(stderr, "%d\n", status);
|
printf("%d\n", status);
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
test_cleanup:
|
test_cleanup:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user