mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refactor ISrsContext and ISrsLog
This commit is contained in:
parent
2948b90f43
commit
81d2e10f65
11 changed files with 47 additions and 115 deletions
|
@ -41,7 +41,7 @@ srs_utime_t _srs_tmp_timeout = (100 * SRS_UTIME_MILLISECONDS);
|
|||
|
||||
// kernel module.
|
||||
ISrsLog* _srs_log = new MockEmptyLog(SrsLogLevelDisabled);
|
||||
ISrsThreadContext* _srs_context = new ISrsThreadContext();
|
||||
ISrsContext* _srs_context = new SrsThreadContext();
|
||||
// app module.
|
||||
SrsConfig* _srs_config = NULL;
|
||||
SrsServer* _srs_server = NULL;
|
||||
|
|
|
@ -95,7 +95,7 @@ extern srs_utime_t _srs_tmp_timeout;
|
|||
// print the bytes.
|
||||
void srs_bytes_print(char* pa, int size);
|
||||
|
||||
class MockEmptyLog : public SrsFastLog
|
||||
class MockEmptyLog : public SrsFileLog
|
||||
{
|
||||
public:
|
||||
MockEmptyLog(SrsLogLevel l);
|
||||
|
|
|
@ -4090,28 +4090,6 @@ VOID TEST(KernelFLVTest, CoverSharedPtrMessage)
|
|||
}
|
||||
}
|
||||
|
||||
VOID TEST(KernelLogTest, CoverAll)
|
||||
{
|
||||
srs_error_t err;
|
||||
|
||||
if (true) {
|
||||
ISrsLog l;
|
||||
HELPER_EXPECT_SUCCESS(l.initialize());
|
||||
|
||||
l.reopen();
|
||||
l.verbose("TAG", "0", "log");
|
||||
l.info("TAG", "0", "log");
|
||||
l.trace("TAG", "0", "log");
|
||||
l.warn("TAG", "0", "log");
|
||||
l.error("TAG", "0", "log");
|
||||
|
||||
ISrsThreadContext ctx;
|
||||
ctx.set_id("10");
|
||||
EXPECT_EQ("", ctx.get_id());
|
||||
EXPECT_EQ("", ctx.generate_id());
|
||||
}
|
||||
}
|
||||
|
||||
VOID TEST(KernelMp3Test, CoverAll)
|
||||
{
|
||||
srs_error_t err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue