Skip to content

Commit 953fa0f

Browse files
authored
Merge pull request #199 from nickbabcock/test-crc
Re-enable CRC for regression tests
2 parents a7e32d2 + dd10eef commit 953fa0f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/crc.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ const fn gen_crc_table<const N: usize>(poly: u32) -> [[u32; 256]; N] {
3232
table
3333
}
3434

35-
const CRC_TABLE: [[u32; 256]; 16] = gen_crc_table(0x04c1_1db7);
35+
// Prefer static over const to cut test times in half
36+
// ref: https://github.com/srijs/rust-crc32fast/commit/e61ce6a39bbe9da495198a4037292ec299e8970f
37+
static CRC_TABLE: [[u32; 256]; 16] = gen_crc_table(0x04c1_1db7);
3638

3739
/// Calculates the crc-32 for rocket league replays. Not all CRC algorithms are the same. The crc
3840
/// algorithm can be generated with the following parameters (pycrc):

tests/integration_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn test_replay_snapshots() {
88
glob!("../assets/replays/good", "*.replay", |path| {
99
let data = fs::read(path).unwrap();
1010
let parsed = ParserBuilder::new(&data[..])
11-
.on_error_check_crc() // CRC checking in debug mode makes tests 2x slower
11+
.always_check_crc()
1212
.must_parse_network_data()
1313
.parse();
1414

0 commit comments

Comments
 (0)