code93 reader tests pass

This commit is contained in:
Henry Schimke
2022-12-07 14:31:26 -06:00
parent f7d957ac3b
commit 28e0c9a9a1
2 changed files with 21 additions and 16 deletions

View File

@@ -14,10 +14,9 @@
* limitations under the License.
*/
use one_d_reader_derive::OneDReader;
use super::CodaBarReader;
use super::Code39Reader;
use super::Code93Reader;
use super::OneDReader;
use crate::BarcodeFormat;
use crate::DecodeHintValue;
@@ -74,9 +73,9 @@ impl MultiFormatOneDReader {
useCode39CheckDigit,
)));
}
// if (possibleFormats.contains(&BarcodeFormat::CODE_93)) {
// readers.add(new Code93Reader());
// }
if possibleFormats.contains(&BarcodeFormat::CODE_93) {
readers.push(Box::new( Code93Reader::new()));
}
// if (possibleFormats.contains(&BarcodeFormat::CODE_128)) {
// readers.add(new Code128Reader());
// }
@@ -97,7 +96,7 @@ impl MultiFormatOneDReader {
// readers.push(new MultiFormatUPCEANReader(hints));
readers.push(Box::new(Code39Reader::new()));
readers.push(Box::new(CodaBarReader::new()));
// readers.push(new Code93Reader());
readers.push(Box::new( Code93Reader::new()));
// readers.push(new Code128Reader());
// readers.push(new ITFReader());
// readers.push(new RSS14Reader());

View File

@@ -14,21 +14,27 @@
* limitations under the License.
*/
package com.google.zxing.oned;
use rxing::{
oned::{CodaBarReader, Code39Reader, OneDReader},
BarcodeFormat, MultiFormatReader,
};
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.common.AbstractBlackBoxTestCase;
mod common;
/**
* @author Sean Owen
*/
public final class Code93BlackBox1TestCase extends AbstractBlackBoxTestCase {
#[test]
fn code93_black_box1_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/code93-1",
MultiFormatReader::default(),
BarcodeFormat::CODE_93,
);
// super("src/test/resources/blackbox/code93-1", new MultiFormatReader(), BarcodeFormat.CODE_93);
tester.add_test(3, 3, 0.0);
tester.add_test(3, 3, 180.0);
public Code93BlackBox1TestCase() {
super("src/test/resources/blackbox/code93-1", new MultiFormatReader(), BarcodeFormat.CODE_93);
addTest(3, 3, 0.0f);
addTest(3, 3, 180.0f);
tester.test_black_box()
}
}