Skip to content

Commit

Permalink
tests: improve crc32 testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
arogge committed Aug 22, 2019
1 parent 1467956 commit be5c868
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/src/tests/test_crc32.cc
Expand Up @@ -33,12 +33,11 @@ TEST(crc32, internal)

TEST(crc32, internal_spd)
{
void* buf = malloc(len);
int fd = open("/dev/urandom", O_RDONLY);
read(fd, buf, len);
close(fd);
uint8_t* buf = static_cast<uint8_t*>(malloc(len));
std::fill(buf, buf+len, 0xbb);

for(int i=0;i<10000;i++) {
crc32_fast((uint8_t*)buf, len);
ASSERT_EQ(0xbc003c2c, crc32_fast(buf, len));
}
free(buf);
}

0 comments on commit be5c868

Please sign in to comment.