From 0dfda0807876a53be295fa0abafd53866edf13bd Mon Sep 17 00:00:00 2001 From: Sean Owen Date: Tue, 29 Nov 2016 12:16:07 +0000 Subject: Fix typos; avoid use of java.util.Date; other small improvements from inspection; deprecate some accidentally-public methods --- .../zxing/client/result/CalendarParsedResultTestCase.java | 4 ++-- .../java/com/google/zxing/common/AbstractBlackBoxTestCase.java | 10 +++++----- .../google/zxing/common/AbstractNegativeBlackBoxTestCase.java | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'core/src/test/java/com') diff --git a/core/src/test/java/com/google/zxing/client/result/CalendarParsedResultTestCase.java b/core/src/test/java/com/google/zxing/client/result/CalendarParsedResultTestCase.java index 4e53bbafe..e81f10979 100644 --- a/core/src/test/java/com/google/zxing/client/result/CalendarParsedResultTestCase.java +++ b/core/src/test/java/com/google/zxing/client/result/CalendarParsedResultTestCase.java @@ -231,8 +231,8 @@ public final class CalendarParsedResultTestCase extends Assert { assertEquals(summary, calResult.getSummary()); assertEquals(location, calResult.getLocation()); DateFormat dateFormat = makeGMTFormat(); - assertEquals(startString, dateFormat.format(calResult.getStart())); - assertEquals(endString, calResult.getEnd() == null ? null : dateFormat.format(calResult.getEnd())); + assertEquals(startString, dateFormat.format(calResult.getStartTimestamp())); + assertEquals(endString, calResult.getEndTimestamp() < 0L ? null : dateFormat.format(calResult.getEndTimestamp())); assertEquals(organizer, calResult.getOrganizer()); assertArrayEquals(attendees, calResult.getAttendees()); assertEqualOrNaN(latitude, calResult.getLatitude()); diff --git a/core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java b/core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java index d1a0eb5d4..c5129ee9c 100644 --- a/core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java +++ b/core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java @@ -141,7 +141,7 @@ public abstract class AbstractBlackBoxTestCase extends Assert { int[] passedCounts = new int[testCount]; int[] misreadCounts = new int[testCount]; int[] tryHarderCounts = new int[testCount]; - int[] tryHaderMisreadCounts = new int[testCount]; + int[] tryHarderMisreadCounts = new int[testCount]; for (Path testImage : imageFiles) { log.info(String.format("Starting %s", testImage)); @@ -186,7 +186,7 @@ public abstract class AbstractBlackBoxTestCase extends Assert { if (decode(bitmap, rotation, expectedText, expectedMetadata, true)) { tryHarderCounts[x]++; } else { - tryHaderMisreadCounts[x]++; + tryHarderMisreadCounts[x]++; } } catch (ReaderException ignored) { log.fine(String.format("could not read at rotation %f w/TH", rotation)); @@ -212,10 +212,10 @@ public abstract class AbstractBlackBoxTestCase extends Assert { tryHarderCounts[x], imageFiles.size(), testResult.getTryHarderCount())); failed = imageFiles.size() - tryHarderCounts[x]; log.info(String.format(" %d failed due to misreads, %d not detected", - tryHaderMisreadCounts[x], failed - tryHaderMisreadCounts[x])); + tryHarderMisreadCounts[x], failed - tryHarderMisreadCounts[x])); totalFound += passedCounts[x] + tryHarderCounts[x]; totalMustPass += testResult.getMustPassCount() + testResult.getTryHarderCount(); - totalMisread += misreadCounts[x] + tryHaderMisreadCounts[x]; + totalMisread += misreadCounts[x] + tryHarderMisreadCounts[x]; totalMaxMisread += testResult.getMaxMisreads() + testResult.getMaxTryHarderMisreads(); } @@ -247,7 +247,7 @@ public abstract class AbstractBlackBoxTestCase extends Assert { assertTrue(label, misreadCounts[x] <= testResult.getMaxMisreads()); assertTrue("Try harder, " + label, - tryHaderMisreadCounts[x] <= testResult.getMaxTryHarderMisreads()); + tryHarderMisreadCounts[x] <= testResult.getMaxTryHarderMisreads()); } } } diff --git a/core/src/test/java/com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java b/core/src/test/java/com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java index 3ce4e7c19..0f258519a 100644 --- a/core/src/test/java/com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java +++ b/core/src/test/java/com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java @@ -126,7 +126,7 @@ public abstract class AbstractNegativeBlackBoxTestCase extends AbstractBlackBoxT * * @param image The image to test * @param rotationInDegrees The amount of rotation to apply - * @return true if nothing found, false if a non-existant barcode was detected + * @return true if nothing found, false if a non-existent barcode was detected */ private boolean checkForFalsePositives(BufferedImage image, float rotationInDegrees) { BufferedImage rotatedImage = rotateImage(image, rotationInDegrees); -- cgit v1.2.3