mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-23 04:00:38 +08:00
Fix vc98 build
This commit is contained in:
parent
01fe61276e
commit
05e55334fc
@ -1375,7 +1375,8 @@ static void test_http_no_content_length(void) {
|
|||||||
struct mg_mgr mgr;
|
struct mg_mgr mgr;
|
||||||
const char *url = "http://127.0.0.1:12348";
|
const char *url = "http://127.0.0.1:12348";
|
||||||
int i;
|
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"
|
"b/a\r\nContent-Length: 15\r\n\r\n"
|
||||||
"{\"key\": \"value\"}";
|
"{\"key\": \"value\"}";
|
||||||
mg_mgr_init(&mgr);
|
mg_mgr_init(&mgr);
|
||||||
@ -2861,7 +2862,7 @@ static void test_json(void) {
|
|||||||
const char *s1 = "{\"a\":{},\"b\":7,\"c\":[[],2]}";
|
const char *s1 = "{\"a\":{},\"b\":7,\"c\":[[],2]}";
|
||||||
const char *s2 = "{\"a\":{\"b1\":{}},\"c\":7,\"d\":{\"b2\":{}}}";
|
const char *s2 = "{\"a\":{\"b1\":{}},\"c\":7,\"d\":{\"b2\":{}}}";
|
||||||
int n;
|
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) == MG_JSON_INVALID);
|
||||||
ASSERT(mg_json_get(mg_str_n(" true ", 6), "$", &n) == 1 && n == 4);
|
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);
|
ASSERT(mg_json_next(sub, 15, &k, &v) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
struct mg_str expected = mg_str("\"b:c\""), val;
|
||||||
json = mg_str("{\"a\":\"b:c\"}");
|
json = mg_str("{\"a\":\"b:c\"}");
|
||||||
val = mg_json_get_tok(json, "$.a");
|
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) {
|
static void resp_rpc(struct mg_rpc_req *r) {
|
||||||
|
Loading…
Reference in New Issue
Block a user