Skip to content

Commit efdb06b

Browse files
committed
Add test for subtract with overflow
1 parent 1af5f35 commit efdb06b

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.

tests/github_issues.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,3 +668,35 @@ fn issue_69() {
668668
(code 128) 1734113010D24121203
669669
*/
670670
}
671+
672+
#[cfg(feature = "image")]
673+
#[test]
674+
fn issue_77_subtract_with_overflow() {
675+
use rxing::DecodeHints;
676+
677+
let mut hints: DecodeHints =
678+
DecodeHints::default().with(rxing::DecodeHintValue::TryHarder(true));
679+
680+
let mut data_1 = Vec::new();
681+
std::fs::File::open("test_resources/blackbox/github_issue_cases/subtract-with-overflow-qrcode-detector-1-issue-77.bin")
682+
.unwrap()
683+
.read_to_end(&mut data_1)
684+
.unwrap();
685+
rxing::helpers::detect_multiple_in_luma_with_hints(data_1, 682, 504, &mut hints).unwrap_or_default();
686+
687+
let mut data_2 = Vec::new();
688+
std::fs::File::open("test_resources/blackbox/github_issue_cases/subtract-with-overflow-qrcode-detector-2-issue-77.bin")
689+
.unwrap()
690+
.read_to_end(&mut data_2)
691+
.unwrap();
692+
693+
rxing::helpers::detect_multiple_in_luma_with_hints(data_2, 678, 504, &mut hints).unwrap_or_default();
694+
695+
let mut data_3 = Vec::new();
696+
std::fs::File::open("test_resources/blackbox/github_issue_cases/subtract-with-overflow-version-issue-77.bin")
697+
.unwrap()
698+
.read_to_end(&mut data_3)
699+
.unwrap();
700+
701+
rxing::helpers::detect_multiple_in_luma_with_hints(data_3, 672, 504, &mut hints).unwrap_or_default();
702+
}

0 commit comments

Comments
 (0)