fn common_create_snapshot_archive_files(
        snapshot_archives_dir: &Path,
        min_full_snapshot_slot: Slot,
        max_full_snapshot_slot: Slot,
        min_incremental_snapshot_slot: Slot,
        max_incremental_snapshot_slot: Slot,
    ) {
        for full_snapshot_slot in min_full_snapshot_slot..max_full_snapshot_slot {
            for incremental_snapshot_slot in
                min_incremental_snapshot_slot..max_incremental_snapshot_slot
            {
                let snapshot_filename = format!(
                    "incremental-snapshot-{}-{}-{}.tar",
                    full_snapshot_slot,
                    incremental_snapshot_slot,
                    Hash::default()
                );
                let snapshot_filepath = snapshot_archives_dir.join(snapshot_filename);
                File::create(snapshot_filepath).unwrap();
            }

            let snapshot_filename =
                format!("snapshot-{}-{}.tar", full_snapshot_slot, Hash::default());
            let snapshot_filepath = snapshot_archives_dir.join(snapshot_filename);
            File::create(snapshot_filepath).unwrap();

            // Add in an incremental snapshot with a bad filename and high slot to ensure filename are filtered and sorted correctly
            let bad_filename = format!(
                "incremental-snapshot-{}-{}-bad!hash.tar",
                full_snapshot_slot,
                max_incremental_snapshot_slot + 1,
            );
            let bad_filepath = snapshot_archives_dir.join(bad_filename);
            File::create(bad_filepath).unwrap();
        }

        // Add in a snapshot with a bad filename and high slot to ensure filename are filtered and
        // sorted correctly
        let bad_filename = format!("snapshot-{}-bad!hash.tar", max_full_snapshot_slot + 1);
        let bad_filepath = snapshot_archives_dir.join(bad_filename);
        File::create(bad_filepath).unwrap();
    }
/// A test helper function that creates full and incremental snapshot archive files.  Creates
/// full snapshot files in the range (`min_full_snapshot_slot`, `max_full_snapshot_slot`], and
/// incremental snapshot files in the range (`min_incremental_snapshot_slot`,
/// `max_incremental_snapshot_slot`].  Additionally, "bad" files are created for both full and
/// incremental snapshots to ensure the tests properly filter them out.
A test helper function that creates full and incremental snapshot archive files.
A test helper function that creates full and incremental snapshot archive files .
fn common_create_snapshot_archive_files(
        snapshot_archives_dir: &Path,
        min_full_snapshot_slot: Slot,
        max_full_snapshot_slot: Slot,
        min_incremental_snapshot_slot: Slot,
        max_incremental_snapshot_slot: Slot,
    ) {
        for full_snapshot_slot in min_full_snapshot_slot..max_full_snapshot_slot {
            for incremental_snapshot_slot in
                min_incremental_snapshot_slot..max_incremental_snapshot_slot
            {
                let snapshot_filename = format!(
                    "incremental-snapshot-{}-{}-{}.tar",
                    full_snapshot_slot,
                    incremental_snapshot_slot,
                    Hash::default()
                );
                let snapshot_filepath = snapshot_archives_dir.join(snapshot_filename);
                File::create(snapshot_filepath).unwrap();
            }
            let snapshot_filename =
                format!("snapshot-{}-{}.tar", full_snapshot_slot, Hash::default());
            let snapshot_filepath = snapshot_archives_dir.join(snapshot_filename);
            File::create(snapshot_filepath).unwrap();
            // Add in an incremental snapshot with a bad filename and high slot to ensure filename are filtered and sorted correctly
            let bad_filename = format!(
                "incremental-snapshot-{}-{}-bad!hash.tar",
                full_snapshot_slot,
                max_incremental_snapshot_slot + 1,
            );
            let bad_filepath = snapshot_archives_dir.join(bad_filename);
            File::create(bad_filepath).unwrap();
        }
        // Add in a snapshot with a bad filename and high slot to ensure filename are filtered and
        // sorted correctly
        let bad_filename = format!("snapshot-{}-bad!hash.tar", max_full_snapshot_slot + 1);
        let bad_filepath = snapshot_archives_dir.join(bad_filename);
        File::create(bad_filepath).unwrap();
    }
fn common_create_snapshot_archive_files ( snapshot_archives_dir : & Path , min_full_snapshot_slot : Slot , max_full_snapshot_slot : Slot , min_incremental_snapshot_slot : Slot , max_incremental_snapshot_slot : Slot , ) { for full_snapshot_slot in min_full_snapshot_slot .. max_full_snapshot_slot { for incremental_snapshot_slot in min_incremental_snapshot_slot .. max_incremental_snapshot_slot { let snapshot_filename = format ! ( " " full_snapshot_slot incremental_snapshot_slot Hash default ( ) ) ; let snapshot_filepath = snapshot_archives_dir . join ( snapshot_filename ) ; File :: create ( snapshot_filepath ) . unwrap ( ) ; } let snapshot_filename = format ! ( " " full_snapshot_slot Hash default ( ) ) ; let snapshot_filepath = snapshot_archives_dir . join ( snapshot_filename ) ; File :: create ( snapshot_filepath ) . unwrap ( ) ; // Add in an incremental snapshot with a bad filename and high slot to ensure filename are filtered and sorted correctly let bad_filename = format ! ( " " full_snapshot_slot max_incremental_snapshot_slot 1 ) ; let bad_filepath = snapshot_archives_dir . join ( bad_filename ) ; File :: create ( bad_filepath ) . unwrap ( ) ; } // Add in a snapshot with a bad filename and high slot to ensure filename are filtered and // sorted correctly let bad_filename = format ! ( " " max_full_snapshot_slot 1 ) ; let bad_filepath = snapshot_archives_dir . join ( bad_filename ) ; File :: create ( bad_filepath ) . unwrap ( ) ; }
A test helper function that creates full and incremental snapshot archive files.
A test helper function that creates full and incremental snapshot archive files .
snapshot_archives_dir
&Path
min_full_snapshot_slot
Slot
max_full_snapshot_slot
Slot
min_incremental_snapshot_slot
Slot
max_incremental_snapshot_slot
Slot