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

Add utest or CRC32 IEEE, refine TABs of code

This commit is contained in:
winlin 2018-07-21 19:09:32 +08:00
parent 608c88b8f2
commit dea5e5bb48
2 changed files with 607 additions and 588 deletions

File diff suppressed because it is too large Load diff

View file

@ -1523,5 +1523,24 @@ VOID TEST(KernelUtility, AvcUev)
}
}
VOID TEST(KernelUtility, CRC32IEEE)
{
string datas[] = {
"123456789", "srs", "ossrs.net",
"SRS's a simplest, conceptual integrated, industrial-strength live streaming origin cluster."
};
uint32_t checksums[] = {
0xcbf43926, 0x7df334e9, 0x2f52242b,
0x7e8677bd
};
for (int i = 0; i < (int)(sizeof(datas)/sizeof(string)); i++) {
string data = datas[i];
uint32_t checksum = checksums[i];
EXPECT_EQ(checksum, srs_crc32_ieee(data.data(), data.length(), 0));
}
}
#endif