1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Refactor the mock file reader/writer

This commit is contained in:
winlin 2019-12-31 15:15:56 +08:00
parent d32a7e9770
commit adad90d316
4 changed files with 250 additions and 165 deletions

View file

@ -1236,3 +1236,32 @@ VOID TEST(KernelMp4Test, HDLRBox)
}
}
VOID TEST(KernelMp4Test, URLBox)
{
srs_error_t err;
if (true) {
char buf[12+1];
SrsBuffer b(buf, sizeof(buf));
if (true) {
SrsMp4DataEntryUrlBox box;
EXPECT_EQ(sizeof(buf), box.nb_bytes());
HELPER_EXPECT_SUCCESS(box.encode(&b));
stringstream ss;
SrsMp4DumpContext dc;
box.dumps(ss, dc);
string v = ss.str();
EXPECT_STREQ("url , 13B, FB(4B,V0,0x01), URL: Same file\n", v.c_str());
}
if (true) {
b.skip(-1 * b.pos());
SrsMp4DataEntryUrlBox box;
HELPER_EXPECT_SUCCESS(box.decode(&b));
}
}
}