Skip to content

Commit 75464e4

Browse files
committed
Update existing tests to work with caching
- [x] 10. Update existing tests to work with caching - Run all existing tests to ensure no regressions - Update any tests that might be affected by caching behavior - Ensure test isolation by clearing cache between tests if needed - Verify all CRC algorithm tests still pass
1 parent 97504d6 commit 75464e4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.kiro/specs/crc-params-caching/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
- Test cache operations under memory pressure
6464
- _Requirements: 4.1, 4.2_
6565

66-
- [ ] 19. Update existing tests to work with caching
66+
- [x] 10. Update existing tests to work with caching
6767
- Run all existing tests to ensure no regressions
6868
- Update any tests that might be affected by caching behavior
6969
- Ensure test isolation by clearing cache between tests if needed

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ mod lib {
621621

622622
#[test]
623623
fn test_checksum_with_custom_params() {
624+
crate::cache::clear_cache();
625+
624626
// CRC-32 reflected
625627
assert_eq!(
626628
checksum_with_params(get_custom_crc32_reflected(), TEST_CHECK_STRING),
@@ -648,6 +650,8 @@ mod lib {
648650

649651
#[test]
650652
fn test_get_custom_params() {
653+
crate::cache::clear_cache();
654+
651655
assert_eq!(
652656
checksum_with_params(get_custom_crc32_reflected(), TEST_CHECK_STRING),
653657
CRC32_ISCSI.check,
@@ -678,6 +682,8 @@ mod lib {
678682

679683
#[test]
680684
fn test_digest_updates_check_with_custom_params() {
685+
crate::cache::clear_cache();
686+
681687
// CRC-32 reflected
682688
check_digest(
683689
Digest::new_with_params(get_custom_crc32_reflected()),
@@ -788,6 +794,8 @@ mod lib {
788794

789795
#[test]
790796
fn test_combine_with_custom_params() {
797+
crate::cache::clear_cache();
798+
791799
// CRC-32 reflected
792800
let crc32_params = get_custom_crc32_reflected();
793801
let checksum1 = checksum_with_params(crc32_params, "1234".as_ref());
@@ -845,6 +853,8 @@ mod lib {
845853

846854
#[test]
847855
fn test_checksum_file_with_custom_params() {
856+
crate::cache::clear_cache();
857+
848858
// Create a test file with repeating zeros
849859
let test_file_path = "test/test_crc32_hash_file_custom.bin";
850860
let data = vec![0u8; 1024 * 1024]; // 1 MiB of zeros

0 commit comments

Comments
 (0)