Skip to content

Commit

Permalink
For #2188: Remove utest for reload log configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Mar 12, 2021
1 parent 1fc1de1 commit 34da013
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 64 deletions.
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ std::string SrsAsyncLogManager::desc()
}

static char buf[128];
snprintf(buf, sizeof(buf), ", files=%d, queue=%d, max=%d", (int)writers_.size(), nn_logs, max_logs);
snprintf(buf, sizeof(buf), ", files=%d, queue=%d/%d", (int)writers_.size(), nn_logs, max_logs);
return buf;
}

Expand Down
63 changes: 0 additions & 63 deletions trunk/src/utest/srs_utest_reload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,69 +372,6 @@ VOID TEST(ConfigReloadTest, ReloadPid)
handler.reset();
}

VOID TEST(ConfigReloadTest, ReloadLogTank)
{
MockReloadHandler handler;
MockSrsReloadConfig conf;

conf.subscribe(&handler);
EXPECT_TRUE(ERROR_SUCCESS == conf.parse(_MIN_OK_CONF"srs_log_tank console;"));
EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_tank console;"));
EXPECT_TRUE(handler.all_false());
handler.reset();

EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_tank file;"));
EXPECT_TRUE(handler.log_tank_reloaded);
EXPECT_EQ(1, handler.count_true());
handler.reset();

EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_tank console;"));
EXPECT_EQ(1, handler.count_true());
handler.reset();
}

VOID TEST(ConfigReloadTest, ReloadLogLevel)
{
MockReloadHandler handler;
MockSrsReloadConfig conf;

conf.subscribe(&handler);
EXPECT_TRUE(ERROR_SUCCESS == conf.parse(_MIN_OK_CONF"srs_log_level trace;"));
EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_level trace;"));
EXPECT_TRUE(handler.all_false());
handler.reset();

EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_level warn;"));
EXPECT_TRUE(handler.log_level_reloaded);
EXPECT_EQ(1, handler.count_true());
handler.reset();

EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_level trace;"));
EXPECT_EQ(1, handler.count_true());
handler.reset();
}

VOID TEST(ConfigReloadTest, ReloadLogFile)
{
MockReloadHandler handler;
MockSrsReloadConfig conf;

conf.subscribe(&handler);
EXPECT_TRUE(ERROR_SUCCESS == conf.parse(_MIN_OK_CONF"srs_log_file srs.log;"));
EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_file srs.log;"));
EXPECT_TRUE(handler.all_false());
handler.reset();

EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_file srs1.log;"));
EXPECT_TRUE(handler.log_file_reloaded);
EXPECT_EQ(1, handler.count_true());
handler.reset();

EXPECT_TRUE(ERROR_SUCCESS == conf.do_reload(_MIN_OK_CONF"srs_log_file srs.log;"));
EXPECT_EQ(1, handler.count_true());
handler.reset();
}

VOID TEST(ConfigReloadTest, ReloadPithyPrint)
{
MockReloadHandler handler;
Expand Down

0 comments on commit 34da013

Please sign in to comment.