test: add 27 sequential-value test images for bit-error detection
Generated by gen_seq_images.py using manual TIFF writer with packed bit streams matching TIFF spec. Each 16x16 image has cycling 0..max values so any bit-level decode error changes the checksum. Test matrix: - Sub-byte BlackIsZero: 3/5/7-bit - Sub-byte WhiteIsZero: 3/5/6/7-bit - Extended BlackIsZero: 10/12/14/24-bit - Extended WhiteIsZero: 10/12/14/24-bit - Extended HPredict: 10/12/14/24-bit - RGB contiguous: 10/12/14/24-bit - RGB planar: 10/12/14/24-bit (first plane only via read_image)
This commit is contained in:
1 parent
fb1afc81e9
commit
5090003bda
29 files changed
+689
No files matched your search
@@ -998,3 +998,152 @@ fn test_gray_u12_hpredict() {
|
||||
// Delta-encoded 12-bit values: [100, 200, 300, 400, 1000, 2000, 3000, 4000]
|
||||
test_image_sum_u16("hpredict-1c-12b.tiff", ColorType::Gray(12), 11000);
|
||||
}
|
||||
|
||||
// ===== Sequential-value test functions =====
|
||||
// Generated by gen_seq_images.py using manual TIFF writer
|
||||
// Each image has cycling 0..max values; any bit error changes the sum.
|
||||
// 16x16 images (256 pixels per channel).
|
||||
// Sub-byte checksums are sums of packed bytes (the decoder returns packed data).
|
||||
// Planar checksums are first-plane only (read_image() reads one plane).
|
||||
|
||||
// --- Sub-byte BlackIsZero ---
|
||||
#[test]
|
||||
fn test_seq_1c_3b() {
|
||||
test_image_sum_u8("seq-1c-3b.tiff", ColorType::Gray(3), 5792);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_5b() {
|
||||
test_image_sum_u8("seq-1c-5b.tiff", ColorType::Gray(5), 18944);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_7b() {
|
||||
test_image_sum_u8("seq-1c-7b.tiff", ColorType::Gray(7), 24992);
|
||||
}
|
||||
|
||||
// --- Sub-byte WhiteIsZero ---
|
||||
#[test]
|
||||
fn test_seq_1c_3b_miniswhite() {
|
||||
test_image_sum_u8("seq-1c-3b-miniswhite.tiff", ColorType::Gray(3), 5792);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_5b_miniswhite() {
|
||||
test_image_sum_u8("seq-1c-5b-miniswhite.tiff", ColorType::Gray(5), 18944);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_6b_miniswhite() {
|
||||
test_image_sum_u8("seq-1c-6b-miniswhite.tiff", ColorType::Gray(6), 25728);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_7b_miniswhite() {
|
||||
test_image_sum_u8("seq-1c-7b-miniswhite.tiff", ColorType::Gray(7), 24992);
|
||||
}
|
||||
|
||||
// --- Extended BlackIsZero ---
|
||||
#[test]
|
||||
fn test_seq_1c_10b() {
|
||||
test_image_sum_u16("seq-1c-10b.tiff", ColorType::Gray(10), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_12b() {
|
||||
test_image_sum_u16("seq-1c-12b.tiff", ColorType::Gray(12), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_14b() {
|
||||
test_image_sum_u16("seq-1c-14b.tiff", ColorType::Gray(14), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_24b() {
|
||||
test_image_sum_u32("seq-1c-24b.tiff", ColorType::Gray(24), 32640);
|
||||
}
|
||||
|
||||
// --- Extended WhiteIsZero ---
|
||||
#[test]
|
||||
fn test_seq_1c_10b_miniswhite() {
|
||||
test_image_sum_u16("seq-1c-10b-miniswhite.tiff", ColorType::Gray(10), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_12b_miniswhite() {
|
||||
test_image_sum_u16("seq-1c-12b-miniswhite.tiff", ColorType::Gray(12), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_14b_miniswhite() {
|
||||
test_image_sum_u16("seq-1c-14b-miniswhite.tiff", ColorType::Gray(14), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_24b_miniswhite() {
|
||||
test_image_sum_u32("seq-1c-24b-miniswhite.tiff", ColorType::Gray(24), 32640);
|
||||
}
|
||||
|
||||
// --- Extended HPredict ---
|
||||
#[test]
|
||||
fn test_seq_1c_10b_hpredict() {
|
||||
test_image_sum_u16("seq-1c-10b-hpredict.tiff", ColorType::Gray(10), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_12b_hpredict() {
|
||||
test_image_sum_u16("seq-1c-12b-hpredict.tiff", ColorType::Gray(12), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_14b_hpredict() {
|
||||
test_image_sum_u16("seq-1c-14b-hpredict.tiff", ColorType::Gray(14), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_1c_24b_hpredict() {
|
||||
test_image_sum_u32("seq-1c-24b-hpredict.tiff", ColorType::Gray(24), 32640);
|
||||
}
|
||||
|
||||
// --- RGB Contiguous ---
|
||||
#[test]
|
||||
fn test_seq_3c_10b_contig() {
|
||||
test_image_sum_u16("seq-3c-10b-contig.tiff", ColorType::RGB(10), 294528);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_3c_12b_contig() {
|
||||
test_image_sum_u16("seq-3c-12b-contig.tiff", ColorType::RGB(12), 294528);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_3c_14b_contig() {
|
||||
test_image_sum_u16("seq-3c-14b-contig.tiff", ColorType::RGB(14), 294528);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_3c_24b_contig() {
|
||||
test_image_sum_u32("seq-3c-24b-contig.tiff", ColorType::RGB(24), 294528);
|
||||
}
|
||||
|
||||
// --- RGB Planar (first plane only via read_image) ---
|
||||
#[test]
|
||||
fn test_seq_3c_10b_planar() {
|
||||
test_image_sum_u16("seq-3c-10b-planar.tiff", ColorType::RGB(10), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_3c_12b_planar() {
|
||||
test_image_sum_u16("seq-3c-12b-planar.tiff", ColorType::RGB(12), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_3c_14b_planar() {
|
||||
test_image_sum_u16("seq-3c-14b-planar.tiff", ColorType::RGB(14), 32640);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seq_3c_24b_planar() {
|
||||
test_image_sum_u32("seq-3c-24b-planar.tiff", ColorType::RGB(24), 32640);
|
||||
}
|
||||
Reference in new issue
Block a user