Skip to content

Commit

Permalink
UTest: Fix utest warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Oct 6, 2022
1 parent cfbbe30 commit 9c81a0e
Show file tree
Hide file tree
Showing 8 changed files with 593 additions and 550 deletions.
17 changes: 4 additions & 13 deletions trunk/src/app/srs_app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7246,20 +7246,11 @@ string SrsConfig::get_https_api_listen()
{
SRS_OVERWRITE_BY_ENV_STRING("srs.http_api.https.listen");

#ifdef SRS_UTEST
// We should not use static default, because we need to reset for different testcase.
string DEFAULT = "";
#else
static string DEFAULT = "";
#endif

// We should not use static default, because we need to reset for different use scenarios.
string DEFAULT = "1990";
// Follow the HTTPS server if config HTTP API as the same of HTTP server.
if (DEFAULT.empty()) {
if (get_http_api_listen() == get_http_stream_listen()) {
DEFAULT = get_https_stream_listen();
} else {
DEFAULT = "1990";
}
if (get_http_api_listen() == get_http_stream_listen()) {
DEFAULT = get_https_stream_listen();
}

SrsConfDirective* conf = get_https_api();
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_st.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class SrsFastCoroutine
public:
SrsFastCoroutine(std::string n, ISrsCoroutineHandler* h);
SrsFastCoroutine(std::string n, ISrsCoroutineHandler* h, SrsContextId cid);
~SrsFastCoroutine();
virtual ~SrsFastCoroutine();
public:
void set_stack_size(int v);
public:
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_tencentcloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,7 @@ std::string SrsApmSpan::text_propagator()
// For text based propagation, for example, HTTP header "Traceparent: 00-bb8dedf16c53ab4b6ceb1f4ca6d985bb-29247096662468ab-01"
// About the "%.2x", please see https://www.quora.com/What-does-2x-do-in-C-code for detail.
int nn = snprintf(buf, sizeof(buf), "%.2x-%s-%s-%.2x", supportedVersion, ctx_->trace_id_.c_str(), ctx_->span_id_.c_str(), FlagsSampled);
if (nn > 0 && nn < sizeof(buf)) {
if (nn > 0 && nn < (int)sizeof(buf)) {
return string(buf, nn);
}

Expand Down
5 changes: 5 additions & 0 deletions trunk/src/kernel/srs_kernel_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ std::string SrsCplxError::summary() {
if (_summary.empty()) {
stringstream ss;

ss << "code=" << code;

string code_str = srs_error_code_str(this);
if (!code_str.empty()) ss << "(" << code_str << ")";

SrsCplxError* next = this;
while (next) {
ss << " : " << next->msg;
Expand Down
Loading

0 comments on commit 9c81a0e

Please sign in to comment.