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

Log: Change cid from int to string

This commit is contained in:
winlin 2020-06-18 11:45:43 +08:00
parent bca4ec1da1
commit 8a0c2e01f8
42 changed files with 301 additions and 307 deletions

View file

@ -558,7 +558,7 @@ VOID TEST(TCPServerTest, MessageConnection)
if (true) {
SrsHttpMessage m;
HELPER_EXPECT_SUCCESS(m.set_url("http://127.0.0.1/v1/streams/100", false));
EXPECT_EQ(100, m.parse_rest_id("/v1/streams/")); EXPECT_FALSE(m.is_jsonp());
EXPECT_EQ("100", m.parse_rest_id("/v1/streams/")); EXPECT_FALSE(m.is_jsonp());
}
}
@ -1268,12 +1268,12 @@ VOID TEST(TCPServerTest, ContextUtility)
if (true) {
SrsThreadContext ctx;
EXPECT_EQ(0, ctx.set_id(100));
EXPECT_EQ(100, ctx.set_id(1000));
EXPECT_EQ(1000, ctx.get_id());
EXPECT_EQ("0", ctx.set_id("100"));
EXPECT_EQ("100", ctx.set_id("1000"));
EXPECT_EQ("1000", ctx.get_id());
ctx.clear_cid();
EXPECT_EQ(0, ctx.set_id(100));
EXPECT_EQ("0", ctx.set_id("100"));
}
int base_size = 0;
@ -1286,20 +1286,20 @@ VOID TEST(TCPServerTest, ContextUtility)
if (true) {
int size = 0; char buf[1024]; HELPER_ARRAY_INIT(buf, 1024, 0);
ASSERT_TRUE(srs_log_header(buf, 1024, false, true, "SRS", 100, "Trace", &size));
ASSERT_TRUE(srs_log_header(buf, 1024, false, true, "SRS", "100", "Trace", &size));
EXPECT_EQ(base_size, size);
}
if (true) {
errno = 0;
int size = 0; char buf[1024]; HELPER_ARRAY_INIT(buf, 1024, 0);
ASSERT_TRUE(srs_log_header(buf, 1024, false, true, NULL, 100, "Trace", &size));
ASSERT_TRUE(srs_log_header(buf, 1024, false, true, NULL, "100", "Trace", &size));
EXPECT_EQ(base_size - 5, size);
}
if (true) {
int size = 0; char buf[1024]; HELPER_ARRAY_INIT(buf, 1024, 0);
ASSERT_TRUE(srs_log_header(buf, 1024, false, false, NULL, 100, "Trace", &size));
ASSERT_TRUE(srs_log_header(buf, 1024, false, false, NULL, "100", "Trace", &size));
EXPECT_EQ(base_size - 8, size);
}