mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Let RSS tests succeed even when run from project root
git-svn-id: https://zxing.googlecode.com/svn/trunk@1883 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
d78e5280c0
commit
fa5c84a0cf
|
@ -224,7 +224,13 @@ public final class RSSExpandedImage2binaryTestCase extends Assert {
|
|||
private static void assertCorrectImage2binary(String path, String expected) throws IOException, NotFoundException {
|
||||
RSSExpandedReader rssExpandedReader = new RSSExpandedReader();
|
||||
|
||||
BufferedImage image = ImageIO.read(new File(path));
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
// Support running from project root too
|
||||
file = new File("core", path);
|
||||
}
|
||||
|
||||
BufferedImage image = ImageIO.read(file);
|
||||
BinaryBitmap binaryMap = new BinaryBitmap(new GlobalHistogramBinarizer(new BufferedImageLuminanceSource(image)));
|
||||
int rowNumber = binaryMap.getHeight() / 2;
|
||||
BitArray row = binaryMap.getBlackRow(rowNumber, null);
|
||||
|
|
|
@ -72,7 +72,13 @@ public final class RSSExpandedImage2resultTestCase extends Assert {
|
|||
throws IOException, NotFoundException {
|
||||
RSSExpandedReader rssExpandedReader = new RSSExpandedReader();
|
||||
|
||||
BufferedImage image = ImageIO.read(new File(path));
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
// Support running from project root too
|
||||
file = new File("core", path);
|
||||
}
|
||||
|
||||
BufferedImage image = ImageIO.read(file);
|
||||
BinaryBitmap binaryMap = new BinaryBitmap(new GlobalHistogramBinarizer(new BufferedImageLuminanceSource(image)));
|
||||
int rowNumber = binaryMap.getHeight() / 2;
|
||||
BitArray row = binaryMap.getBlackRow(rowNumber, null);
|
||||
|
|
|
@ -268,7 +268,13 @@ public final class RSSExpandedImage2stringTestCase extends Assert {
|
|||
private static void assertCorrectImage2string(String path, String expected) throws IOException, NotFoundException {
|
||||
RSSExpandedReader rssExpandedReader = new RSSExpandedReader();
|
||||
|
||||
BufferedImage image = ImageIO.read(new File(path));
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
// Support running from project root too
|
||||
file = new File("core", path);
|
||||
}
|
||||
|
||||
BufferedImage image = ImageIO.read(file);
|
||||
BinaryBitmap binaryMap = new BinaryBitmap(new GlobalHistogramBinarizer(new BufferedImageLuminanceSource(image)));
|
||||
int rowNumber = binaryMap.getHeight() / 2;
|
||||
BitArray row = binaryMap.getBlackRow(rowNumber, null);
|
||||
|
|
|
@ -54,7 +54,13 @@ public final class RSSExpandedInternalTestCase extends Assert {
|
|||
RSSExpandedReader rssExpandedReader = new RSSExpandedReader();
|
||||
|
||||
String path = "test/data/blackbox/rssexpanded-1/2.jpg";
|
||||
BufferedImage image = ImageIO.read(new File(path));
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
// Support running from project root too
|
||||
file = new File("core", path);
|
||||
}
|
||||
|
||||
BufferedImage image = ImageIO.read(file);
|
||||
BinaryBitmap binaryMap = new BinaryBitmap(new GlobalHistogramBinarizer(new BufferedImageLuminanceSource(image)));
|
||||
int rowNumber = binaryMap.getHeight() / 2;
|
||||
BitArray row = binaryMap.getBlackRow(rowNumber, null);
|
||||
|
@ -89,7 +95,13 @@ public final class RSSExpandedInternalTestCase extends Assert {
|
|||
RSSExpandedReader rssExpandedReader = new RSSExpandedReader();
|
||||
|
||||
String path = "test/data/blackbox/rssexpanded-1/3.jpg";
|
||||
BufferedImage image = ImageIO.read(new File(path));
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
// Support running from project root too
|
||||
file = new File("core", path);
|
||||
}
|
||||
|
||||
BufferedImage image = ImageIO.read(file);
|
||||
BinaryBitmap binaryMap = new BinaryBitmap(new GlobalHistogramBinarizer(new BufferedImageLuminanceSource(image)));
|
||||
int rowNumber = binaryMap.getHeight() / 2;
|
||||
BitArray row = binaryMap.getBlackRow(rowNumber, null);
|
||||
|
@ -111,7 +123,13 @@ public final class RSSExpandedInternalTestCase extends Assert {
|
|||
RSSExpandedReader rssExpandedReader = new RSSExpandedReader();
|
||||
|
||||
String path = "test/data/blackbox/rssexpanded-1/3.jpg";
|
||||
BufferedImage image = ImageIO.read(new File(path));
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
// Support running from project root too
|
||||
file = new File("core", path);
|
||||
}
|
||||
|
||||
BufferedImage image = ImageIO.read(file);
|
||||
BinaryBitmap binaryMap = new BinaryBitmap(new GlobalHistogramBinarizer(new BufferedImageLuminanceSource(image)));
|
||||
BitArray row = binaryMap.getBlackRow(binaryMap.getHeight() / 2, null);
|
||||
|
||||
|
@ -129,7 +147,13 @@ public final class RSSExpandedInternalTestCase extends Assert {
|
|||
RSSExpandedReader rssExpandedReader = new RSSExpandedReader();
|
||||
|
||||
String path = "test/data/blackbox/rssexpanded-1/3.jpg";
|
||||
BufferedImage image = ImageIO.read(new File(path));
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
// Support running from project root too
|
||||
file = new File("core", path);
|
||||
}
|
||||
|
||||
BufferedImage image = ImageIO.read(file);
|
||||
BinaryBitmap binaryMap = new BinaryBitmap(new GlobalHistogramBinarizer(new BufferedImageLuminanceSource(image)));
|
||||
BitArray row = binaryMap.getBlackRow(binaryMap.getHeight() / 2, null);
|
||||
|
||||
|
|
Loading…
Reference in a new issue