More test cases from Enrique G. S.

git-svn-id: https://zxing.googlecode.com/svn/trunk@145 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-01-16 22:13:00 +00:00
parent 552630677f
commit 35f4a385e2
63 changed files with 64 additions and 95 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View file

@ -0,0 +1 @@
8413000065504

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -0,0 +1 @@
8480010001136

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View file

@ -0,0 +1 @@
061869053712

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View file

@ -0,0 +1 @@
5201815331227

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

View file

@ -0,0 +1 @@
8413600298517

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View file

@ -0,0 +1 @@
3560070169443

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View file

@ -0,0 +1 @@
4045787034318

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View file

@ -0,0 +1 @@
045496442736

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View file

@ -0,0 +1 @@
619659023935

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -0,0 +1 @@
3086126100326

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View file

@ -0,0 +1 @@
4820024790635

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

View file

@ -0,0 +1 @@
8480010092271

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

View file

@ -0,0 +1 @@
4000539017100

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

View file

@ -0,0 +1 @@
7622200008018

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

View file

@ -0,0 +1 @@
5603667020517

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View file

@ -0,0 +1 @@
7622400791949

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View file

@ -0,0 +1 @@
5709262942503

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View file

@ -0,0 +1 @@
9780140013993

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View file

@ -0,0 +1 @@
4901780188352

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

View file

@ -0,0 +1 @@
606949762520

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

View file

@ -0,0 +1 @@
9771699057002

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

View file

@ -0,0 +1 @@
4007817327098

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View file

@ -0,0 +1 @@
8480000823274

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

View file

@ -0,0 +1 @@
5025121072311

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

View file

@ -0,0 +1 @@
5449000039231

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View file

@ -0,0 +1 @@
8410054010412

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View file

@ -0,0 +1 @@
8480010045062

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View file

@ -0,0 +1 @@
9788430532674

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View file

@ -0,0 +1 @@
8480017507990

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -0,0 +1 @@
3166298099809

View file

@ -0,0 +1 @@
Thanks to Enrique G-S for contributing these test images.

View file

@ -0,0 +1,33 @@
/*
* Copyright 2008 Google Inc.
*
* 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;
import com.google.zxing.common.AbstractBlackBoxTestCase;
import com.google.zxing.upc.UPCReader;
import java.io.File;
/**
* @author srowen@google.com (Sean Owen)
*/
public final class UPCReaderBlackBox2TestCase extends AbstractBlackBoxTestCase {
public UPCReaderBlackBox2TestCase() {
super(new File("test/data/blackbox/upc2"), new UPCReader(), 0.5);
}
}

View file

@ -1,95 +0,0 @@
/*
* Copyright 2007 Google Inc.
*
* 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.qrcode;
import com.google.zxing.ReaderException;
import com.google.zxing.Result;
import com.google.zxing.MonochromeBitmapSource;
import com.google.zxing.Reader;
import com.google.zxing.client.j2se.BufferedImageMonochromeBitmapSource;
import junit.framework.TestCase;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
/**
* @author srowen@google.com (Sean Owen)
*/
public final class QRCodeReaderTestCase extends TestCase {
public void testDecode() throws Exception {
doTestURI("http://writerresponsetheory.org/wordpress/wp-content/uploads/qrcode_01.png",
"When we at WRT talk about \\\"text,\\\" we are generally talking about a particular kind of readable " +
"information encoding - and readable is a complex proposition. Text may be stylized in a way we are " +
"unfamiliar with, as in blackletter - it may be interspersed with some markup we don\\'t understand, " +
"such as HTML - it may be be a substitution system we aren\\'t familiar with, such as braille or " +
"morse code - or it may be a system that, while technically human-readable, isn\\'t particularly " +
"optimized for reading by humans, as with barcodes (although barcodes can be read).");
doTestURI("http://writerresponsetheory.org/query/poe/qrcode%20outputs/qrcodegen-examples/chunk-from-128-bug-head/" +
"encodes-by-nfggames/qr-chunk-from-128-bughead-ground.png",
"LANDBYASCARC PERCEPTIBLEC EEK,OOZI GITSWAYTHROU AWILDERNESSOFBESUPPOSED,I " +
"CANT,ORATL ASTDWARFISH.NO REESOFANYM NITUDEARETOBESOMEMISERA EFRAMEBUIL I GS,TENANTED, U " +
"INGSUMMER THEFUGITIVE;BUTTHEWHO ISLAND,WI H EXCEPTIONOFT W STERNPOI ,ANDALINEOFLLIAMLEGR " +
".HEWASOF N ENTHUGUENOTF Y ANDHADON BEENWEALTHTIONCONSE ENTUPONH SD STERS,HELEFTNE " +
"LE NS,THEC OFHISFOREOUTHCARO A.THISISLA AVERYSINGULARO TCONSISTSO " +
"ITTLEELSEDSAQUART FAMILE. TI PARATEDFROMTHEMA AN BYASCAR YPERCEPTERESORT " +
"MARSH EN EVEGETATION,ASMIGH SU POSED, CANT,ORATREMITY, " +
"ORT OULTRIESTANDS,ANDWHEREARESOM MIS FRAMEBUIFEVER,MAYBE " +
"INDEED, TO;BUTT EISLAND,WITNYYEARSAGO,IC ACTED " +
"LLIAM AND.HEWASOFANNESHADREDUCEDHIM OWA " +
"IONC NSEQUENTUPONHISDSIDENCEATSULLIVA \\'S HC ROLINA.THISISLANOUTTHR " +
"LESLON . THATN OINTE U RTEROF E.ITISTHROU ERNE DSANDSLI ,AFAVOR " +
"TOFT HEN.T");
doTestURI("http://www.malcolmhall.com/wp-content/uploads/2006/07/200607260214.jpg",
"http://www.malcolmhall.com");
doTestURI("http://www.qrcodeblog.com/qr/0609/060902_qr_kawasaki_st02.jpg",
"http://wwws.keihin.ktr.mlit.go.jp/keitai/");
doTestURI("http://mobile.kaywa.com/files/images/2007/4/480/mob181_1175524511.jpg",
"2021200000");
doTestURI("http://www.smoothplanet.com/files/images/2007/2/mob281_1170754866.jpg",
"http://d.kaywa.com/20207100");
doTestURI("http://www.mobileviews.com/blog/wp-content/uploads/2006/11/livebarcode.gif",
"BIZCARD:N:Todd;X:Ogasawara;T:Tech Geek;C:MobileViews.com;A:MobileTown USA;E:editor@mobileviews.com;;");
doTestURI("http://staticrooster.com/tshirts/qr_sm.gif",
"http://staticrooster.com");
doTestURI("http://www.ihaveanidea.org/blogs/uploads/i/interactive/270.png",
"Morden");
doTestURI("http://www.google.co.jp/mobile/images/qrcode_mobile.gif",
"Google \u30e2\u30d0\u30a4\u30eb\r\nhttp://google.jp");
}
private static void doTestURI(final String uriString, final String expected)
throws URISyntaxException, IOException, ReaderException {
URI uri = new URI(uriString);
InputStream is = uri.toURL().openStream();
try {
BufferedImage image = ImageIO.read(is);
MonochromeBitmapSource source = new BufferedImageMonochromeBitmapSource(image);
Reader reader = new QRCodeReader();
Result result = reader.decode(source);
assertEquals(expected, result.getText());
} finally {
is.close();
}
}
}