upce integration

This commit is contained in:
Henry Schimke
2022-12-10 10:31:41 -06:00
parent 9752608edd
commit 11c0ac5a81
8 changed files with 276 additions and 317 deletions

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.oned;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.common.AbstractBlackBoxTestCase;
/**
* @author Sean Owen
*/
public final class UPCEANExtensionBlackBox1TestCase extends AbstractBlackBoxTestCase {
public UPCEANExtensionBlackBox1TestCase() {
super("src/test/resources/blackbox/upcean-extension-1", new MultiFormatReader(), BarcodeFormat.EAN_13);
addTest(2, 2, 0.0f);
}
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.oned;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.common.AbstractBlackBoxTestCase;
/**
* @author Sean Owen
*/
public final class UPCEBlackBox1TestCase extends AbstractBlackBoxTestCase {
public UPCEBlackBox1TestCase() {
super("src/test/resources/blackbox/upce-1", new MultiFormatReader(), BarcodeFormat.UPC_E);
addTest(3, 3, 0.0f);
addTest(3, 3, 180.0f);
}
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.oned;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.common.AbstractBlackBoxTestCase;
/**
* @author dswitkin@google.com (Daniel Switkin)
*/
public final class UPCEBlackBox2TestCase extends AbstractBlackBoxTestCase {
public UPCEBlackBox2TestCase() {
super("src/test/resources/blackbox/upce-2", new MultiFormatReader(), BarcodeFormat.UPC_E);
addTest(31, 35, 0, 1, 0.0f);
addTest(31, 35, 1, 1, 180.0f);
}
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.oned;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.common.AbstractBlackBoxTestCase;
/**
* @author dswitkin@google.com (Daniel Switkin)
*/
public final class UPCEBlackBox3ReflectiveTestCase extends AbstractBlackBoxTestCase {
public UPCEBlackBox3ReflectiveTestCase() {
super("src/test/resources/blackbox/upce-3", new MultiFormatReader(), BarcodeFormat.UPC_E);
addTest(6, 8, 0.0f);
addTest(6, 8, 180.0f);
}
}

View File

@@ -0,0 +1,79 @@
/*
* Copyright 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
use rxing::{
oned::{EAN13Reader, UPCEReader},
BarcodeFormat, MultiFormatReader,
};
mod common;
/**
* @author Sean Owen
*/
#[test]
fn upceblack_box1_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/upce-1",
// MultiFormatReader::default(),
UPCEReader::default(),
BarcodeFormat::UPC_E,
);
// super("src/test/resources/blackbox/upce-1", new MultiFormatReader(), BarcodeFormat.UPC_E);
tester.add_test(3, 3, 0.0);
tester.add_test(3, 3, 180.0);
tester.test_black_box()
}
/**
* @author dswitkin@google.com (Daniel Switkin)
*/
#[test]
fn upceblack_box2_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/upce-2",
// MultiFormatReader::default(),
UPCEReader::default(),
BarcodeFormat::UPC_E,
);
// super("src/test/resources/blackbox/upce-2", new MultiFormatReader(), BarcodeFormat.UPC_E);
tester.add_test_complex(31, 35, 0, 1, 0.0);
tester.add_test_complex(31, 35, 1, 1, 180.0);
tester.test_black_box()
}
/**
* @author dswitkin@google.com (Daniel Switkin)
*/
#[test]
fn upceblack_box3_reflective_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/upce-3",
// MultiFormatReader::default(),
UPCEReader::default(),
BarcodeFormat::UPC_E,
);
// super("src/test/resources/blackbox/upce-3", new MultiFormatReader(), BarcodeFormat.UPC_E);
tester.add_test(6, 8, 0.0);
tester.add_test(6, 8, 180.0);
tester.test_black_box()
}