mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
fix javadoc for PDF417#determineDimensions
remove stacktrace when UT fails
This commit is contained in:
parent
a5f66f0a17
commit
068f67c529
|
@ -693,12 +693,12 @@ public final class PDF417 {
|
|||
* Determine optimal nr of columns and rows for the specified number of
|
||||
* codewords.
|
||||
*
|
||||
* @param sourceCodeWords number of code words
|
||||
* @param errorCorrectionCodeWords number of error correction code words
|
||||
* @param minCols minimum number of columns
|
||||
* @param maxCols maximum number of columns
|
||||
* @param minRows minimum number of rows
|
||||
* @param maxRows maximum number of rows
|
||||
* @param sourceCodeWords number of code words
|
||||
* @param errorCorrectionCodeWords number of error correction code words
|
||||
* @return dimension object containing cols as width and rows as height
|
||||
* @throws WriterException when dimensions can't be determined
|
||||
*/
|
||||
|
|
|
@ -181,21 +181,18 @@ public final class PDF417EncoderTestCase extends Assert {
|
|||
public static void testDimensions(String input, Dimensions dimensions) throws Exception {
|
||||
int sourceCodeWords = 20;
|
||||
int errorCorrectionCodeWords = 8;
|
||||
try {
|
||||
int[] calculated = PDF417.determineDimensions(dimensions.getMinCols(), dimensions.getMaxCols(),
|
||||
|
||||
int[] calculated = PDF417.determineDimensions(dimensions.getMinCols(), dimensions.getMaxCols(),
|
||||
dimensions.getMinRows(), dimensions.getMaxRows(),
|
||||
sourceCodeWords, errorCorrectionCodeWords);
|
||||
assertNotNull(calculated);
|
||||
assertEquals(2,calculated.length);
|
||||
assertTrue(dimensions.getMinCols() <= calculated[0]);
|
||||
assertTrue(dimensions.getMaxCols() >= calculated[0]);
|
||||
assertTrue(dimensions.getMinRows() <= calculated[1]);
|
||||
assertTrue(dimensions.getMaxRows() >= calculated[1]);
|
||||
assertNotNull(generatePDF417BitMatrix(input, 371, null, dimensions));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
|
||||
assertNotNull(calculated);
|
||||
assertEquals(2,calculated.length);
|
||||
assertTrue(dimensions.getMinCols() <= calculated[0]);
|
||||
assertTrue(dimensions.getMaxCols() >= calculated[0]);
|
||||
assertTrue(dimensions.getMinRows() <= calculated[1]);
|
||||
assertTrue(dimensions.getMaxRows() >= calculated[1]);
|
||||
assertNotNull(generatePDF417BitMatrix(input, 371, null, dimensions));
|
||||
}
|
||||
|
||||
public static BitMatrix generatePDF417BitMatrix(final String barcodeText, final int width,
|
||||
|
|
Loading…
Reference in a new issue