Clean up the output of tjunittest and TJUnitTest

This commit is contained in:
DRC
2013-05-04 23:41:33 +00:00
parent cd5c8559d6
commit 6586b254ee
2 changed files with 16 additions and 18 deletions

View File

@@ -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();

View File

@@ -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<h; row++)
{
for(col=0; col<w; col++)
@@ -316,7 +315,6 @@ int checkBufYUV(unsigned char *buf, int w, int h, int subsamp,
printf("%.3d ", buf[ypitch*ph + uvpitch*ch + (uvpitch*row+col)]);
printf("\n");
}
printf("\n");
}
return retval;
@@ -411,7 +409,7 @@ void _decompTest(tjhandle handle, unsigned char *jpegBuf,
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],
(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);