From 3fe141196cc2b21a252d4c05ff2cdb9dceb47541 Mon Sep 17 00:00:00 2001 From: "srowen@gmail.com" Date: Fri, 26 Apr 2013 13:00:47 +0000 Subject: [PATCH] Add warning about test text files that may have a spurious newline git-svn-id: https://zxing.googlecode.com/svn/trunk@2692 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../com/google/zxing/common/AbstractBlackBoxTestCase.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java index 452a3087f..1796cce15 100644 --- a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java +++ b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java @@ -308,7 +308,12 @@ public abstract class AbstractBlackBoxTestCase extends Assert { } finally { reader.close(); } - return result.toString(); + String stringContents = result.toString(); + if (stringContents.endsWith("\n")) { + log.warning("String contents of file " + file + " end with a newline. " + + "This may not be intended and cause a test failure"); + } + return stringContents; } protected static BufferedImage rotateImage(BufferedImage original, float degrees) {