Fix vc98 build

This commit is contained in:
Sergey Lyubka 2024-03-06 00:57:31 +00:00
parent 01fe61276e
commit 05e55334fc

View File

@ -1375,7 +1375,8 @@ static void test_http_no_content_length(void) {
struct mg_mgr mgr;
const char *url = "http://127.0.0.1:12348";
int i;
const char *post_req = "POST / HTTP/1.1\r\nContent-Type:"
const char *post_req =
"POST / HTTP/1.1\r\nContent-Type:"
"b/a\r\nContent-Length: 15\r\n\r\n"
"{\"key\": \"value\"}";
mg_mgr_init(&mgr);
@ -2861,7 +2862,7 @@ static void test_json(void) {
const char *s1 = "{\"a\":{},\"b\":7,\"c\":[[],2]}";
const char *s2 = "{\"a\":{\"b1\":{}},\"c\":7,\"d\":{\"b2\":{}}}";
int n;
struct mg_str json, val;
struct mg_str json;
ASSERT(mg_json_get(mg_str_n(" true ", 6), "", &n) == MG_JSON_INVALID);
ASSERT(mg_json_get(mg_str_n(" true ", 6), "$", &n) == 1 && n == 4);
@ -3054,9 +3055,12 @@ static void test_json(void) {
ASSERT(mg_json_next(sub, 15, &k, &v) == 0);
}
{
struct mg_str expected = mg_str("\"b:c\""), val;
json = mg_str("{\"a\":\"b:c\"}");
val = mg_json_get_tok(json, "$.a");
ASSERT(mg_strcmp(val, mg_str("\"b:c\"")) == 0);
ASSERT(mg_strcmp(val, expected) == 0);
}
}
static void resp_rpc(struct mg_rpc_req *r) {