in java/TJUnitTest.java [899:946]
static void overflowTest() throws Exception {
/* Ensure that the various buffer size methods don't overflow */
int size = 0;
boolean exception = false;
try {
exception = false;
size = TJ.bufSize(18919, 18919, TJ.SAMP_444);
} catch (Exception e) { exception = true; }
if (!exception || size != 0)
throw new Exception("TJ.bufSize() overflow");
try {
exception = false;
size = TJ.bufSizeYUV(26755, 1, 26755, TJ.SAMP_444);
} catch (Exception e) { exception = true; }
if (!exception || size != 0)
throw new Exception("TJ.bufSizeYUV() overflow");
try {
exception = false;
size = TJ.bufSizeYUV(26754, 3, 26754, TJ.SAMP_444);
} catch (Exception e) { exception = true; }
if (!exception || size != 0)
throw new Exception("TJ.bufSizeYUV() overflow");
try {
exception = false;
size = TJ.bufSizeYUV(26754, -1, 26754, TJ.SAMP_444);
} catch (Exception e) { exception = true; }
if (!exception || size != 0)
throw new Exception("TJ.bufSizeYUV() overflow");
try {
exception = false;
size = TJ.planeSizeYUV(0, 46341, 0, 46341, TJ.SAMP_444);
} catch (Exception e) { exception = true; }
if (!exception || size != 0)
throw new Exception("TJ.planeSizeYUV() overflow");
try {
exception = false;
size = TJ.planeWidth(0, Integer.MAX_VALUE, TJ.SAMP_420);
} catch (Exception e) { exception = true; }
if (!exception || size != 0)
throw new Exception("TJ.planeWidth() overflow");
try {
exception = false;
size = TJ.planeHeight(0, Integer.MAX_VALUE, TJ.SAMP_420);
} catch (Exception e) { exception = true; }
if (!exception || size != 0)
throw new Exception("TJ.planeHeight() overflow");
}