CMakeLists.txt: cmake min required 3.13 -> 3.5 using CMAKE_REQUIRED_LIBRARIES; add ZINT_COVERAGE option

bmp/emf/ps.c: allow for foreground colour in ULTRA
bmp/gif/pcx.c: allow for BARCODE_STDOUT (fflush/fclose)
emf.c: hexagon rotation field not used; dont't use float index in font loop; Windows stdout binary mode
png.c: remove unused 8-bit; simplify libpng error handling and fclose outfile on error
ps.c: fix buffer overflow on colour_to_pscolor() CMYK
tif.c: fix BLACKISZERO indexes
CODE39: simplify check digit setting
reedsol.c: rs_uint_init_gf() log/alog tables must be zeroed
ZBarcode_Encode: debug: fix access out-of-bounds on non-NUL-terminated source if length < 10
manual.txt/zint.h: document NUL-terminated strings
tests: cover further cases for output (bmp/emf/etc), eci/gb18030/gb2312/sjis, reedsol, AZTEC, CODE39
This commit is contained in:
gitlost
2021-07-26 15:29:05 +01:00
parent 059abdf6a1
commit 3f33ed3eb9
90 changed files with 3754 additions and 863 deletions

View File

@ -828,15 +828,18 @@ int testUtilSymbolCmp(const struct zint_symbol *a, const struct zint_symbol *b)
if (a->whitespace_width != b->whitespace_width) {
return 6;
}
if (a->border_width != b->border_width) {
if (a->whitespace_height != b->whitespace_height) {
return 7;
}
if (a->output_options != b->output_options) {
if (a->border_width != b->border_width) {
return 8;
}
if (a->scale != b->scale) {
if (a->output_options != b->output_options) {
return 9;
}
if (a->scale != b->scale) {
return 10;
}
return 0;
}
@ -1051,7 +1054,7 @@ int testUtilVectorCmp(const struct zint_vector *a, const struct zint_vector *b)
return 0;
}
/* Dump modules into buffer as '0'/'1' (or colours 'W', 'C', 'B' etc if Ultra) */
/* Dump modules into buffer as '0'/'1' (or colours '0', '1', '2' etc if Ultra) */
int testUtilModulesDump(const struct zint_symbol *symbol, char dump[], int dump_size) {
int r, w;
char *d = dump;
@ -2107,7 +2110,7 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "itf14", BARCODE_ITF14, 89, 0, 0, 0, 0, 0, },
{ "kix", BARCODE_KIX, 90, 0, 0, 0, 0, 0, },
{ "", -1, 91, 0, 0, 0, 0, 0, },
{ "azteccode", BARCODE_AZTEC, 92, 0, 1, 0, 0, 0, },
{ "azteccode", BARCODE_AZTEC, 92, 1, 1, 0, 0, 0, },
{ "daft", BARCODE_DAFT, 93, 0, 0, 0, 0, 0, },
{ "", -1, 94, 0, 0, 0, 0, 0, },
{ "", -1, 95, 0, 0, 0, 0, 0, },
@ -2207,6 +2210,14 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
}
return NULL;
}
} else if (symbology == BARCODE_AZTEC) {
if (option_1 > 0 && option_2 > 0) {
if (debug & ZINT_DEBUG_TEST_PRINT) {
printf("i:%d %s not BWIPP compatible, cannot specify both option_1 %d and option_2 %d\n",
index, testUtilBarcodeName(symbology), option_1, option_2);
}
return NULL;
}
}
if (linear_row_height) {