Testing nolookup versions of crc32
This commit is contained in:
parent
a50dc1b867
commit
d4da05253d
1 changed files with 9 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
#include "crc32.h"
|
#include "crc32.h"
|
||||||
|
#include "crc32_nolookup.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
@ -19,6 +20,14 @@ int main(void) {
|
||||||
assert(crc == crc32("a", 1));
|
assert(crc == crc32("a", 1));
|
||||||
assert(crc == 0xE8B7BE43);
|
assert(crc == 0xE8B7BE43);
|
||||||
|
|
||||||
|
assert(crc32_ieee("123456789", 9) == 0xCBF43926);
|
||||||
|
assert(crc32_ieee("", 0) == 0x00000000);
|
||||||
|
assert(crc32_ieee("a", 1) == 0xE8B7BE43);
|
||||||
|
assert(crc32_ieee("A", 1) == 0xD3D99E8B);
|
||||||
|
assert(crc32_ieee("hello", 5) == 0x3610A686);
|
||||||
|
assert(crc32_ieee("The quick brown fox jumps over the lazy dog", 43) == 0x414FA339);
|
||||||
|
assert(crc32_ieee("The quick brown fox jumps over the lazy dog.", 44) == 0x519025E9);
|
||||||
|
|
||||||
printf("All good!\n");
|
printf("All good!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue