1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Cover JSON codec. 3.0.62

This commit is contained in:
winlin 2019-10-22 09:01:29 +08:00
parent c7602d8cee
commit e683f07715
2 changed files with 14 additions and 4 deletions

View file

@ -1600,12 +1600,10 @@ string SrsJsonAny::dumps()
return arr->dumps();
}
default: {
break;
}
}
return "null";
}
}
}
SrsAmf0Any* SrsJsonAny::to_amf0()
{

View file

@ -2561,5 +2561,17 @@ VOID TEST(ProtocolJSONTest, Dumps)
EXPECT_STREQ("[]", p->dumps().c_str());
srs_freep(p);
}
if (true) {
SrsJsonAny* p = SrsJsonAny::object();
EXPECT_STREQ("{}", p->dumps().c_str());
srs_freep(p);
}
if (true) {
SrsJsonAny* p = SrsJsonAny::array();
EXPECT_STREQ("[]", p->dumps().c_str());
srs_freep(p);
}
}