mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix utest fail
This commit is contained in:
parent
df9efb6486
commit
1c3e4c71ee
2 changed files with 4 additions and 1 deletions
|
@ -67,7 +67,7 @@ extern srs_utime_t _srs_tmp_timeout;
|
|||
|
||||
// For init array data.
|
||||
#define HELPER_ARRAY_INIT(buf, sz, val) \
|
||||
for (int i = 0; i < (int)sz; i++) (buf)[i]=val
|
||||
memset(buf, val, sz)
|
||||
|
||||
// Dump simple stream to string.
|
||||
#define HELPER_BUFFER2STR(io) \
|
||||
|
|
|
@ -1379,6 +1379,7 @@ VOID TEST(TCPServerTest, ContextUtility)
|
|||
|
||||
int base_size = 0;
|
||||
if (true) {
|
||||
errno = 0;
|
||||
int size = 0; char buf[1024]; HELPER_ARRAY_INIT(buf, 1024, 0);
|
||||
ASSERT_TRUE(srs_log_header(buf, 1024, true, true, "SRS", "100", "Trace", &size));
|
||||
base_size = size;
|
||||
|
@ -1386,6 +1387,7 @@ VOID TEST(TCPServerTest, ContextUtility)
|
|||
}
|
||||
|
||||
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, "SRS", "100", "Trace", &size));
|
||||
EXPECT_EQ(base_size, size);
|
||||
|
@ -1399,6 +1401,7 @@ VOID TEST(TCPServerTest, ContextUtility)
|
|||
}
|
||||
|
||||
if (true) {
|
||||
errno = 0;
|
||||
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));
|
||||
EXPECT_EQ(base_size - 8, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue