mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
test suite: update to latest BWIPP (add dontlint, rebase patch file)
common.h: remove TRUE/FALSE (barely used) test suite: gs1: proper val for longitude test; some comments // -> /*
This commit is contained in:
parent
799503f0ef
commit
78bda3b359
@ -137,12 +137,12 @@ INTERNAL void c128_dxsmooth(int list[2][C128_MAX], int *indexliste) {
|
|||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
last = list[1][i - 1];
|
last = list[1][i - 1];
|
||||||
} else {
|
} else {
|
||||||
last = FALSE;
|
last = 0;
|
||||||
}
|
}
|
||||||
if (i != *(indexliste) - 1) {
|
if (i != *(indexliste) - 1) {
|
||||||
next = list[1][i + 1];
|
next = list[1][i + 1];
|
||||||
} else {
|
} else {
|
||||||
next = FALSE;
|
next = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0) { /* first block */
|
if (i == 0) { /* first block */
|
||||||
|
@ -33,14 +33,6 @@
|
|||||||
#ifndef Z_COMMON_H
|
#ifndef Z_COMMON_H
|
||||||
#define Z_COMMON_H
|
#define Z_COMMON_H
|
||||||
|
|
||||||
#ifndef FALSE
|
|
||||||
#define FALSE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef TRUE
|
|
||||||
#define TRUE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
#define ARRAY_SIZE(x) ((int) (sizeof(x) / sizeof((x)[0])))
|
#define ARRAY_SIZE(x) ((int) (sizeof(x) / sizeof((x)[0])))
|
||||||
#endif
|
#endif
|
||||||
|
@ -144,12 +144,12 @@ static void pdf_smooth(int liste[2][PDF_MAX_LEN], int *indexliste) {
|
|||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
last = liste[1][i - 1];
|
last = liste[1][i - 1];
|
||||||
} else {
|
} else {
|
||||||
last = FALSE;
|
last = 0;
|
||||||
}
|
}
|
||||||
if (i != *(indexliste) - 1) {
|
if (i != *(indexliste) - 1) {
|
||||||
next = liste[1][i + 1];
|
next = liste[1][i + 1];
|
||||||
} else {
|
} else {
|
||||||
next = FALSE;
|
next = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crnt == NUM) {
|
if (crnt == NUM) {
|
||||||
@ -194,12 +194,12 @@ static void pdf_smooth(int liste[2][PDF_MAX_LEN], int *indexliste) {
|
|||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
last = liste[1][i - 1];
|
last = liste[1][i - 1];
|
||||||
} else {
|
} else {
|
||||||
last = FALSE;
|
last = 0;
|
||||||
}
|
}
|
||||||
if (i != *(indexliste) - 1) {
|
if (i != *(indexliste) - 1) {
|
||||||
next = liste[1][i + 1];
|
next = liste[1][i + 1];
|
||||||
} else {
|
} else {
|
||||||
next = FALSE;
|
next = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((crnt == TEX) && (i > 0)) {
|
if ((crnt == TEX) && (i > 0)) {
|
||||||
|
@ -167,6 +167,7 @@ static int big5_utf8(struct zint_symbol *symbol, const unsigned char source[], i
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_big5_utf8(int index) {
|
static void test_big5_utf8(int index) {
|
||||||
|
|
||||||
struct item {
|
struct item {
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#include "testcommon.h"
|
#include "testcommon.h"
|
||||||
|
|
||||||
@ -35,10 +36,10 @@ static int is_sane_orig(const char test_string[], const unsigned char source[],
|
|||||||
int i, j, lt = (int) strlen(test_string);
|
int i, j, lt = (int) strlen(test_string);
|
||||||
|
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
unsigned int latch = FALSE;
|
unsigned int latch = 0;
|
||||||
for (j = 0; j < lt; j++) {
|
for (j = 0; j < lt; j++) {
|
||||||
if (source[i] == test_string[j]) {
|
if (source[i] == test_string[j]) {
|
||||||
latch = TRUE;
|
latch = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,7 +61,7 @@ static void test_is_sane(int index) {
|
|||||||
|
|
||||||
char *orig_test;
|
char *orig_test;
|
||||||
};
|
};
|
||||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { IS_SPC_F, " ", -1, 1, " " },
|
/* 0*/ { IS_SPC_F, " ", -1, 1, " " },
|
||||||
/* 1*/ { IS_SPC_F, "\000", 1, 0, " " },
|
/* 1*/ { IS_SPC_F, "\000", 1, 0, " " },
|
||||||
@ -72,7 +73,7 @@ static void test_is_sane(int index) {
|
|||||||
/* 7*/ { IS_PLS_F, " ", -1, 0, "+" },
|
/* 7*/ { IS_PLS_F, " ", -1, 0, "+" },
|
||||||
/* 8*/ { IS_MNS_F, "-", -1, 1, "-" },
|
/* 8*/ { IS_MNS_F, "-", -1, 1, "-" },
|
||||||
/* 9*/ { IS_MNS_F, " ", -1, 0, "-" },
|
/* 9*/ { IS_MNS_F, " ", -1, 0, "-" },
|
||||||
/* 10*/ { IS_NUM_F, "0123456789", -1, 1, "0123456789" }, // NEON
|
/* 10*/ { IS_NUM_F, "0123456789", -1, 1, "0123456789" }, /* NEON */
|
||||||
/* 11*/ { IS_NUM_F, "0123456789 ", -1, 0, "0123456789" },
|
/* 11*/ { IS_NUM_F, "0123456789 ", -1, 0, "0123456789" },
|
||||||
/* 12*/ { IS_NUM_F, "012345678A9", -1, 0, "0123456789" },
|
/* 12*/ { IS_NUM_F, "012345678A9", -1, 0, "0123456789" },
|
||||||
/* 13*/ { IS_UPO_F, "GHIJKLMNOPQRSTUVWYZ", -1, 1, "GHIJKLMNOPQRSTUVWYZ" },
|
/* 13*/ { IS_UPO_F, "GHIJKLMNOPQRSTUVWYZ", -1, 1, "GHIJKLMNOPQRSTUVWYZ" },
|
||||||
@ -95,57 +96,57 @@ static void test_is_sane(int index) {
|
|||||||
/* 30*/ { IS_UX__F, "x", -1, 0, "X" },
|
/* 30*/ { IS_UX__F, "x", -1, 0, "X" },
|
||||||
/* 31*/ { IS_LX__F, "x", -1, 1, "x" },
|
/* 31*/ { IS_LX__F, "x", -1, 1, "x" },
|
||||||
/* 32*/ { IS_LX__F, "X", -1, 0, "x" },
|
/* 32*/ { IS_LX__F, "X", -1, 0, "x" },
|
||||||
/* 33*/ { IS_C82_F, "!\"%&'(),./:;<=>?_", -1, 1, "!\"%&'(),./:;<=>?_" }, // CSET82 punctuation less "*+-"
|
/* 33*/ { IS_C82_F, "!\"%&'(),./:;<=>?_", -1, 1, "!\"%&'(),./:;<=>?_" }, /* CSET82 punctuation less "*+-" */
|
||||||
/* 34*/ { IS_C82_F, "!\"%&'(),./:;<=>?_ ", -1, 0, "!\"%&'(),./:;<=>?_" },
|
/* 34*/ { IS_C82_F, "!\"%&'(),./:;<=>?_ ", -1, 0, "!\"%&'(),./:;<=>?_" },
|
||||||
/* 35*/ { IS_C82_F, "-", -1, 0, "!\"%&'(),./:;<=>?_" },
|
/* 35*/ { IS_C82_F, "-", -1, 0, "!\"%&'(),./:;<=>?_" },
|
||||||
/* 36*/ { IS_C82_F, "$", -1, 0, "!\"%&'(),./:;<=>?_" },
|
/* 36*/ { IS_C82_F, "$", -1, 0, "!\"%&'(),./:;<=>?_" },
|
||||||
/* 37*/ { IS_SIL_F, ".$/%", -1, 1, ".$/%" }, // SILVER punctuation less " +-"
|
/* 37*/ { IS_SIL_F, ".$/%", -1, 1, ".$/%" }, /* SILVER punctuation less " +-" */
|
||||||
/* 38*/ { IS_SIL_F, ".$/% " , -1, 0, ".$/%" },
|
/* 38*/ { IS_SIL_F, ".$/% " , -1, 0, ".$/%" },
|
||||||
/* 39*/ { IS_SIL_F, "-", -1, 0, ".$/%" },
|
/* 39*/ { IS_SIL_F, "-", -1, 0, ".$/%" },
|
||||||
/* 40*/ { IS_CLI_F, "$:/.", -1, 1, "$:/." }, // CALCIUM INNER punctuation less "+-"
|
/* 40*/ { IS_CLI_F, "$:/.", -1, 1, "$:/." }, /* CALCIUM INNER punctuation less "+-" */
|
||||||
/* 41*/ { IS_CLI_F, "$:/. ", -1, 0, "$:/." },
|
/* 41*/ { IS_CLI_F, "$:/. ", -1, 0, "$:/." },
|
||||||
/* 42*/ { IS_CLI_F, "+", -1, 0, "$:/." },
|
/* 42*/ { IS_CLI_F, "+", -1, 0, "$:/." },
|
||||||
/* 43*/ { IS_ARS_F, "ABCDEFGHJKLMNPRSTUVWXYZ", -1, 1, "ABCDEFGHJKLMNPRSTUVWXYZ" }, // ARSENIC uppercase
|
/* 43*/ { IS_ARS_F, "ABCDEFGHJKLMNPRSTUVWXYZ", -1, 1, "ABCDEFGHJKLMNPRSTUVWXYZ" }, /* ARSENIC uppercase */
|
||||||
/* 44*/ { IS_ARS_F, "ABCDEFGHJKLMNPRSTUVWXYZ ", -1, 0, "ABCDEFGHJKLMNPRSTUVWXYZ" },
|
/* 44*/ { IS_ARS_F, "ABCDEFGHJKLMNPRSTUVWXYZ ", -1, 0, "ABCDEFGHJKLMNPRSTUVWXYZ" },
|
||||||
/* 45*/ { IS_ARS_F, "I", -1, 0, "ABCDEFGHJKLMNPRSTUVWXYZ" },
|
/* 45*/ { IS_ARS_F, "I", -1, 0, "ABCDEFGHJKLMNPRSTUVWXYZ" },
|
||||||
/* 46*/ { IS_ARS_F, "O", -1, 0, "ABCDEFGHJKLMNPRSTUVWXYZ" },
|
/* 46*/ { IS_ARS_F, "O", -1, 0, "ABCDEFGHJKLMNPRSTUVWXYZ" },
|
||||||
/* 47*/ { IS_NUM_F | IS_UHX_F, "0123456789ABCDEF", -1, 1, "0123456789ABCDEF" }, // SSET
|
/* 47*/ { IS_NUM_F | IS_UHX_F, "0123456789ABCDEF", -1, 1, "0123456789ABCDEF" }, /* SSET */
|
||||||
/* 48*/ { IS_NUM_F | IS_UHX_F, "0123456789ABCDEf", -1, 0, "0123456789ABCDEF" },
|
/* 48*/ { IS_NUM_F | IS_UHX_F, "0123456789ABCDEf", -1, 0, "0123456789ABCDEF" },
|
||||||
/* 49*/ { IS_NUM_F | IS_PLS_F, "0123456789+", -1, 1, "0123456789+" }, // SODIUM_PLS
|
/* 49*/ { IS_NUM_F | IS_PLS_F, "0123456789+", -1, 1, "0123456789+" }, /* SODIUM_PLS */
|
||||||
/* 50*/ { IS_NUM_F | IS_PLS_F, "0123456789+-", -1, 0, "0123456789+" },
|
/* 50*/ { IS_NUM_F | IS_PLS_F, "0123456789+-", -1, 0, "0123456789+" },
|
||||||
/* 51*/ { IS_NUM_F | IS_UX__F, "0123456789X", -1, 1, "0123456789X" }, // ISBNX_SANE
|
/* 51*/ { IS_NUM_F | IS_UX__F, "0123456789X", -1, 1, "0123456789X" }, /* ISBNX_SANE */
|
||||||
/* 52*/ { IS_NUM_F | IS_UX__F, "0123456789x", -1, 0, "0123456789X" },
|
/* 52*/ { IS_NUM_F | IS_UX__F, "0123456789x", -1, 0, "0123456789X" },
|
||||||
/* 53*/ { IS_NUM_F | IS_UX__F | IS_LX__F | IS_PLS_F, "0123456789Xx+", -1, 1, "0123456789Xx+" }, // ISBNX_ADDON_SANE
|
/* 53*/ { IS_NUM_F | IS_UX__F | IS_LX__F | IS_PLS_F, "0123456789Xx+", -1, 1, "0123456789Xx+" }, /* ISBNX_ADDON_SANE */
|
||||||
/* 54*/ { IS_NUM_F | IS_UX__F | IS_LX__F | IS_PLS_F, "0123456789Xx+Y", -1, 0, "0123456789Xx+" },
|
/* 54*/ { IS_NUM_F | IS_UX__F | IS_LX__F | IS_PLS_F, "0123456789Xx+Y", -1, 0, "0123456789Xx+" },
|
||||||
/* 55*/ { IS_NUM_F | IS_MNS_F, "0123456789-", -1, 1, "0123456789-" }, // SODIUM_MNS
|
/* 55*/ { IS_NUM_F | IS_MNS_F, "0123456789-", -1, 1, "0123456789-" }, /* SODIUM_MNS */
|
||||||
/* 56*/ { IS_NUM_F | IS_MNS_F, "0123456789-+", -1, 0, "0123456789-" },
|
/* 56*/ { IS_NUM_F | IS_MNS_F, "0123456789-+", -1, 0, "0123456789-" },
|
||||||
/* 57*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", -1, 1, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" }, // CSET82
|
/* 57*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", -1, 1, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" }, /* CSET82 */
|
||||||
/* 58*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, " ", -1, 0, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" },
|
/* 58*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, " ", -1, 0, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" },
|
||||||
/* 59*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, "#", -1, 0, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" },
|
/* 59*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, "#", -1, 0, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" },
|
||||||
/* 60*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, "$", -1, 0, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" },
|
/* 60*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, "$", -1, 0, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" },
|
||||||
/* 61*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, "@", -1, 0, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" },
|
/* 61*/ { IS_C82_F | IS_AST_F | IS_MNS_F | IS_PLS_F | IS_NUM_F | IS_UPR_F | IS_LWR_F, "@", -1, 0, "!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" },
|
||||||
/* 62*/ { IS_LWR_F | IS_C82_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SPC_F, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ ", -1, 1, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ " }, // IS_ISOIEC_F
|
/* 62*/ { IS_LWR_F | IS_C82_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SPC_F, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ ", -1, 1, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ " }, /* IS_ISOIEC_F */
|
||||||
/* 63*/ { IS_LWR_F | IS_C82_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SPC_F, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ #", -1, 0, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ " },
|
/* 63*/ { IS_LWR_F | IS_C82_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SPC_F, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ #", -1, 0, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ " },
|
||||||
/* 64*/ { IS_LWR_F | IS_C82_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SPC_F, "$", -1, 0, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ " },
|
/* 64*/ { IS_LWR_F | IS_C82_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SPC_F, "$", -1, 0, "abcdefghijklmnopqrstuvwxyz!\"%&'()*+,-./:;<=>?_ " },
|
||||||
/* 65*/ { IS_MNS_F | IS_SIL_F | IS_SPC_F | IS_PLS_F, "-. $/+%", -1, 1, "" },
|
/* 65*/ { IS_MNS_F | IS_SIL_F | IS_SPC_F | IS_PLS_F, "-. $/+%", -1, 1, "" },
|
||||||
/* 66*/ { IS_MNS_F | IS_SIL_F | IS_SPC_F | IS_PLS_F, "-. $/!+%", -1, 0, "" },
|
/* 66*/ { IS_MNS_F | IS_SIL_F | IS_SPC_F | IS_PLS_F, "-. $/!+%", -1, 0, "" },
|
||||||
/* 67*/ { IS_NUM_F | IS_UPR_F | IS_MNS_F | IS_SIL_F | IS_SPC_F | IS_PLS_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%", -1, 1, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%" }, // SILVER
|
/* 67*/ { IS_NUM_F | IS_UPR_F | IS_MNS_F | IS_SIL_F | IS_SPC_F | IS_PLS_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%", -1, 1, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%" }, /* SILVER */
|
||||||
/* 68*/ { IS_NUM_F | IS_UPR_F | IS_MNS_F | IS_SIL_F | IS_SPC_F | IS_PLS_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%a", -1, 0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%" },
|
/* 68*/ { IS_NUM_F | IS_UPR_F | IS_MNS_F | IS_SIL_F | IS_SPC_F | IS_PLS_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%a", -1, 0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%" },
|
||||||
/* 69*/ { IS_NUM_F | IS_ARS_F, "0123456789ABCDEFGHJKLMNPRSTUVWXYZ", -1, 1, "0123456789ABCDEFGHJKLMNPRSTUVWXYZ" }, // ARSENIC
|
/* 69*/ { IS_NUM_F | IS_ARS_F, "0123456789ABCDEFGHJKLMNPRSTUVWXYZ", -1, 1, "0123456789ABCDEFGHJKLMNPRSTUVWXYZ" }, /* ARSENIC */
|
||||||
/* 70*/ { IS_NUM_F | IS_ARS_F, "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ", -1, 0, "0123456789ABCDEFGHJKLMNPRSTUVWXYZ" },
|
/* 70*/ { IS_NUM_F | IS_ARS_F, "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ", -1, 0, "0123456789ABCDEFGHJKLMNPRSTUVWXYZ" },
|
||||||
/* 71*/ { IS_NUM_F | IS_ARS_F, "0123456789ABCDEFGHJKLMNPRSTUVWXYz", -1, 0, "0123456789ABCDEFGHJKLMNPRSTUVWXYZ" },
|
/* 71*/ { IS_NUM_F | IS_ARS_F, "0123456789ABCDEFGHJKLMNPRSTUVWXYz", -1, 0, "0123456789ABCDEFGHJKLMNPRSTUVWXYZ" },
|
||||||
/* 72*/ { IS_NUM_F | IS_UPR_F | IS_LWR_F | IS_SPC_F | IS_HSH_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #", -1, 1, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #" }, // GDSET
|
/* 72*/ { IS_NUM_F | IS_UPR_F | IS_LWR_F | IS_SPC_F | IS_HSH_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #", -1, 1, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #" }, /* GDSET */
|
||||||
/* 73*/ { IS_NUM_F | IS_UPR_F | IS_LWR_F | IS_SPC_F | IS_HSH_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #!", -1, 0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #" },
|
/* 73*/ { IS_NUM_F | IS_UPR_F | IS_LWR_F | IS_SPC_F | IS_HSH_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #!", -1, 0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz #" },
|
||||||
/* 74*/ { IS_NUM_F | IS_MNS_F | IS_CLI_F | IS_PLS_F, "0123456789-$:/.+", -1, 1, "0123456789-$:/.+" }, // CALCIUM_INNER
|
/* 74*/ { IS_NUM_F | IS_MNS_F | IS_CLI_F | IS_PLS_F, "0123456789-$:/.+", -1, 1, "0123456789-$:/.+" }, /* CALCIUM_INNER */
|
||||||
/* 75*/ { IS_NUM_F | IS_MNS_F | IS_CLI_F | IS_PLS_F, "0123456789-$:/.+ ", -1, 0, "0123456789-$:/.+" },
|
/* 75*/ { IS_NUM_F | IS_MNS_F | IS_CLI_F | IS_PLS_F, "0123456789-$:/.+ ", -1, 0, "0123456789-$:/.+" },
|
||||||
/* 76*/ { IS_NUM_F | IS_MNS_F | IS_CLI_F | IS_PLS_F, "0123456789-$:/.+!", -1, 0, "0123456789-$:/.+" },
|
/* 76*/ { IS_NUM_F | IS_MNS_F | IS_CLI_F | IS_PLS_F, "0123456789-$:/.+!", -1, 0, "0123456789-$:/.+" },
|
||||||
/* 77*/ { IS_NUM_F | IS_UPR_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 1, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" }, // KRSET
|
/* 77*/ { IS_NUM_F | IS_UPR_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 1, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" }, /* KRSET */
|
||||||
/* 78*/ { IS_NUM_F | IS_UPR_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYz", -1, 0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
/* 78*/ { IS_NUM_F | IS_UPR_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYz", -1, 0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
||||||
/* 79*/ { IS_NUM_F | IS_UPR_F | IS_SPC_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ ", -1, 1, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ " }, // RUBIDIUM
|
/* 79*/ { IS_NUM_F | IS_UPR_F | IS_SPC_F, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ ", -1, 1, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ " }, /* RUBIDIUM */
|
||||||
/* 80*/ { IS_NUM_F | IS_UPR_F | IS_SPC_F, "0123456789aBCDEFGHIJKLMNOPQRSTUVWXYZ ", -1, 0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ " },
|
/* 80*/ { IS_NUM_F | IS_UPR_F | IS_SPC_F, "0123456789aBCDEFGHIJKLMNOPQRSTUVWXYZ ", -1, 0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ " },
|
||||||
/* 81*/ { IS_NUM_F | IS_MNS_F | IS_UPR_F, "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 1, "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ" }, // SHKASUTSET
|
/* 81*/ { IS_NUM_F | IS_MNS_F | IS_UPR_F, "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 1, "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ" }, /* SHKASUTSET */
|
||||||
/* 82*/ { IS_NUM_F | IS_MNS_F | IS_UPR_F, "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYz", -1, 0, "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
/* 82*/ { IS_NUM_F | IS_MNS_F | IS_UPR_F, "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYz", -1, 0, "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
||||||
/* 83*/ { IS_NUM_F | IS_UPR_F | IS_SPC_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SIL_F | IS_CLI_F, "1234567890 $%*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 1, "1234567890 $%*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYZ" }, // QR_ALPHA
|
/* 83*/ { IS_NUM_F | IS_UPR_F | IS_SPC_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SIL_F | IS_CLI_F, "1234567890 $%*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 1, "1234567890 $%*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYZ" }, /* QR_ALPHA */
|
||||||
/* 84*/ { IS_NUM_F | IS_UPR_F | IS_SPC_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SIL_F | IS_CLI_F, "1234567890 $%*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYz", -1, 0, "1234567890 $%*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
/* 84*/ { IS_NUM_F | IS_UPR_F | IS_SPC_F | IS_AST_F | IS_PLS_F | IS_MNS_F | IS_SIL_F | IS_CLI_F, "1234567890 $%*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYz", -1, 0, "1234567890 $%*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
||||||
};
|
};
|
||||||
int data_size = ARRAY_SIZE(data);
|
int data_size = ARRAY_SIZE(data);
|
||||||
@ -195,7 +196,7 @@ static void test_is_sane_lookup(int index) {
|
|||||||
|
|
||||||
int posns[32];
|
int posns[32];
|
||||||
};
|
};
|
||||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { "1234567", -1, "7654321357", -1, 1, { 6, 5, 4, 3, 2, 1, 0, 2, 4, 6 } },
|
/* 0*/ { "1234567", -1, "7654321357", -1, 1, { 6, 5, 4, 3, 2, 1, 0, 2, 4, 6 } },
|
||||||
/* 1*/ { "1234567", -1, "76543213578", -1, 0, {0} },
|
/* 1*/ { "1234567", -1, "76543213578", -1, 0, {0} },
|
||||||
@ -236,7 +237,7 @@ static void test_is_valid_utf8(int index) {
|
|||||||
int ret;
|
int ret;
|
||||||
char *comment;
|
char *comment;
|
||||||
};
|
};
|
||||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { "", -1, 1, "" },
|
/* 0*/ { "", -1, 1, "" },
|
||||||
/* 1*/ { "abcdefghijklmnopqrstuvwxyz", -1, 1, "" },
|
/* 1*/ { "abcdefghijklmnopqrstuvwxyz", -1, 1, "" },
|
||||||
@ -278,7 +279,7 @@ static void test_utf8_to_unicode(int index, int debug) {
|
|||||||
unsigned int expected_vals[20];
|
unsigned int expected_vals[20];
|
||||||
char *comment;
|
char *comment;
|
||||||
};
|
};
|
||||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { "", -1, 1, 0, 0, {0}, "" },
|
/* 0*/ { "", -1, 1, 0, 0, {0}, "" },
|
||||||
/* 1*/ { "\000a\302\200\340\240\200", 7, 1, 0, 4, { 0, 'a', 0x80, 0x800 }, "NUL a C280 E0A080" },
|
/* 1*/ { "\000a\302\200\340\240\200", 7, 1, 0, 4, { 0, 'a', 0x80, 0x800 }, "NUL a C280 E0A080" },
|
||||||
@ -335,7 +336,7 @@ static void test_set_height(int index, int debug) {
|
|||||||
char *expected_errtxt;
|
char *expected_errtxt;
|
||||||
char *comment;
|
char *comment;
|
||||||
};
|
};
|
||||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { 0, { 0 }, 0, 0, 0, 0, 0, 0, 0.5, "", "" },
|
/* 0*/ { 0, { 0 }, 0, 0, 0, 0, 0, 0, 0.5, "", "" },
|
||||||
/* 1*/ { 2, { 1, 1 }, 2, 0, 0, 0, 0, 0, 2, "", "zero_count == 0, fixed height only" },
|
/* 1*/ { 2, { 1, 1 }, 2, 0, 0, 0, 0, 0, 2, "", "zero_count == 0, fixed height only" },
|
||||||
@ -385,7 +386,7 @@ static void test_debug_test_codeword_dump_int(int index, int debug) {
|
|||||||
int length;
|
int length;
|
||||||
char *expected;
|
char *expected;
|
||||||
};
|
};
|
||||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { { 2147483647, -2147483646, 2147483647, 0, 2147483647, 2147483647, 2147483647, 2147483647, 123456 }, 10, "(10) 2147483647 -2147483646 2147483647 0 2147483647 2147483647 2147483647 2147483647 123456" },
|
/* 0*/ { { 2147483647, -2147483646, 2147483647, 0, 2147483647, 2147483647, 2147483647, 2147483647, 123456 }, 10, "(10) 2147483647 -2147483646 2147483647 0 2147483647 2147483647 2147483647 2147483647 123456" },
|
||||||
/* 1*/ { { 2147483647, -2147483646, 2147483647, 0, 2147483647, 2147483647, 2147483647, 2147483647, 1234567 }, 10, "(10) 2147483647 -2147483646 2147483647 0 2147483647 2147483647 2147483647 2147483647" },
|
/* 1*/ { { 2147483647, -2147483646, 2147483647, 0, 2147483647, 2147483647, 2147483647, 2147483647, 1234567 }, 10, "(10) 2147483647 -2147483646 2147483647 0 2147483647 2147483647 2147483647 2147483647" },
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,7 @@
|
|||||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
#include "testcommon.h"
|
#include "testcommon.h"
|
||||||
|
|
||||||
@ -125,8 +126,8 @@ static void test_binary_div_modulo_divisor(int index, int generate, int debug) {
|
|||||||
char cmp_buf[1024];
|
char cmp_buf[1024];
|
||||||
char cmp_msg[1024];
|
char cmp_msg[1024];
|
||||||
|
|
||||||
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise
|
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
|
||||||
int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise
|
int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); /* Only do ZXing-C++ test if asked, too slow otherwise */
|
||||||
|
|
||||||
testStart("test_binary_div_modulo_divisor");
|
testStart("test_binary_div_modulo_divisor");
|
||||||
|
|
||||||
@ -191,7 +192,7 @@ static void test_binary_div_modulo_divisor(int index, int generate, int debug) {
|
|||||||
testFinish();
|
testFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replicate examples from GS1 General Specifications 21.0.1 and ISO/IEC 24724:2011
|
/* Replicate examples from GS1 General Specifications 21.0.1 and ISO/IEC 24724:2011 */
|
||||||
static void test_examples(int index, int generate, int debug) {
|
static void test_examples(int index, int generate, int debug) {
|
||||||
|
|
||||||
struct item {
|
struct item {
|
||||||
@ -208,7 +209,7 @@ static void test_examples(int index, int generate, int debug) {
|
|||||||
char *comment;
|
char *comment;
|
||||||
char *expected;
|
char *expected;
|
||||||
};
|
};
|
||||||
// Verified manually against GS1 General Specifications 21.0.1 (GGS) and ISO/IEC 24724:2011, and verified via bwipp_dump.ps against BWIPP
|
/* Verified manually against GS1 General Specifications 21.0.1 (GGS) and ISO/IEC 24724:2011, and verified via bwipp_dump.ps against BWIPP */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { BARCODE_DBAR_OMN, -1, -1, -1, "0950110153001", 0, 1, 96, 1, "GGS Figure 5.5.2.1.1-1. GS1 DataBar Omnidirectional",
|
/* 0*/ { BARCODE_DBAR_OMN, -1, -1, -1, "0950110153001", 0, 1, 96, 1, "GGS Figure 5.5.2.1.1-1. GS1 DataBar Omnidirectional",
|
||||||
"010000010100000101000111110000010111101101011100100011011101000101100000000111001110110111001101"
|
"010000010100000101000111110000010111101101011100100011011101000101100000000111001110110111001101"
|
||||||
@ -866,8 +867,8 @@ static void test_examples(int index, int generate, int debug) {
|
|||||||
char cmp_buf[16384];
|
char cmp_buf[16384];
|
||||||
char cmp_msg[1024];
|
char cmp_msg[1024];
|
||||||
|
|
||||||
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise
|
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
|
||||||
int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise
|
int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); /* Only do ZXing-C++ test if asked, too slow otherwise */
|
||||||
|
|
||||||
testStart("test_examples");
|
testStart("test_examples");
|
||||||
|
|
||||||
@ -931,7 +932,7 @@ static void test_examples(int index, int generate, int debug) {
|
|||||||
testFinish();
|
testFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test general-purpose data compaction
|
/* Test general-purpose data compaction */
|
||||||
static void test_general_field(int index, int generate, int debug) {
|
static void test_general_field(int index, int generate, int debug) {
|
||||||
|
|
||||||
struct item {
|
struct item {
|
||||||
@ -943,7 +944,7 @@ static void test_general_field(int index, int generate, int debug) {
|
|||||||
char *comment;
|
char *comment;
|
||||||
char *expected;
|
char *expected;
|
||||||
};
|
};
|
||||||
// Verified via bwipp_dump.ps against BWIPP and manually against tec-it.com (some separators differ from tec-it.com where noted)
|
/* Verified via bwipp_dump.ps against BWIPP and manually against tec-it.com (some separators differ from tec-it.com where noted) */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { BARCODE_DBAR_EXP, "[91]1", 1, 102, "Single numeric",
|
/* 0*/ { BARCODE_DBAR_EXP, "[91]1", 1, 102, "Single numeric",
|
||||||
"010100000001000101101111111100001011001000010000010110111110101100001011110000000010101111100001011101"
|
"010100000001000101101111111100001011001000010000010110111110101100001011110000000010101111100001011101"
|
||||||
@ -1297,15 +1298,15 @@ static void test_hrt(int index, int debug) {
|
|||||||
int ret;
|
int ret;
|
||||||
char *expected;
|
char *expected;
|
||||||
};
|
};
|
||||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { BARCODE_DBAR_OMN, -1, "1234567890123", 0, "(01)12345678901231" },
|
/* 0*/ { BARCODE_DBAR_OMN, -1, "1234567890123", 0, "(01)12345678901231" },
|
||||||
/* 1*/ { BARCODE_DBAR_OMN, -1, "12345678901231", 0, "(01)12345678901231" },
|
/* 1*/ { BARCODE_DBAR_OMN, -1, "12345678901231", 0, "(01)12345678901231" },
|
||||||
/* 4*/ { BARCODE_DBAR_OMN, -1, "1000000000009", 0, "(01)10000000000090" },
|
/* 4*/ { BARCODE_DBAR_OMN, -1, "1000000000009", 0, "(01)10000000000090" },
|
||||||
/* 5*/ { BARCODE_DBAR_LTD, -1, "1341056790138", 0, "(01)13410567901384" },
|
/* 5*/ { BARCODE_DBAR_LTD, -1, "1341056790138", 0, "(01)13410567901384" },
|
||||||
/* 6*/ { BARCODE_DBAR_LTD, -1, "13410567901384", 0, "(01)13410567901384" },
|
/* 6*/ { BARCODE_DBAR_LTD, -1, "13410567901384", 0, "(01)13410567901384" },
|
||||||
/* 9*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231", 0, "(01)12345678901231" }, // See test_hrt() in "test_gs1.c" for full HRT tests
|
/* 9*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231", 0, "(01)12345678901231" }, /* See test_hrt() in "test_gs1.c" for full HRT tests */
|
||||||
/* 10*/ { BARCODE_DBAR_STK, -1, "12345678901231", 0, "" }, // No HRT for stacked
|
/* 10*/ { BARCODE_DBAR_STK, -1, "12345678901231", 0, "" }, /* No HRT for stacked */
|
||||||
/* 11*/ { BARCODE_DBAR_OMNSTK, -1, "10000000000090", 0, "" },
|
/* 11*/ { BARCODE_DBAR_OMNSTK, -1, "10000000000090", 0, "" },
|
||||||
/* 12*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231", 0, "" },
|
/* 12*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231", 0, "" },
|
||||||
};
|
};
|
||||||
@ -1348,20 +1349,20 @@ static void test_input(int index, int debug) {
|
|||||||
int expected_width;
|
int expected_width;
|
||||||
char *expected_errtxt;
|
char *expected_errtxt;
|
||||||
};
|
};
|
||||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { BARCODE_DBAR_OMN, -1, -1, -1, "1234567890123", 0, 1, 96, "" },
|
/* 0*/ { BARCODE_DBAR_OMN, -1, -1, -1, "1234567890123", 0, 1, 96, "" },
|
||||||
/* 1*/ { BARCODE_DBAR_OMN, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
/* 1*/ { BARCODE_DBAR_OMN, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
||||||
/* 2*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
/* 2*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
||||||
/* 3*/ { BARCODE_DBAR_OMN, -1, -1, -1, "12345678901234", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '4', expecting '1'" },
|
/* 3*/ { BARCODE_DBAR_OMN, -1, -1, -1, "12345678901234", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '4', expecting '1'" },
|
||||||
/* 4*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "12345678901234", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '4', expecting '1'" }, // Still checked
|
/* 4*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "12345678901234", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '4', expecting '1'" }, /* Still checked */
|
||||||
/* 5*/ { BARCODE_DBAR_OMN, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
/* 5*/ { BARCODE_DBAR_OMN, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
||||||
/* 6*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
/* 6*/ { BARCODE_DBAR_OMN, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
||||||
/* 7*/ { BARCODE_DBAR_LTD, -1, -1, -1, "1234567890123", 0, 1, 79, "" },
|
/* 7*/ { BARCODE_DBAR_LTD, -1, -1, -1, "1234567890123", 0, 1, 79, "" },
|
||||||
/* 8*/ { BARCODE_DBAR_LTD, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character in data (digits only)" },
|
/* 8*/ { BARCODE_DBAR_LTD, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character in data (digits only)" },
|
||||||
/* 9*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character in data (digits only)" },
|
/* 9*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character in data (digits only)" },
|
||||||
/* 10*/ { BARCODE_DBAR_LTD, -1, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '5', expecting '1'" },
|
/* 10*/ { BARCODE_DBAR_LTD, -1, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '5', expecting '1'" },
|
||||||
/* 11*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '5', expecting '1'" }, // Still checked
|
/* 11*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '5', expecting '1'" }, /* Still checked */
|
||||||
/* 12*/ { BARCODE_DBAR_LTD, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input too long (14 character maximum)" },
|
/* 12*/ { BARCODE_DBAR_LTD, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input too long (14 character maximum)" },
|
||||||
/* 13*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input too long (14 character maximum)" },
|
/* 13*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input too long (14 character maximum)" },
|
||||||
/* 14*/ { BARCODE_DBAR_LTD, -1, -1, -1, "2234567890123", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input out of range (0 to 1999999999999)" },
|
/* 14*/ { BARCODE_DBAR_LTD, -1, -1, -1, "2234567890123", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input out of range (0 to 1999999999999)" },
|
||||||
@ -1377,23 +1378,23 @@ static void test_input(int index, int debug) {
|
|||||||
/* 24*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 1, 151, "" },
|
/* 24*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 1, 151, "" },
|
||||||
/* 25*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'" },
|
/* 25*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'" },
|
||||||
/* 26*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 1, 134, "" },
|
/* 26*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 1, 134, "" },
|
||||||
/* 27*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", ZINT_WARN_NONCOMPLIANT, 1, 526, "Warning 261: AI (91) position 21: Invalid CSET 82 character ' '" }, // ISOIEC punc
|
/* 27*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", ZINT_WARN_NONCOMPLIANT, 1, 526, "Warning 261: AI (91) position 21: Invalid CSET 82 character ' '" }, /* ISOIEC punc */
|
||||||
/* 28*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", 0, 1, 526, "" },
|
/* 28*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", 0, 1, 526, "" },
|
||||||
/* 29*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "" }, // ISOIEC punc less space
|
/* 29*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "" }, /* ISOIEC punc less space */
|
||||||
/* 30*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "" },
|
/* 30*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "" },
|
||||||
/* 31*/ { BARCODE_DBAR_STK, -1, -1, -1, "1234567890123", 0, 3, 50, "" },
|
/* 31*/ { BARCODE_DBAR_STK, -1, -1, -1, "1234567890123", 0, 3, 50, "" },
|
||||||
/* 32*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
/* 32*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
||||||
/* 33*/ { BARCODE_DBAR_STK, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
/* 33*/ { BARCODE_DBAR_STK, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
||||||
/* 34*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
/* 34*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
||||||
/* 35*/ { BARCODE_DBAR_STK, -1, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '5', expecting '1'" },
|
/* 35*/ { BARCODE_DBAR_STK, -1, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '5', expecting '1'" },
|
||||||
/* 36*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '5', expecting '1'" }, // Still checked
|
/* 36*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "12345678901235", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '5', expecting '1'" }, /* Still checked */
|
||||||
/* 37*/ { BARCODE_DBAR_STK, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
/* 37*/ { BARCODE_DBAR_STK, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
||||||
/* 38*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
/* 38*/ { BARCODE_DBAR_STK, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
||||||
/* 39*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "1234567890123", 0, 5, 50, "" },
|
/* 39*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "1234567890123", 0, 5, 50, "" },
|
||||||
/* 40*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
/* 40*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
||||||
/* 41*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
/* 41*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "123456789012A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character in data (digits only)" },
|
||||||
/* 42*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "12345678901236", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '6', expecting '1'" },
|
/* 42*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "12345678901236", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '6', expecting '1'" },
|
||||||
/* 43*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "12345678901236", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '6', expecting '1'" }, // Still checked
|
/* 43*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "12345678901236", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '6', expecting '1'" }, /* Still checked */
|
||||||
/* 44*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
/* 44*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
||||||
/* 45*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
/* 45*/ { BARCODE_DBAR_OMNSTK, GS1NOCHECK_MODE, -1, -1, "123456789012315", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input too long (14 character maximum)" },
|
||||||
/* 46*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 102, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'" },
|
/* 46*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 102, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'" },
|
||||||
@ -1403,8 +1404,8 @@ static void test_input(int index, int debug) {
|
|||||||
/* 50*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)" },
|
/* 50*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)" },
|
||||||
/* 51*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01)" },
|
/* 51*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01)" },
|
||||||
/* 52*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 5, 102, "" },
|
/* 52*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 5, 102, "" },
|
||||||
/* 53*/ { BARCODE_DBAR_EXPSTK, -1, 12, -1, "[01]12345678901231", 0, 5, 102, "" }, // Cols > 11 ignored
|
/* 53*/ { BARCODE_DBAR_EXPSTK, -1, 12, -1, "[01]12345678901231", 0, 5, 102, "" }, /* Cols > 11 ignored */
|
||||||
/* 54*/ { BARCODE_DBAR_EXPSTK, -1, -1, 12, "[01]12345678901231", 0, 5, 102, "" }, // Rows > 11 ignored
|
/* 54*/ { BARCODE_DBAR_EXPSTK, -1, -1, 12, "[01]12345678901231", 0, 5, 102, "" }, /* Rows > 11 ignored */
|
||||||
/* 55*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[01]12345678901231", 0, 9, 53, "" },
|
/* 55*/ { BARCODE_DBAR_EXPSTK, -1, 1, -1, "[01]12345678901231", 0, 9, 53, "" },
|
||||||
/* 56*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[01]12345678901231", 0, 5, 102, "" },
|
/* 56*/ { BARCODE_DBAR_EXPSTK, -1, 2, -1, "[01]12345678901231", 0, 5, 102, "" },
|
||||||
/* 57*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[01]12345678901231", 0, 1, 134, "" },
|
/* 57*/ { BARCODE_DBAR_EXPSTK, -1, 3, -1, "[01]12345678901231", 0, 1, 134, "" },
|
||||||
|
@ -538,10 +538,10 @@ int testUtilDAFTConvert(const struct zint_symbol *symbol, char *buffer, const in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (b == buffer + buffer_size) {
|
if (b == buffer + buffer_size) {
|
||||||
return FALSE;
|
return 0;
|
||||||
}
|
}
|
||||||
*b = '\0';
|
*b = '\0';
|
||||||
return TRUE;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Is string valid UTF-8? */
|
/* Is string valid UTF-8? */
|
||||||
@ -2379,6 +2379,10 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|
|||||||
strcat(bwipp_data, data);
|
strcat(bwipp_data, data);
|
||||||
testUtilBwippCvtGS1Data(bwipp_data, upcean, &addon_posn);
|
testUtilBwippCvtGS1Data(bwipp_data, upcean, &addon_posn);
|
||||||
|
|
||||||
|
/* Always set dontlint */
|
||||||
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sdontlint", strlen(bwipp_opts_buf) ? " " : "");
|
||||||
|
bwipp_opts = bwipp_opts_buf;
|
||||||
|
|
||||||
if (upcean) {
|
if (upcean) {
|
||||||
if (symbology == BARCODE_EANX_CC && (primary_len <= 8 || (addon_posn && addon_posn <= 8))) {
|
if (symbology == BARCODE_EANX_CC && (primary_len <= 8 || (addon_posn && addon_posn <= 8))) {
|
||||||
bwipp_barcode = "ean8composite";
|
bwipp_barcode = "ean8composite";
|
||||||
@ -2386,7 +2390,6 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|
|||||||
if (addon_posn) {
|
if (addon_posn) {
|
||||||
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%saddongap=%d",
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%saddongap=%d",
|
||||||
strlen(bwipp_opts_buf) ? " " : "", option_2 > 0 ? option_2 : upca ? 9 : 7);
|
strlen(bwipp_opts_buf) ? " " : "", option_2 > 0 ? option_2 : upca ? 9 : 7);
|
||||||
bwipp_opts = bwipp_opts_buf;
|
|
||||||
}
|
}
|
||||||
bwipp_row_height[symbol->rows - 1] = 72;
|
bwipp_row_height[symbol->rows - 1] = 72;
|
||||||
}
|
}
|
||||||
@ -2394,17 +2397,14 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|
|||||||
if (option_1 > 0) {
|
if (option_1 > 0) {
|
||||||
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sccversion=%c",
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sccversion=%c",
|
||||||
strlen(bwipp_opts_buf) ? " " : "", option_1 == 1 ? 'a' : option_1 == 2 ? 'b' : 'c');
|
strlen(bwipp_opts_buf) ? " " : "", option_1 == 1 ? 'a' : option_1 == 2 ? 'b' : 'c');
|
||||||
bwipp_opts = bwipp_opts_buf;
|
|
||||||
}
|
}
|
||||||
if (option_2 > 0) {
|
if (option_2 > 0) {
|
||||||
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%ssegments=%d",
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%ssegments=%d",
|
||||||
strlen(bwipp_opts_buf) ? " " : "", option_2 * 2);
|
strlen(bwipp_opts_buf) ? " " : "", option_2 * 2);
|
||||||
bwipp_opts = bwipp_opts_buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->input_mode & GS1NOCHECK_MODE) {
|
if (symbol->input_mode & GS1NOCHECK_MODE) {
|
||||||
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sdontlint", strlen(bwipp_opts_buf) ? " " : "");
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sdontlint", strlen(bwipp_opts_buf) ? " " : "");
|
||||||
bwipp_opts = bwipp_opts_buf;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (gs1_cvt) {
|
if (gs1_cvt) {
|
||||||
@ -2414,6 +2414,10 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|
|||||||
strcat(bwipp_data, data);
|
strcat(bwipp_data, data);
|
||||||
testUtilBwippCvtGS1Data(bwipp_data, upcean, &addon_posn);
|
testUtilBwippCvtGS1Data(bwipp_data, upcean, &addon_posn);
|
||||||
|
|
||||||
|
/* Always set dontlint */
|
||||||
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sdontlint", strlen(bwipp_opts_buf) ? " " : "");
|
||||||
|
bwipp_opts = bwipp_opts_buf;
|
||||||
|
|
||||||
if (upcean) {
|
if (upcean) {
|
||||||
if ((symbology == BARCODE_EANX || symbology == BARCODE_EANX_CHK)
|
if ((symbology == BARCODE_EANX || symbology == BARCODE_EANX_CHK)
|
||||||
&& (data_len <= 8 || (addon_posn && addon_posn <= 8))) {
|
&& (data_len <= 8 || (addon_posn && addon_posn <= 8))) {
|
||||||
@ -2425,7 +2429,6 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|
|||||||
if (addon_posn) {
|
if (addon_posn) {
|
||||||
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%saddongap=%d",
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%saddongap=%d",
|
||||||
strlen(bwipp_opts_buf) ? " " : "", option_2 > 0 ? option_2 : upca ? 9 : 7);
|
strlen(bwipp_opts_buf) ? " " : "", option_2 > 0 ? option_2 : upca ? 9 : 7);
|
||||||
bwipp_opts = bwipp_opts_buf;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2433,13 +2436,11 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|
|||||||
if (symbology == BARCODE_DBAR_EXP || symbology == BARCODE_DBAR_EXPSTK) {
|
if (symbology == BARCODE_DBAR_EXP || symbology == BARCODE_DBAR_EXPSTK) {
|
||||||
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%ssegments=%d",
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%ssegments=%d",
|
||||||
strlen(bwipp_opts_buf) ? " " : "", option_2 * 2);
|
strlen(bwipp_opts_buf) ? " " : "", option_2 * 2);
|
||||||
bwipp_opts = bwipp_opts_buf;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->input_mode & GS1NOCHECK_MODE) {
|
if (symbol->input_mode & GS1NOCHECK_MODE) {
|
||||||
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sdontlint", strlen(bwipp_opts_buf) ? " " : "");
|
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sdontlint", strlen(bwipp_opts_buf) ? " " : "");
|
||||||
bwipp_opts = bwipp_opts_buf;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (testUtilBwippEscape(bwipp_data, bwipp_data_size, data, data_len, symbol->input_mode & ESCAPE_MODE,
|
if (testUtilBwippEscape(bwipp_data, bwipp_data_size, data, data_len, symbol->input_mode & ESCAPE_MODE,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- /home/mburke/code/bwipp/postscriptbarcode/build/monolithic/barcode.ps 2022-07-14 20:00:40.532978330 +0100
|
--- /home/mburke/code/bwipp/postscriptbarcode/build/monolithic/barcode.ps 2022-07-17 22:17:15.871836524 +0100
|
||||||
+++ backend/tests/tools/bwipp_dump.ps 2022-07-14 20:17:25.203302237 +0100
|
+++ backend/tests/tools/bwipp_dump.ps 2022-07-18 19:22:47.833744410 +0100
|
||||||
@@ -16606,8 +16606,8 @@
|
@@ -16698,8 +16698,8 @@
|
||||||
} bind
|
} bind
|
||||||
/fime {
|
/fime {
|
||||||
/sbs [2.25 6.75 2.25 15.75 2.25 6.75 2.25] def
|
/sbs [2.25 6.75 2.25 15.75 2.25 6.75 2.25] def
|
||||||
@ -11,7 +11,7 @@
|
|||||||
} bind
|
} bind
|
||||||
>> def
|
>> def
|
||||||
|
|
||||||
@@ -28094,34 +28094,80 @@
|
@@ -28190,7 +28190,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -20,7 +20,8 @@
|
|||||||
|
|
||||||
options (lintype) (ean13) put
|
options (lintype) (ean13) put
|
||||||
options (inkspread) (0) put
|
options (inkspread) (0) put
|
||||||
options (dontdraw) true put
|
@@ -28230,27 +28230,73 @@
|
||||||
|
} if
|
||||||
|
|
||||||
% Plot the linear part
|
% Plot the linear part
|
||||||
- linear options //ean13 exec //renlinear exec
|
- linear options //ean13 exec //renlinear exec
|
||||||
@ -111,7 +112,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -28181,7 +28227,7 @@
|
@@ -28314,7 +28360,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -120,8 +121,8 @@
|
|||||||
|
|
||||||
% Get the result of encoding with ean8 and gs1-cc
|
% Get the result of encoding with ean8 and gs1-cc
|
||||||
options (lintype) (ean8) put
|
options (lintype) (ean8) put
|
||||||
@@ -28189,29 +28235,75 @@
|
@@ -28355,29 +28401,75 @@
|
||||||
options (dontdraw) true put
|
} if
|
||||||
|
|
||||||
% Plot the linear part
|
% Plot the linear part
|
||||||
- linear options //ean8 exec //renlinear exec
|
- linear options //ean8 exec //renlinear exec
|
||||||
@ -216,7 +217,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -28271,34 +28363,80 @@
|
@@ -28441,7 +28533,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -225,7 +226,8 @@
|
|||||||
|
|
||||||
options (lintype) (ean13) put
|
options (lintype) (ean13) put
|
||||||
options (inkspread) (0) put
|
options (inkspread) (0) put
|
||||||
options (dontdraw) true put
|
@@ -28481,27 +28573,73 @@
|
||||||
|
} if
|
||||||
|
|
||||||
% Plot the linear part
|
% Plot the linear part
|
||||||
- linear options //upca exec //renlinear exec
|
- linear options //upca exec //renlinear exec
|
||||||
@ -316,7 +318,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -28373,34 +28511,80 @@
|
@@ -28580,7 +28718,7 @@
|
||||||
/opt options
|
/opt options
|
||||||
>> def
|
>> def
|
||||||
|
|
||||||
@ -325,7 +327,8 @@
|
|||||||
|
|
||||||
options (lintype) (upce) put
|
options (lintype) (upce) put
|
||||||
options (inkspread) (0) put
|
options (inkspread) (0) put
|
||||||
options (dontdraw) true put
|
@@ -28620,27 +28758,73 @@
|
||||||
|
} if
|
||||||
|
|
||||||
% Plot the linear part
|
% Plot the linear part
|
||||||
- linear options //upce exec //renlinear exec
|
- linear options //upce exec //renlinear exec
|
||||||
@ -416,7 +419,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -28460,7 +28644,7 @@
|
@@ -28704,7 +28888,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -425,7 +428,7 @@
|
|||||||
|
|
||||||
options (lintype) (databaromni) put
|
options (lintype) (databaromni) put
|
||||||
options (linkage) true put
|
options (linkage) true put
|
||||||
@@ -28471,7 +28655,7 @@
|
@@ -28748,7 +28932,7 @@
|
||||||
linear options //databaromni exec
|
linear options //databaromni exec
|
||||||
dup (sbs) get /linsbs exch def
|
dup (sbs) get /linsbs exch def
|
||||||
dup (bhs) get 0 get 72 mul /linheight exch def
|
dup (bhs) get 0 get 72 mul /linheight exch def
|
||||||
@ -434,7 +437,7 @@
|
|||||||
|
|
||||||
% Plot the separator
|
% Plot the separator
|
||||||
/sepfinder {
|
/sepfinder {
|
||||||
@@ -28502,20 +28686,66 @@
|
@@ -28779,20 +28963,66 @@
|
||||||
sep 0 [0 0 0] putinterval
|
sep 0 [0 0 0] putinterval
|
||||||
sep sep length 4 sub [0 0 0 0] putinterval
|
sep sep length 4 sub [0 0 0 0] putinterval
|
||||||
18 sepfinder 64 sepfinder
|
18 sepfinder 64 sepfinder
|
||||||
@ -513,7 +516,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -28574,7 +28804,7 @@
|
@@ -28855,7 +29085,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -522,7 +525,7 @@
|
|||||||
|
|
||||||
options (lintype) (databarstacked) put
|
options (lintype) (databarstacked) put
|
||||||
options (linkage) true put
|
options (linkage) true put
|
||||||
@@ -28585,7 +28815,7 @@
|
@@ -28899,7 +29129,7 @@
|
||||||
linear options //databarstacked exec
|
linear options //databarstacked exec
|
||||||
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
||||||
dup (pixy) get /linheight exch def
|
dup (pixy) get /linheight exch def
|
||||||
@ -531,7 +534,7 @@
|
|||||||
|
|
||||||
% Plot the separator
|
% Plot the separator
|
||||||
/sepfinder {
|
/sepfinder {
|
||||||
@@ -28613,20 +28843,52 @@
|
@@ -28927,20 +29157,52 @@
|
||||||
sep 0 [ 0 0 0 0 ] putinterval
|
sep 0 [ 0 0 0 0 ] putinterval
|
||||||
sep sep length 4 sub [ 0 0 0 0 ] putinterval
|
sep sep length 4 sub [ 0 0 0 0 ] putinterval
|
||||||
18 sepfinder
|
18 sepfinder
|
||||||
@ -596,7 +599,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -28685,7 +28947,7 @@
|
@@ -29003,7 +29265,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -605,7 +608,7 @@
|
|||||||
|
|
||||||
options (lintype) (databarstackedomni) put
|
options (lintype) (databarstackedomni) put
|
||||||
options (linkage) true put
|
options (linkage) true put
|
||||||
@@ -28696,7 +28958,7 @@
|
@@ -29047,7 +29309,7 @@
|
||||||
linear options //databarstackedomni exec
|
linear options //databarstackedomni exec
|
||||||
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
||||||
dup (pixy) get /linheight exch def
|
dup (pixy) get /linheight exch def
|
||||||
@ -614,7 +617,7 @@
|
|||||||
|
|
||||||
% Plot the separator
|
% Plot the separator
|
||||||
/sepfinder {
|
/sepfinder {
|
||||||
@@ -28724,20 +28986,52 @@
|
@@ -29075,20 +29337,52 @@
|
||||||
sep 0 [ 0 0 0 0 ] putinterval
|
sep 0 [ 0 0 0 0 ] putinterval
|
||||||
sep sep length 4 sub [ 0 0 0 0 ] putinterval
|
sep sep length 4 sub [ 0 0 0 0 ] putinterval
|
||||||
18 sepfinder
|
18 sepfinder
|
||||||
@ -679,7 +682,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -28912,7 +29206,7 @@
|
@@ -29304,7 +29598,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -688,7 +691,7 @@
|
|||||||
|
|
||||||
options (lintype) (databarlimited) put
|
options (lintype) (databarlimited) put
|
||||||
options (linkage) true put
|
options (linkage) true put
|
||||||
@@ -28923,7 +29217,7 @@
|
@@ -29348,7 +29642,7 @@
|
||||||
linear options //databarlimited exec
|
linear options //databarlimited exec
|
||||||
dup (sbs) get /linsbs exch def
|
dup (sbs) get /linsbs exch def
|
||||||
dup (bhs) get 0 get 72 mul /linheight exch def
|
dup (bhs) get 0 get 72 mul /linheight exch def
|
||||||
@ -697,7 +700,7 @@
|
|||||||
|
|
||||||
% Plot the separator
|
% Plot the separator
|
||||||
mark
|
mark
|
||||||
@@ -28931,22 +29225,68 @@
|
@@ -29356,22 +29650,68 @@
|
||||||
counttomark 1 sub array astore /sep exch def pop pop
|
counttomark 1 sub array astore /sep exch def pop pop
|
||||||
sep 0 [0 0 0] putinterval
|
sep 0 [0 0 0] putinterval
|
||||||
sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces
|
sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces
|
||||||
@ -780,7 +783,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -29006,7 +29346,7 @@
|
@@ -29435,7 +29775,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -789,7 +792,7 @@
|
|||||||
|
|
||||||
options (lintype) (databarexpanded) put
|
options (lintype) (databarexpanded) put
|
||||||
options (linkage) true put
|
options (linkage) true put
|
||||||
@@ -29017,7 +29357,7 @@
|
@@ -29479,7 +29819,7 @@
|
||||||
linear options //databarexpanded exec
|
linear options //databarexpanded exec
|
||||||
dup (sbs) get /linsbs exch def
|
dup (sbs) get /linsbs exch def
|
||||||
dup (bhs) get 0 get 72 mul /linheight exch def
|
dup (bhs) get 0 get 72 mul /linheight exch def
|
||||||
@ -798,7 +801,7 @@
|
|||||||
|
|
||||||
% Plot the separator
|
% Plot the separator
|
||||||
/sepfinder {
|
/sepfinder {
|
||||||
@@ -29046,20 +29386,60 @@
|
@@ -29508,20 +29848,60 @@
|
||||||
18 98 bot length 13 sub {} for
|
18 98 bot length 13 sub {} for
|
||||||
69 98 bot length 13 sub {} for
|
69 98 bot length 13 sub {} for
|
||||||
] {sepfinder} forall
|
] {sepfinder} forall
|
||||||
@ -871,7 +874,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -29118,7 +29498,7 @@
|
@@ -29584,7 +29964,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -880,7 +883,7 @@
|
|||||||
|
|
||||||
options (lintype) (databarexpandedstacked) put
|
options (lintype) (databarexpandedstacked) put
|
||||||
options (linkage) true put
|
options (linkage) true put
|
||||||
@@ -29129,7 +29509,7 @@
|
@@ -29628,7 +30008,7 @@
|
||||||
linear options //databarexpandedstacked exec
|
linear options //databarexpandedstacked exec
|
||||||
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
||||||
dup (pixy) get /linheight exch def
|
dup (pixy) get /linheight exch def
|
||||||
@ -889,7 +892,7 @@
|
|||||||
|
|
||||||
% Plot the separator
|
% Plot the separator
|
||||||
/sepfinder {
|
/sepfinder {
|
||||||
@@ -29155,21 +29535,49 @@
|
@@ -29654,21 +30034,49 @@
|
||||||
19 98 bot length 13 sub {} for
|
19 98 bot length 13 sub {} for
|
||||||
70 98 bot length 13 sub {} for
|
70 98 bot length 13 sub {} for
|
||||||
] {sepfinder} forall
|
] {sepfinder} forall
|
||||||
@ -952,7 +955,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -29229,7 +29637,7 @@
|
@@ -29732,7 +30140,7 @@
|
||||||
pop
|
pop
|
||||||
} ifelse
|
} ifelse
|
||||||
|
|
||||||
@ -961,7 +964,7 @@
|
|||||||
|
|
||||||
options (inkspread) (0) put
|
options (inkspread) (0) put
|
||||||
options (dontdraw) true put
|
options (dontdraw) true put
|
||||||
@@ -29256,35 +29664,87 @@
|
@@ -29792,35 +30200,87 @@
|
||||||
linear << options {} forall >> //gs1-128 exec
|
linear << options {} forall >> //gs1-128 exec
|
||||||
dup (sbs) get /linsbs exch def
|
dup (sbs) get /linsbs exch def
|
||||||
dup (bhs) get 0 get 72 mul /linheight exch def
|
dup (bhs) get 0 get 72 mul /linheight exch def
|
||||||
@ -1063,7 +1066,7 @@
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -30834,3 +31294,189 @@
|
@@ -31370,3 +31830,189 @@
|
||||||
% --END ENCODER hibcazteccode--
|
% --END ENCODER hibcazteccode--
|
||||||
|
|
||||||
% --END TEMPLATE--
|
% --END TEMPLATE--
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user