Cross Reference: test-crc32.c
xref
: /
dovecot
/
src
/
lib
/
test-crc32.c
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
bcb4e51a409d94ae670de96afb8483a4f7855294
Stephan Bosch
/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
#
include
"
test-lib.h
"
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
#
include
"
crc32.h
"
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
void
test_crc32
(
void
)
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
{
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
const
char
str
[] =
"foo\0bar"
;
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
test_begin
(
"crc32"
);
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
test_assert
(
crc32_str
(
str
) ==
0x8c736521
);
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
test_assert
(
crc32_data
(
str
,
sizeof
(
str
)) ==
0x32c9723d
);
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
test_end
();
3efdcb59492bd1e0602340a4204003a32b34654a
Timo Sirainen
}