1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 19:31:53 +00:00

add basic utest for config service

This commit is contained in:
winlin 2014-07-20 17:44:20 +08:00
parent 6e8c4df4b1
commit 21f49a9875

View file

@ -797,3 +797,25 @@ VOID TEST(ConfigMainTest, ParseEmpty)
MockSrsConfig conf;
EXPECT_TRUE(ERROR_SUCCESS != conf.parse(""));
}
VOID TEST(ConfigMainTest, ParseMinConf)
{
MockSrsConfig conf;
EXPECT_TRUE(ERROR_SUCCESS == conf.parse("listen 1935;"));
vector<string> listens = conf.get_listen();
EXPECT_EQ(1, (int)listens.size());
EXPECT_STREQ("1935", listens.at(0).c_str());
}
VOID TEST(ConfigMainTest, ParseInvalidDirective)
{
MockSrsConfig conf;
EXPECT_TRUE(ERROR_SUCCESS != conf.parse("listens 1935;"));
}
VOID TEST(ConfigMainTest, ParseInvalidDirective2)
{
MockSrsConfig conf;
EXPECT_TRUE(ERROR_SUCCESS != conf.parse("chunk_size 4096;"));
}