X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcrcsync%2Ftest%2Frun-roll.c;h=95c50c1abe93a9c4deee4200291d3df9998c39e3;hp=106e9023ea096023a68dfd8a8cd4b21f59443461;hb=HEAD;hpb=94ff9fc87d90173145772a41f79987988f9f0972 diff --git a/ccan/crcsync/test/run-roll.c b/ccan/crcsync/test/run-roll.c index 106e9023..95c50c1a 100644 --- a/ccan/crcsync/test/run-roll.c +++ b/ccan/crcsync/test/run-roll.c @@ -1,6 +1,6 @@ -#include "crcsync/crcsync.h" -#include "crcsync/crcsync.c" -#include "tap/tap.h" +#include +#include +#include #include #include @@ -10,7 +10,7 @@ static void test_roll(unsigned int wsize) { uint8_t data[wsize * 2]; - uint32_t uncrc_tab[256]; + uint64_t uncrc_tab[256]; unsigned int i; init_uncrc_tab(uncrc_tab, wsize); @@ -19,10 +19,10 @@ static void test_roll(unsigned int wsize) data[i] = random(); for (i = 1; i < ARRAY_SIZE(data) - wsize; i++) { - uint32_t rollcrc, crc; + uint64_t rollcrc, crc; - crc = crc32c(0, data+i, wsize); - rollcrc = crc_roll(crc32c(0, data+i-1, wsize), + crc = crc64_iso(0, data+i, wsize); + rollcrc = crc_roll(crc64_iso(0, data+i-1, wsize), data[i-1], data[i+wsize-1], uncrc_tab); ok(crc == rollcrc, "wsize %u, i %u", wsize, i);