mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine kbps more testable
This commit is contained in:
parent
16fa4c588a
commit
4c40370986
9 changed files with 144 additions and 14 deletions
|
@ -212,6 +212,69 @@ srs_error_t MockBufferIO::read(void* buf, size_t size, ssize_t* nread)
|
|||
return srs_success;
|
||||
}
|
||||
|
||||
MockStatistic::MockStatistic()
|
||||
{
|
||||
in = out = 0;
|
||||
}
|
||||
|
||||
MockStatistic::~MockStatistic()
|
||||
{
|
||||
}
|
||||
|
||||
int64_t MockStatistic::get_recv_bytes()
|
||||
{
|
||||
return in;
|
||||
}
|
||||
|
||||
int64_t MockStatistic::get_send_bytes()
|
||||
{
|
||||
return out;
|
||||
}
|
||||
|
||||
MockStatistic* MockStatistic::set_in(int64_t v)
|
||||
{
|
||||
in = v;
|
||||
return this;
|
||||
}
|
||||
|
||||
MockStatistic* MockStatistic::set_out(int64_t v)
|
||||
{
|
||||
out = v;
|
||||
return this;
|
||||
}
|
||||
|
||||
MockStatistic* MockStatistic::add_in(int64_t v)
|
||||
{
|
||||
in += v;
|
||||
return this;
|
||||
}
|
||||
|
||||
MockStatistic* MockStatistic::add_out(int64_t v)
|
||||
{
|
||||
out += v;
|
||||
return this;
|
||||
}
|
||||
|
||||
MockWallClock::MockWallClock()
|
||||
{
|
||||
clock = 0;
|
||||
}
|
||||
|
||||
MockWallClock::~MockWallClock()
|
||||
{
|
||||
}
|
||||
|
||||
int64_t MockWallClock::time_ms()
|
||||
{
|
||||
return clock;
|
||||
}
|
||||
|
||||
MockWallClock* MockWallClock::set_clock(int64_t ms)
|
||||
{
|
||||
clock = ms;
|
||||
return this;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_UTEST_PROTOCOL
|
||||
|
||||
// verify the sha256
|
||||
|
@ -5622,5 +5685,9 @@ VOID TEST(ProtocolHTTPTest, ParseHTTPMessage)
|
|||
}
|
||||
}
|
||||
|
||||
VOID TEST(ProtocolKbpsTest, ParseHTTPMessage)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue