tdb2: don't cancel transactions on lock failures in tdb1 backend.
[ccan] / ccan / crcsync / test / run-crc.c
index 0325cce045ec46e6af1a3652fad7b8d0d619f955..70084cd14939dd7ae45752972773f4c1467c3f9d 100644 (file)
@@ -1,34 +1,34 @@
-#include "crcsync/crcsync.h"
-#include "crcsync/crcsync.c"
-#include "tap/tap.h"
+#include <ccan/crcsync/crcsync.h>
+#include <ccan/crcsync/crcsync.c>
+#include <ccan/tap/tap.h>
 
 int main(int argc, char *argv[])
 {
        char buffer[1024];
        unsigned int i, j;
-       uint32_t crcs[12] = { 0xFFFFF, 0xdeadf00d };
+       uint64_t crcs[12] = { 0xFFFFF, 0xdeadf00d };
 
        plan_tests(3 + 8192);
 
        /* Simple test (we know currently crc of 0s is 0) */
        memset(buffer, 0, sizeof(buffer));
-       crc_of_blocks(buffer, sizeof(buffer), sizeof(buffer), 32, crcs);
+       crc_of_blocks(buffer, sizeof(buffer), sizeof(buffer), 64, crcs);
        ok1(crcs[0] == 0);
-       crc_of_blocks(buffer, sizeof(buffer), sizeof(buffer)/2, 32, crcs);
+       crc_of_blocks(buffer, sizeof(buffer), sizeof(buffer)/2, 64, crcs);
        ok1(crcs[0] == 0);
        ok1(crcs[1] == 0);
 
-       /* We know they're using crc32c. */
+       /* We know they're using crc64_iso. */
        for (i = 0; i < sizeof(buffer); i++) {
                buffer[i] = i;
                crc_of_blocks(buffer, sizeof(buffer), sizeof(buffer)/7,
-                             32, crcs);
+                             64, crcs);
                for (j = 0; j < sizeof(buffer); j += sizeof(buffer)/7) {
                        unsigned int len = sizeof(buffer)/7;
                        if (j + len > sizeof(buffer))
                                len = sizeof(buffer) - j;
                        
-                       ok1(crc32c(0, buffer + j, len) == crcs[j/(sizeof(buffer)/7)]);
+                       ok1(crc64_iso(0, buffer + j, len) == crcs[j/(sizeof(buffer)/7)]);
                }
        }