Clean up the output of tjunittest and TJUnitTest
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@980 632fc199-4ca6-4c93-a231-07263d6284db
diff --git a/java/TJUnitTest.java b/java/TJUnitTest.java
index d0a609a..ed67100 100644
--- a/java/TJUnitTest.java
+++ b/java/TJUnitTest.java
@@ -260,8 +260,8 @@
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);
}
}
@@ -269,8 +269,8 @@
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);
}
}
@@ -278,8 +278,8 @@
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);
}
}
@@ -341,12 +341,11 @@
}
}
} 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];
@@ -420,12 +419,11 @@
}
}
} 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;
@@ -485,7 +483,7 @@
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++) {
@@ -526,7 +524,7 @@
}
}
} catch(Exception e) {
- System.out.println(e);
+ System.out.println("\n" + e.getMessage());
retval = 0;
}
@@ -557,7 +555,6 @@
}
System.out.print("\n");
}
- System.out.print("\n");
}
return retval;
@@ -680,7 +677,7 @@
System.out.print("JPEG -> ");
if (yuv == YUVDECODE)
- System.out.print("YUV " + subName[subsamp] + " ... ");
+ System.out.print("YUV " + subNameLong[subsamp] + " ... ");
else {
System.out.print(pfStr + " ");
if (bi)
@@ -760,7 +757,6 @@
} 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,
@@ -799,8 +795,10 @@
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 89a6d1d..6f23b23 100644
--- a/tjunittest.c
+++ b/tjunittest.c
@@ -219,7 +219,6 @@
bailout:
if(retval==0)
{
- printf("\n");
for(row=0; row<h; row++)
{
for(col=0; col<w; col++)
@@ -312,7 +311,6 @@
printf("%.3d ", buf[ypitch*ph + uvpitch*ch + (uvpitch*row+col)]);
printf("\n");
}
- printf("\n");
}
return retval;
@@ -405,7 +403,7 @@
if(yuv==YUVENCODE) return;
if(yuv==YUVDECODE)
- printf("JPEG -> YUV %s ... ", subName[subsamp]);
+ printf("JPEG -> YUV %s ... ", subNameLong[subsamp]);
else
{
printf("JPEG -> %s %s ", pixFormatStr[pf],
@@ -475,7 +473,7 @@
sf1);
bailout:
- printf("\n");
+ return;
}
@@ -517,8 +515,10 @@
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);