Skip to content

Commit

Permalink
Added utest for include
Browse files Browse the repository at this point in the history
  • Loading branch information
pengfei.ma committed Feb 14, 2022
1 parent 80b5d1d commit 9f5850e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions trunk/src/utest/srs_utest_config.cpp
Expand Up @@ -85,6 +85,10 @@ srs_error_t MockSrsConfig::build_buffer(std::string src, srs_internal::SrsConfig
srs_error_t err = srs_success;

string content = included_files[src];
if(content.empty()) {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "file %s: no found", src.c_str());
}

*pbuffer = new MockSrsConfigBuffer(content);

return err;
Expand Down Expand Up @@ -3878,4 +3882,10 @@ VOID TEST(ConfigMainTest, CheckIncludeConfig)
EXPECT_STREQ("xxx", conf.get_dash_path("ossrs.net").c_str());
EXPECT_STREQ("xxx2", conf.get_dash_mpd_file("ossrs.net").c_str());
}

if (true) {
MockSrsConfig conf;

HELPER_ASSERT_FAILED(conf.parse("include ./conf/include_test/include.conf;"));
}
}

0 comments on commit 9f5850e

Please sign in to comment.