datamatrix integration passes

This commit is contained in:
Henry Schimke
2022-11-28 11:51:26 -06:00
parent ba02512695
commit 75e69bc498
14 changed files with 131 additions and 150 deletions

View File

@@ -1,36 +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.datamatrix;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.common.AbstractBlackBoxTestCase;
/**
* @author bbrown@google.com (Brian Brown)
*/
public final class DataMatrixBlackBox1TestCase extends AbstractBlackBoxTestCase {
public DataMatrixBlackBox1TestCase() {
super("src/test/resources/blackbox/datamatrix-1", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
addTest(21, 21, 0.0f);
addTest(21, 21, 90.0f);
addTest(21, 21, 180.0f);
addTest(21, 21, 270.0f);
}
}

View File

@@ -1,36 +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.datamatrix;
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 DataMatrixBlackBox2TestCase extends AbstractBlackBoxTestCase {
public DataMatrixBlackBox2TestCase() {
super("src/test/resources/blackbox/datamatrix-2", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
addTest(13, 13, 0, 1, 0.0f);
addTest(15, 15, 0, 1, 90.0f);
addTest(17, 16, 0, 1, 180.0f);
addTest(15, 15, 0, 1, 270.0f);
}
}

View File

@@ -1,36 +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.datamatrix;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.common.AbstractBlackBoxTestCase;
/**
* @author gitlost
*/
public final class DataMatrixBlackBox3TestCase extends AbstractBlackBoxTestCase {
public DataMatrixBlackBox3TestCase() {
super("src/test/resources/blackbox/datamatrix-3", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
addTest(18, 18, 0.0f);
addTest(17, 17, 90.0f);
addTest(18, 18, 180.0f);
addTest(18, 18, 270.0f);
}
}

View File

@@ -0,0 +1,76 @@
/*
* 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::MultiFormatReader;
mod common;
/**
* @author bbrown@google.com (Brian Brown)
*/
#[test]
fn data_matrix_black_box1_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/datamatrix-1",
MultiFormatReader::default(),
rxing::BarcodeFormat::DATA_MATRIX,
);
// super("src/test/resources/blackbox/datamatrix-1", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
tester.add_test(21, 21, 0.0);
tester.add_test(21, 21, 90.0);
tester.add_test(21, 21, 180.0);
tester.add_test(21, 21, 270.0);
tester.test_black_box();
}
/**
* @author dswitkin@google.com (Daniel Switkin)
*/
#[test]
fn data_matrix_black_box2_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/datamatrix-2",
MultiFormatReader::default(),
rxing::BarcodeFormat::DATA_MATRIX,
);
// super("src/test/resources/blackbox/datamatrix-2", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
tester.add_test_complex(13, 13, 0, 1, 0.0);
tester.add_test_complex(15, 15, 0, 1, 90.0);
tester.add_test_complex(17, 16, 0, 1, 180.0);
tester.add_test_complex(15, 15, 0, 1, 270.0);
tester.test_black_box();
}
/**
* @author gitlost
*/
#[test]
fn data_matrix_black_box3_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/datamatrix-3",
MultiFormatReader::default(),
rxing::BarcodeFormat::DATA_MATRIX,
);
// super("src/test/resources/blackbox/datamatrix-3", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
tester.add_test(18, 18, 0.0);
tester.add_test(17, 17, 90.0);
tester.add_test(18, 18, 180.0);
tester.add_test(18, 18, 270.0);
tester.test_black_box();
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
use rxing::{maxicode::MaxiCodeReader, BarcodeFormat, DecodeHintType};
use rxing::{maxicode::MaxiCodeReader, BarcodeFormat, DecodeHintType, MultiFormatReader};
mod common;
@@ -25,7 +25,7 @@ mod common;
fn maxicode1_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/maxicode-1",
MaxiCodeReader {},
MultiFormatReader::default(),
BarcodeFormat::MAXICODE,
);
// super("src/test/resources/blackbox/maxicode-1", new MultiFormatReader(), BarcodeFormat.MAXICODE);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
use rxing::{qrcode::QRCodeReader, BarcodeFormat};
use rxing::{qrcode::QRCodeReader, BarcodeFormat, MultiFormatReader};
mod common;
@@ -26,7 +26,7 @@ mod common;
fn qrcode_black_box1_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/qrcode-1",
QRCodeReader {},
MultiFormatReader::default(),
rxing::BarcodeFormat::QR_CODE,
);
// super("src/test/resources/blackbox/qrcode-1", new MultiFormatReader(), BarcodeFormat.QR_CODE);
@@ -46,6 +46,7 @@ fn qrcode_black_box1_test_case() {
fn qrcode_black_box2_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/qrcode-2",
// MultiFormatReader::default(),
QRCodeReader {},
BarcodeFormat::QR_CODE,
);
@@ -65,7 +66,7 @@ fn qrcode_black_box2_test_case() {
fn qrcode_black_box3_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/qrcode-3",
QRCodeReader {},
MultiFormatReader::default(),
BarcodeFormat::QR_CODE,
);
tester.add_test(38, 38, 0.0);
@@ -86,7 +87,7 @@ fn qrcode_black_box3_test_case() {
fn qrcode_black_box4_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/qrcode-4",
QRCodeReader {},
MultiFormatReader::default(),
BarcodeFormat::QR_CODE,
);
tester.add_test(36, 36, 0.0);
@@ -109,7 +110,7 @@ fn qrcode_black_box4_test_case() {
fn qrcode_black_box5_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/qrcode-5",
QRCodeReader {},
MultiFormatReader::default(),
BarcodeFormat::QR_CODE,
);
tester.add_test(19, 19, 0.0);
@@ -129,7 +130,7 @@ fn qrcode_black_box5_test_case() {
fn qrcode_black_box6_test_case() {
let mut tester = common::AbstractBlackBoxTestCase::new(
"test_resources/blackbox/qrcode-6",
QRCodeReader {},
MultiFormatReader::default(),
BarcodeFormat::QR_CODE,
);
tester.add_test(15, 15, 0.0);