diff --git a/src/oned/multi_format_one_d_reader.rs b/src/oned/multi_format_one_d_reader.rs index 3292fde..35f3313 100644 --- a/src/oned/multi_format_one_d_reader.rs +++ b/src/oned/multi_format_one_d_reader.rs @@ -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()); diff --git a/tests/Code93BlackBox1TestCase.java b/tests/code_93_blackbox_1_testcase.rs similarity index 54% rename from tests/Code93BlackBox1TestCase.java rename to tests/code_93_blackbox_1_testcase.rs index e8606e8..3b7bdd0 100644 --- a/tests/Code93BlackBox1TestCase.java +++ b/tests/code_93_blackbox_1_testcase.rs @@ -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() } -} \ No newline at end of file