diff --git a/trunk/src/utest/srs_utest_config.cpp b/trunk/src/utest/srs_utest_config.cpp index 03e37a31d8..3a3c04a5b2 100644 --- a/trunk/src/utest/srs_utest_config.cpp +++ b/trunk/src/utest/srs_utest_config.cpp @@ -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; @@ -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;")); + } }