mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
move all Result to RXingResult
This commit is contained in:
@@ -110,18 +110,18 @@ public final class QRCodeWriterTestCase extends Assert {
|
||||
|
||||
BufferedImage image = loadImage(fileName);
|
||||
assertNotNull(image);
|
||||
BitMatrix goldenResult = createMatrixFromImage(image);
|
||||
assertNotNull(goldenResult);
|
||||
BitMatrix goldenRXingResult = createMatrixFromImage(image);
|
||||
assertNotNull(goldenRXingResult);
|
||||
|
||||
Map<EncodeHintType,Object> hints = new EnumMap<>(EncodeHintType.class);
|
||||
hints.put(EncodeHintType.ERROR_CORRECTION, ecLevel);
|
||||
Writer writer = new QRCodeWriter();
|
||||
BitMatrix generatedResult = writer.encode(contents, BarcodeFormat.QR_CODE, resolution,
|
||||
BitMatrix generatedRXingResult = writer.encode(contents, BarcodeFormat.QR_CODE, resolution,
|
||||
resolution, hints);
|
||||
|
||||
assertEquals(resolution, generatedResult.getWidth());
|
||||
assertEquals(resolution, generatedResult.getHeight());
|
||||
assertEquals(goldenResult, generatedResult);
|
||||
assertEquals(resolution, generatedRXingResult.getWidth());
|
||||
assertEquals(resolution, generatedRXingResult.getHeight());
|
||||
assertEquals(goldenRXingResult, generatedRXingResult);
|
||||
}
|
||||
|
||||
// Golden images are generated with "qrcode_sample.cc". The images are checked with both eye balls
|
||||
|
||||
@@ -905,11 +905,11 @@ public final class EncoderTestCase extends Assert {
|
||||
".a.a.)", null, false);
|
||||
}
|
||||
|
||||
static void verifyMinimalEncoding(String input, String expectedResult, Charset priorityCharset, boolean isGS1)
|
||||
static void verifyMinimalEncoding(String input, String expectedRXingResult, Charset priorityCharset, boolean isGS1)
|
||||
throws Exception {
|
||||
MinimalEncoder.ResultList result = MinimalEncoder.encode(input, null, priorityCharset, isGS1,
|
||||
MinimalEncoder.RXingResultList result = MinimalEncoder.encode(input, null, priorityCharset, isGS1,
|
||||
ErrorCorrectionLevel.L);
|
||||
assertEquals(result.toString(), expectedResult);
|
||||
assertEquals(result.toString(), expectedRXingResult);
|
||||
}
|
||||
|
||||
private static void verifyGS1EncodedData(QRCode qrCode) {
|
||||
|
||||
Reference in New Issue
Block a user