Skip to content

Commit

Permalink
Test for correctness in correctness tests instead of a separate test,…
Browse files Browse the repository at this point in the history
… use slice16 impl if simd is not available
  • Loading branch information
valaphee committed Mar 23, 2024
1 parent 3df2166 commit bf350b5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/crc128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ mod test {

// Check if the baseline is as expected.
for alg in algs_to_test {
assert_eq!(Crc::<Bytewise<u128>>::new(alg).checksum("123456789".as_bytes()), alg.check);
assert_eq!(
Crc::<Bytewise<u128>>::new(alg).checksum("123456789".as_bytes()),
alg.check
);
}

for alg in algs_to_test {
Expand Down
5 changes: 4 additions & 1 deletion src/crc16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,10 @@ mod test {

// Check if the baseline is as expected.
for alg in algs_to_test {
assert_eq!(Crc::<Bytewise<u16>>::new(alg).checksum("123456789".as_bytes()), alg.check);
assert_eq!(
Crc::<Bytewise<u16>>::new(alg).checksum("123456789".as_bytes()),
alg.check
);
}

for alg in algs_to_test {
Expand Down
5 changes: 4 additions & 1 deletion src/crc32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ mod test {

// Check if the baseline is as expected.
for alg in algs_to_test {
assert_eq!(Crc::<Bytewise<u32>>::new(alg).checksum("123456789".as_bytes()), alg.check);
assert_eq!(
Crc::<Bytewise<u32>>::new(alg).checksum("123456789".as_bytes()),
alg.check
);
}

for alg in algs_to_test {
Expand Down
5 changes: 4 additions & 1 deletion src/crc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ mod test {

// Check if the baseline is as expected.
for alg in algs_to_test {
assert_eq!(Crc::<Bytewise<u64>>::new(alg).checksum("123456789".as_bytes()), alg.check);
assert_eq!(
Crc::<Bytewise<u64>>::new(alg).checksum("123456789".as_bytes()),
alg.check
);
}

for alg in algs_to_test {
Expand Down
5 changes: 4 additions & 1 deletion src/crc8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ mod test {

// Check if the baseline is as expected.
for alg in algs_to_test {
assert_eq!(Crc::<Bytewise<u8>>::new(alg).checksum("123456789".as_bytes()), alg.check);
assert_eq!(
Crc::<Bytewise<u8>>::new(alg).checksum("123456789".as_bytes()),
alg.check
);
}

for alg in algs_to_test {
Expand Down

0 comments on commit bf350b5

Please sign in to comment.