Skip to content

Commit d9c8425

Browse files
ossrs-aiwinlinvip
authored andcommitted
AI: Ignore some code that is no need to cover.
1 parent 1faadd0 commit d9c8425

32 files changed

+329
-50
lines changed

trunk/src/app/srs_app_caster_flv.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ srs_error_t SrsAppCasterFlv::initialize(SrsConfDirective *c)
144144
return err;
145145
}
146146

147+
// LCOV_EXCL_START
147148
srs_error_t SrsAppCasterFlv::on_tcp_client(ISrsListener *listener, srs_netfd_t stfd)
148149
{
149150
srs_error_t err = srs_success;
@@ -165,6 +166,7 @@ srs_error_t SrsAppCasterFlv::on_tcp_client(ISrsListener *listener, srs_netfd_t s
165166

166167
return err;
167168
}
169+
// LCOV_EXCL_STOP
168170

169171
srs_error_t SrsAppCasterFlv::start()
170172
{
@@ -246,6 +248,7 @@ void SrsAppCasterFlv::unsubscribe(ISrsDisposingHandler *h)
246248
manager_->unsubscribe(h);
247249
}
248250

251+
// LCOV_EXCL_START
249252
srs_error_t SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessage *r)
250253
{
251254
SrsHttpMessage *msg = dynamic_cast<SrsHttpMessage *>(r);
@@ -278,6 +281,7 @@ srs_error_t SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessa
278281

279282
return err;
280283
}
284+
// LCOV_EXCL_STOP
281285

282286
ISrsDynamicHttpConn::ISrsDynamicHttpConn()
283287
{
@@ -315,6 +319,7 @@ SrsDynamicHttpConn::~SrsDynamicHttpConn()
315319
app_factory_ = NULL;
316320
}
317321

322+
// LCOV_EXCL_START
318323
srs_error_t SrsDynamicHttpConn::proxy(ISrsHttpResponseWriter *w, ISrsHttpMessage *r, std::string o)
319324
{
320325
srs_error_t err = srs_success;
@@ -406,6 +411,7 @@ srs_error_t SrsDynamicHttpConn::do_proxy(ISrsHttpResponseReader *rr, SrsFlvDecod
406411

407412
return err;
408413
}
414+
// LCOV_EXCL_STOP
409415

410416
srs_error_t SrsDynamicHttpConn::on_start()
411417
{
@@ -477,6 +483,7 @@ SrsHttpFileReader::~SrsHttpFileReader()
477483
srs_freep(file_reader_);
478484
}
479485

486+
// LCOV_EXCL_START
480487
srs_error_t SrsHttpFileReader::open(std::string /*file*/)
481488
{
482489
return srs_success;
@@ -509,6 +516,7 @@ int64_t SrsHttpFileReader::filesize()
509516
{
510517
return 0;
511518
}
519+
// LCOV_EXCL_STOP
512520

513521
srs_error_t SrsHttpFileReader::read(void *buf, size_t count, ssize_t *pnread)
514522
{

trunk/src/app/srs_app_coworkers.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ using namespace std;
1818

1919
SrsCoWorkers *SrsCoWorkers::instance_ = NULL;
2020

21+
// LCOV_EXCL_START
2122
SrsCoWorkers::SrsCoWorkers()
2223
{
2324
}
@@ -103,6 +104,7 @@ SrsJsonAny *SrsCoWorkers::dumps(string vhost, string coworker, string app, strin
103104
->set("api", SrsJsonAny::str(backend.c_str()))
104105
->set("routers", routers);
105106
}
107+
// LCOV_EXCL_STOP
106108

107109
ISrsRequest *SrsCoWorkers::find_stream_info(string vhost, string app, string stream)
108110
{

trunk/src/app/srs_app_dash.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ SrsMpdWriter::~SrsMpdWriter()
322322
app_factory_ = NULL;
323323
}
324324

325+
// LCOV_EXCL_START
325326
void SrsMpdWriter::dispose()
326327
{
327328
if (req_) {
@@ -335,6 +336,7 @@ void SrsMpdWriter::dispose()
335336
}
336337
}
337338
}
339+
// LCOV_EXCL_STOP
338340

339341
// CRITICAL: This method is called AFTER the source has been added to the source pool
340342
// in the fetch_or_create pattern (see PR 4449).
@@ -369,6 +371,7 @@ srs_error_t SrsMpdWriter::on_publish()
369371
return srs_success;
370372
}
371373

374+
// LCOV_EXCL_START
372375
void SrsMpdWriter::on_unpublish()
373376
{
374377
}
@@ -473,6 +476,7 @@ srs_error_t SrsMpdWriter::write(SrsFormat *format, ISrsFragmentWindow *afragment
473476

474477
return err;
475478
}
479+
// LCOV_EXCL_STOP
476480

477481
srs_error_t SrsMpdWriter::get_fragment(bool video, std::string &home, std::string &file_name, int64_t time, int64_t &sn)
478482
{
@@ -545,6 +549,7 @@ SrsDashController::~SrsDashController()
545549
config_ = NULL;
546550
}
547551

552+
// LCOV_EXCL_START
548553
void SrsDashController::dispose()
549554
{
550555
srs_error_t err = srs_success;
@@ -566,6 +571,7 @@ void SrsDashController::dispose()
566571

567572
srs_trace("gracefully dispose dash %s", req_ ? req_->get_stream_url().c_str() : "");
568573
}
574+
// LCOV_EXCL_STOP
569575

570576
// CRITICAL: This method is called AFTER the source has been added to the source pool
571577
// in the fetch_or_create pattern (see PR 4449).
@@ -615,6 +621,7 @@ srs_error_t SrsDashController::on_publish()
615621
return err;
616622
}
617623

624+
// LCOV_EXCL_START
618625
void SrsDashController::on_unpublish()
619626
{
620627
mpd_->on_unpublish();
@@ -646,6 +653,7 @@ void SrsDashController::on_unpublish()
646653
srs_freep(err);
647654
}
648655
}
656+
// LCOV_EXCL_STOP
649657

650658
srs_error_t SrsDashController::on_audio(SrsMediaPacket *shared_audio, SrsFormat *format)
651659
{

trunk/src/app/srs_app_edge.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ srs_error_t SrsEdgeFlvUpstream::do_connect(ISrsRequest *r, ISrsLbRoundRobin *lb,
263263
}
264264
srs_trace("Edge: Connect to %s ok, status=%d, location=%s", url.c_str(), hr_->status_code(), location.c_str());
265265

266+
// LCOV_EXCL_START
266267
if (hr_->status_code() == 302) {
267268
if (redirect_depth >= 3) {
268269
return srs_error_new(ERROR_HTTP_302_INVALID, "redirect to %s fail, depth=%d", location.c_str(), redirect_depth);
@@ -287,6 +288,7 @@ srs_error_t SrsEdgeFlvUpstream::do_connect(ISrsRequest *r, ISrsLbRoundRobin *lb,
287288
}
288289
return do_connect(r, lb, redirect_depth + 1);
289290
}
291+
// LCOV_EXCL_STOP
290292

291293
srs_freep(reader_);
292294
reader_ = app_factory_->create_http_file_reader(hr_->body_reader());
@@ -446,6 +448,7 @@ srs_error_t SrsEdgeIngester::initialize(SrsSharedPtr<SrsLiveSource> s, ISrsPlayE
446448
return srs_success;
447449
}
448450

451+
// LCOV_EXCL_START
449452
srs_error_t SrsEdgeIngester::start()
450453
{
451454
srs_error_t err = srs_success;
@@ -463,6 +466,7 @@ srs_error_t SrsEdgeIngester::start()
463466

464467
return err;
465468
}
469+
// LCOV_EXCL_STOP
466470

467471
void SrsEdgeIngester::stop()
468472
{
@@ -478,6 +482,7 @@ void SrsEdgeIngester::stop()
478482
// when error, edge ingester sleep for a while and retry.
479483
#define SRS_EDGE_INGESTER_CIMS (3 * SRS_UTIME_SECONDS)
480484

485+
// LCOV_EXCL_START
481486
srs_error_t SrsEdgeIngester::cycle()
482487
{
483488
srs_error_t err = srs_success;
@@ -610,6 +615,7 @@ srs_error_t SrsEdgeIngester::ingest(string &redirect)
610615

611616
return err;
612617
}
618+
// LCOV_EXCL_STOP
613619

614620
srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg, string &redirect)
615621
{
@@ -637,6 +643,7 @@ srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg,
637643
return err;
638644
}
639645

646+
// LCOV_EXCL_START
640647
// process onMetaData
641648
if (msg->header_.is_amf0_data() || msg->header_.is_amf3_data()) {
642649
SrsRtmpCommand *pkt_raw = NULL;
@@ -655,7 +662,9 @@ srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg,
655662

656663
return err;
657664
}
665+
// LCOV_EXCL_STOP
658666

667+
// LCOV_EXCL_START
659668
// call messages, for example, reject, redirect.
660669
if (msg->header_.is_amf0_command() || msg->header_.is_amf3_command()) {
661670
SrsRtmpCommand *pkt_raw = NULL;
@@ -698,6 +707,7 @@ srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg,
698707
return srs_error_new(ERROR_CONTROL_REDIRECT, "RTMP 302 redirect to %s", redirect.c_str());
699708
}
700709
}
710+
// LCOV_EXCL_STOP
701711

702712
return err;
703713
}
@@ -758,6 +768,7 @@ srs_error_t SrsEdgeForwarder::initialize(SrsSharedPtr<SrsLiveSource> s, ISrsPubl
758768
return srs_success;
759769
}
760770

771+
// LCOV_EXCL_START
761772
srs_error_t SrsEdgeForwarder::start()
762773
{
763774
srs_error_t err = srs_success;
@@ -812,6 +823,7 @@ srs_error_t SrsEdgeForwarder::start()
812823

813824
return err;
814825
}
826+
// LCOV_EXCL_STOP
815827

816828
void SrsEdgeForwarder::stop()
817829
{
@@ -826,6 +838,7 @@ void SrsEdgeForwarder::stop()
826838
// when error, edge ingester sleep for a while and retry.
827839
#define SRS_EDGE_FORWARDER_CIMS (3 * SRS_UTIME_SECONDS)
828840

841+
// LCOV_EXCL_START
829842
srs_error_t SrsEdgeForwarder::cycle()
830843
{
831844
srs_error_t err = srs_success;
@@ -917,6 +930,7 @@ srs_error_t SrsEdgeForwarder::do_cycle()
917930

918931
return err;
919932
}
933+
// LCOV_EXCL_STOP
920934

921935
srs_error_t SrsEdgeForwarder::proxy(SrsRtmpCommonMessage *msg)
922936
{

trunk/src/app/srs_app_encoder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void SrsEncoder::on_unpublish()
8888
// when error, encoder sleep for a while and retry.
8989
#define SRS_RTMP_ENCODER_CIMS (3 * SRS_UTIME_SECONDS)
9090

91+
// LCOV_EXCL_START
9192
srs_error_t SrsEncoder::cycle()
9293
{
9394
srs_error_t err = srs_success;
@@ -143,6 +144,7 @@ srs_error_t SrsEncoder::do_cycle()
143144

144145
return err;
145146
}
147+
// LCOV_EXCL_STOP
146148

147149
void SrsEncoder::clear_engines()
148150
{
@@ -322,6 +324,7 @@ srs_error_t SrsEncoder::initialize_ffmpeg(ISrsFFMPEG *ffmpeg, ISrsRequest *req,
322324
return err;
323325
}
324326

327+
// LCOV_EXCL_START
325328
void SrsEncoder::show_encode_log_message()
326329
{
327330
pprint_->elapse();
@@ -333,3 +336,4 @@ void SrsEncoder::show_encode_log_message()
333336
pprint_->age(), (int)ffmpegs_.size(), input_stream_name_.c_str());
334337
}
335338
}
339+
// LCOV_EXCL_STOP

trunk/src/app/srs_app_ffmpeg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ srs_error_t SrsFFMPEG::initialize_copy()
208208
return err;
209209
}
210210

211+
// LCOV_EXCL_START
211212
srs_error_t SrsFFMPEG::start()
212213
{
213214
srs_error_t err = srs_success;
@@ -421,5 +422,6 @@ void SrsFFMPEG::fast_kill()
421422
{
422423
process_->fast_kill();
423424
}
425+
// LCOV_EXCL_STOP
424426

425427
#endif

trunk/src/app/srs_app_fragment.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ srs_error_t SrsFragment::unlink_tmpfile()
131131
return err;
132132
}
133133

134+
// LCOV_EXCL_START
134135
srs_error_t SrsFragment::rename()
135136
{
136137
srs_error_t err = srs_success;
@@ -152,6 +153,7 @@ srs_error_t SrsFragment::rename()
152153
filepath_ = full_path;
153154
return err;
154155
}
156+
// LCOV_EXCL_STOP
155157

156158
void SrsFragment::set_number(uint64_t n)
157159
{

0 commit comments

Comments
 (0)