mirror of
https://github.com/curl/curl.git
synced 2026-04-15 18:31:46 +03:00
test696: decouple from test556 data
Test 696 and 556 share the same libtest code. Make sure to issue
the `GET` request to the correct runtime test number instead of using
the hard-wired "556".
It makes the `sws` test server read the response string from `test696`
`<data>` section, instead of reading it from `test556`. To avoid this
hidden interaction between test data.
AFAICS there is no other similar hard-coded string in reused libtests.
Ref: https://github.com/curl/curl/pull/19313#issuecomment-3477448933
Follow-up to be82a3605a #16003
Closes #19329
This commit is contained in:
parent
c1e3a760ba
commit
aaf9522a2c
2 changed files with 8 additions and 6 deletions
|
|
@ -55,10 +55,10 @@ Connection: close
|
|||
-foo-
|
||||
</stdout>
|
||||
<protocol crlf="yes">
|
||||
GET /556 HTTP/1.1
|
||||
GET /%TESTNUMBER HTTP/1.1
|
||||
Host: ninja
|
||||
|
||||
GET /556 HTTP/1.1
|
||||
GET /%TESTNUMBER HTTP/1.1
|
||||
Host: ninja
|
||||
|
||||
</protocol>
|
||||
|
|
|
|||
|
|
@ -53,13 +53,15 @@ again:
|
|||
|
||||
if(!res) {
|
||||
/* we are connected, now get an HTTP document the raw way */
|
||||
static const char *request =
|
||||
"GET /556 HTTP/1.1\r\n"
|
||||
"Host: ninja\r\n\r\n";
|
||||
char request[64];
|
||||
const char *sbuf = request;
|
||||
size_t sblen = strlen(request);
|
||||
size_t sblen;
|
||||
size_t nwritten = 0, nread = 0;
|
||||
|
||||
sblen = curl_msnprintf(request, sizeof(request),
|
||||
"GET /%d HTTP/1.1\r\n"
|
||||
"Host: ninja\r\n\r\n", testnum);
|
||||
|
||||
do {
|
||||
char buf[1024];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue