syncfiles/lib/crc32_test.c

26 lines
582 B
C
Raw Normal View History

// Copyright 2022 Dietrich Epp.
// This file is part of SyncFiles. SyncFiles is licensed under the terms of the
// Mozilla Public License, version 2.0. See LICENSE.txt for details.
2022-04-10 07:37:14 +00:00
#include "lib/crc32.h"
#include <stdio.h>
static const char kTest[9] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'};
int main(int argc, char **argv)
{
UInt32 expect;
UInt32 val;
(void)argc;
(void)argv;
expect = 0xcbf43926;
val = CRC32Update(0, kTest, sizeof(kTest));
if (val != expect) {
fprintf(stderr, "Error: CRC = 0x%08x, expect 0x%08x\n", val, expect);
return 1;
}
return 0;
}