From 77cc14860829f42cb7718aa60ad3ccf5a1ba1873 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 14 May 2019 08:42:46 +0800 Subject: [PATCH] Refine utest --- trunk/src/utest/srs_utest.cpp | 7 +++++++ trunk/src/utest/srs_utest.hpp | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/trunk/src/utest/srs_utest.cpp b/trunk/src/utest/srs_utest.cpp index 9b0a0200e..03ec996bc 100644 --- a/trunk/src/utest/srs_utest.cpp +++ b/trunk/src/utest/srs_utest.cpp @@ -29,6 +29,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include +// Temporary disk config. +std::string _srs_tmp_file_prefix = "/tmp/srs-utest-"; +// Temporary network config. +std::string _srs_tmp_host = "127.0.0.1"; +int _srs_tmp_port = 11935; +srs_utime_t _srs_tmp_timeout = (100 * SRS_UTIME_MILLISECONDS); + // kernel module. ISrsLog* _srs_log = new MockEmptyLog(SrsLogLevelDisabled); ISrsThreadContext* _srs_context = new ISrsThreadContext(); diff --git a/trunk/src/utest/srs_utest.hpp b/trunk/src/utest/srs_utest.hpp index 58e239046..c18f178ae 100644 --- a/trunk/src/utest/srs_utest.hpp +++ b/trunk/src/utest/srs_utest.hpp @@ -42,11 +42,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define VOID // Temporary disk config. -std::string _srs_tmp_file_prefix = "/tmp/srs-utest-"; +extern std::string _srs_tmp_file_prefix; // Temporary network config. -std::string _srs_tmp_host = "127.0.0.1"; -int _srs_tmp_port = 11935; -srs_utime_t _srs_tmp_timeout = (100 * SRS_UTIME_MILLISECONDS); +extern std::string _srs_tmp_host; +extern int _srs_tmp_port; +extern srs_utime_t _srs_tmp_timeout; // For errors. #define HELPER_EXPECT_SUCCESS(x) EXPECT_TRUE(srs_success == (err = x)); srs_freep(err)