diff --git a/java/TJUnitTest.java b/java/TJUnitTest.java index 4b1a52d9..2cce93bb 100644 --- a/java/TJUnitTest.java +++ b/java/TJUnitTest.java @@ -263,8 +263,8 @@ public class TJUnitTest { throws Exception { v = (v < 0) ? v + 256 : v; if (v < cv - 1 || v > cv + 1) { - throw new Exception("\nComp. " + vname + " at " + row + "," + col + - " should be " + cv + ", not " + v + "\n"); + throw new Exception("Comp. " + vname + " at " + row + "," + col + + " should be " + cv + ", not " + v); } } @@ -272,8 +272,8 @@ public class TJUnitTest { throws Exception { v = (v < 0) ? v + 256 : v; if (v > 1) { - throw new Exception("\nComp. " + vname + " at " + row + "," + col + - " should be 0, not " + v + "\n"); + throw new Exception("Comp. " + vname + " at " + row + "," + col + + " should be 0, not " + v); } } @@ -281,8 +281,8 @@ public class TJUnitTest { throws Exception { v = (v < 0) ? v + 256 : v; if (v < 254) { - throw new Exception("\nComp. " + vname + " at " + row + "," + col + - " should be 255, not " + v + "\n"); + throw new Exception("Comp. " + vname + " at " + row + "," + col + + " should be 255, not " + v); } } @@ -344,12 +344,11 @@ public class TJUnitTest { } } } catch(Exception e) { - System.out.println(e); + System.out.println("\n" + e.getMessage()); retval = 0; } if (retval == 0) { - System.out.print("\n"); for (row = 0; row < h; row++) { for (col = 0; col < w; col++) { int r = buf[pitch * row + col * ps + roffset]; @@ -423,12 +422,11 @@ public class TJUnitTest { } } } catch(Exception e) { - System.out.println(e); + System.out.println("\n" + e.getMessage()); retval = 0; } if (retval == 0) { - System.out.print("\n"); for (row = 0; row < h; row++) { for (col = 0; col < w; col++) { int r = (buf[pitch * row + col] >> rshift) & 0xFF; @@ -490,7 +488,7 @@ public class TJUnitTest { try { if (size != correctsize) - throw new Exception("\nIncorrect size " + size + ". Should be " + + throw new Exception("Incorrect size " + size + ". Should be " + correctsize); for (row = 0; row < ph; row++) { @@ -531,7 +529,7 @@ public class TJUnitTest { } } } catch(Exception e) { - System.out.println(e); + System.out.println("\n" + e.getMessage()); retval = 0; } @@ -562,7 +560,6 @@ public class TJUnitTest { } System.out.print("\n"); } - System.out.print("\n"); } return retval; @@ -768,7 +765,6 @@ public class TJUnitTest { } else decompTest(tjd, jpegBuf, jpegSize, w, h, pf, baseName, subsamp, flags, new TJScalingFactor(1, 1)); - System.out.print("\n"); } private static void doTest(int w, int h, int[] formats, int subsamp, @@ -807,8 +803,10 @@ public class TJUnitTest { if (pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi) decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX), baseName, subsamp, flags); + System.out.print("\n"); } } + System.out.print("--------------------\n\n"); } catch(Exception e) { if (tjc != null) tjc.close(); if (tjd != null) tjd.close(); diff --git a/tjunittest.c b/tjunittest.c index 7a44b940..85ba32e8 100644 --- a/tjunittest.c +++ b/tjunittest.c @@ -221,7 +221,6 @@ int checkBuf(unsigned char *buf, int w, int h, int pf, int subsamp, bailout: if(retval==0) { - printf("\n"); for(row=0; row YUV %s ... ", subName[subsamp]); + printf("JPEG -> YUV %s ... ", subNameLong[subsamp]); else printf("JPEG -> %s %s ", pixFormatStr[pf], (flags&TJFLAG_BOTTOMUP)? "Bottom-Up":"Top-Down "); @@ -482,7 +480,7 @@ void decompTest(tjhandle handle, unsigned char *jpegBuf, sf1); bailout: - printf("\n"); + return; } @@ -524,8 +522,10 @@ void doTest(int w, int h, const int *formats, int nformats, int subsamp, if(pf>=TJPF_RGBX && pf<=TJPF_XRGB) decompTest(dhandle, dstBuf, size, w, h, pf+(TJPF_RGBA-TJPF_RGBX), basename, subsamp, flags); + printf("\n"); } } + printf("--------------------\n\n"); bailout: if(chandle) tjDestroy(chandle);