diff --git a/ChangeLog b/ChangeLog
index c387d4d8..75501dab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-Version 2.16.0.9 (dev) not released yet (2026-02-05)
+Version 2.16.0.9 (dev) not released yet (2026-02-26)
====================================================
**Incompatible changes**
@@ -7,6 +7,8 @@ Version 2.16.0.9 (dev) not released yet (2026-02-05)
(may cause symbol size change, and generation failure if specified)
- Improved Aztec encodation algorithm (may cause symbol size change)
- New Qt Backend method `save_as_memfile()` to save file to memory
+- New Qt Backend methods `gs1Raw()` and `setGS1Raw()` for new `GS1RAW_MODE`
+ option for processing GS1 input
Changes
-------
@@ -21,6 +23,9 @@ Changes
"--fast" (input_mode |= FAST_MODE)
- AZTEC: add new option "--azfull" (option_3 = ZINT_AZTEC_FULL) to only
consider Full symbols (not Compact ones) on automatic sizing
+- GS1: new `GS1RAW_MODE` (CLI "--gs1raw") and GS1 Syntax Engine "Unbracketed AI
+ element strings" (caret) options for specifying GS1 input (ticket #350, props
+ Mario Verbruggen)
Bugs
----
@@ -34,6 +39,8 @@ Bugs
- AZTEC: fix ECC to be at least advertised percentages (ticket #347, props
Francois Grieu)
- CODE32/PZN: fix not restoring `option_2` (props axxel)
+- DBAR_EXP_CC/DBAR_EXPSTK_CC: fix separator over finder patterns when linear
+ part is greater than 4 codeblocks
Version 2.16.0 (2025-12-19)
diff --git a/backend/2of5inter_based.c b/backend/2of5inter_based.c
index 688d22c5..1cc3683a 100644
--- a/backend/2of5inter_based.c
+++ b/backend/2of5inter_based.c
@@ -1,7 +1,7 @@
/* 2of5_based.c - Handles Code 2 of 5 Interleaved derivatives ITF-14, DP Leitcode and DP Identcode */
/*
libzint - the open source barcode library
- Copyright (C) 2008-2025 Robin Stuart
+ Copyright (C) 2008-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -109,7 +109,7 @@ INTERNAL int zint_itf14(struct zint_symbol *symbol, unsigned char source[], int
z_hrt_cpy_nochk(symbol, local_source, 14);
- /* Use `raw_text` set by `zint_c25_inter_common()` */
+ /* Use `content_segs` set by `zint_c25_inter_common()` */
return error_number;
}
@@ -161,7 +161,7 @@ INTERNAL int zint_dpleit(struct zint_symbol *symbol, unsigned char source[], int
z_hrt_printf_nochk(symbol, "%.5s.%.3s.%.3s.%.3s", local_source, local_source + 5, local_source + 8,
local_source + 11);
- /* Use `raw_text` set by `zint_c25_inter_common()` */
+ /* Use `content_segs` set by `zint_c25_inter_common()` */
return error_number;
}
@@ -204,7 +204,7 @@ INTERNAL int zint_dpident(struct zint_symbol *symbol, unsigned char source[], in
z_hrt_printf_nochk(symbol, "%.2s.%.2s %c.%.3s.%.3s %c", local_source, local_source + 2, local_source[4],
local_source + 5, local_source + 8, local_source[11]);
- /* Use `raw_text` set by `zint_c25_inter_common()` */
+ /* Use `content_segs` set by `zint_c25_inter_common()` */
return error_number;
}
diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt
index 12cd994b..802656fe 100644
--- a/backend/CMakeLists.txt
+++ b/backend/CMakeLists.txt
@@ -107,7 +107,7 @@ endif()
if(NOT ZINT_SANITIZE AND ZINT_SANITIZEM AND CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -O2)
link_libraries(-fsanitize=memory)
- zint_target_compile_definitions(PRIVATE ZINT_SANITIZEM)
+ zint_target_compile_definitions(PUBLIC ZINT_SANITIZEM)
endif()
if(ZINT_TEST)
diff --git a/backend/aztec_trace.h b/backend/aztec_trace.h
new file mode 100644
index 00000000..2cbb708d
--- /dev/null
+++ b/backend/aztec_trace.h
@@ -0,0 +1,121 @@
+/* aztec_trace.h - Trace routines for optimized AZTEC encodation algorithm */
+/*
+ libzint - the open source barcode library
+ Copyright (C) 2026 Robin Stuart
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the project nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ */
+/* SPDX-License-Identifier: BSD-3-Clause */
+
+#ifndef Z_AZTEC_TRACE_H
+#define Z_AZTEC_TRACE_H
+
+static void AZ_TRACE_EdgeToString(char *buf, const unsigned char *source, const int length, const char initial_mode,
+ struct az_edge *edges, struct az_edge *edge) {
+ struct az_edge *previous_edge = AZ_PREVIOUS(edges, edge);
+ int previousMode = previous_edge ? previous_edge->mode : initial_mode;
+ int previous = previous_edge ? (int) (previous_edge - edges) : 0;
+ int current = (int) (edge - edges);
+ (void)length;
+ if (buf) {
+ sprintf(buf, "%d_%c_%d %c(%d,%d) %d -> %d_%c_%d",
+ edge->from, az_mode_char(previousMode), previous, az_mode_char(edge->mode), source[edge->from], edge->len,
+ edge->size, edge->from + 1, az_mode_char(edge->mode), current);
+ } else {
+ printf("%d_%c_%d %c(%d,%d) %d -> %d_%c_%d",
+ edge->from, az_mode_char(previousMode), previous, az_mode_char(edge->mode), source[edge->from], edge->len,
+ edge->size, edge->from + 1, az_mode_char(edge->mode), current);
+ }
+}
+
+static void AZ_TRACE_Path(const unsigned char *source, const int length, const char initial_mode,
+ struct az_edge *edges, struct az_edge *edge, char *result, const int result_size) {
+ struct az_edge *current;
+ AZ_TRACE_EdgeToString(result, source, length, initial_mode, edges, edge);
+ current = AZ_PREVIOUS(edges, edge);
+ while (current) {
+ char s[256];
+ char *pos;
+ int len;
+ AZ_TRACE_EdgeToString(s, source, length, initial_mode, edges, current);
+ pos = strrchr(s, ' ');
+ assert(pos);
+ len = strlen(result);
+ if ((pos - s) + 1 + len + 1 >= result_size) {
+ memcpy(result + result_size - 4, "...", 4); /* Include terminating NUL */
+ break;
+ }
+ memmove(result + (pos - s) + 1, result, len + 1);
+ memcpy(result, s, (pos - s) + 1);
+ current = AZ_PREVIOUS(edges, current);
+ }
+ puts(result);
+}
+
+static void AZ_TRACE_Edges(const char *prefix, const unsigned char *source, const int length, const char initial_mode,
+ struct az_edge *edges, const int vertexIndex) {
+ int i, j, e_i;
+ char result[1024 * 2];
+ if (vertexIndex) {
+ printf(prefix, vertexIndex);
+ } else {
+ fputs(prefix, stdout);
+ }
+ for (i = vertexIndex; i <= length; i++) {
+ e_i = i * AZ_NUM_MODES;
+ for (j = 0; j < AZ_NUM_MODES; j++) {
+ if (edges[e_i + j].mode) {
+ fputs(" **** ", stdout);
+ AZ_TRACE_Path(source, length, initial_mode, edges, edges + e_i + j, result, (int) ARRAY_SIZE(result));
+ }
+ }
+ }
+}
+
+static void AZ_TRACE_AddEdge(const unsigned char *source, const int length, struct az_edge *edges,
+ struct az_edge *previous, const int vertexIndex, struct az_edge *edge) {
+ const int v_ij = vertexIndex * AZ_NUM_MODES + AZ_MASK(edge->mode) - 1;
+
+ (void)source; (void)length;
+
+ printf("add mode %c_%d, previous %d, from %d, len %d, v_ij mode %d || v_ij.size %d >= edge->size %d\n",
+ az_mode_char(edge->mode), v_ij, previous ? (int) (previous - edges) : 0, edge->from, edge->len,
+ edges[v_ij].mode, edges[v_ij].size, edge->size);
+}
+
+static void AZ_TRACE_NotAddEdge(const unsigned char *source, const int length, struct az_edge *edges,
+ struct az_edge *previous, const int vertexIndex, const int e_ij, struct az_edge *edge) {
+ const int v_ij = vertexIndex * AZ_NUM_MODES + AZ_MASK(edge->mode) - 1;
+
+ (void)source; (void)length; (void)e_ij;
+
+ printf("NOT mode %c_%d, previous %d, from %d, len %d, v_ij.size %d < edge->size %d\n",
+ az_mode_char(edge->mode), v_ij, previous ? (int) (previous - edges) : 0, edge->from, edge->len,
+ edges[v_ij].size, edge->size);
+}
+
+/* vim: set ts=4 sw=4 et : */
+#endif /* Z_AZTEC_TRACE_H */
diff --git a/backend/code128.c b/backend/code128.c
index 53500f6e..be8e7e9b 100644
--- a/backend/code128.c
+++ b/backend/code128.c
@@ -542,7 +542,7 @@ INTERNAL int zint_gs1_128_cc(struct zint_symbol *symbol, unsigned char source[],
symbol->row_height[separator_row] = 1;
}
- error_number = zint_gs1_verify(symbol, source, length, reduced, &reduced_length);
+ error_number = zint_gs1_verify(symbol, source, length, reduced, &reduced_length, 1 /*set_hrt*/);
if (error_number >= ZINT_ERROR) {
return error_number;
}
@@ -612,7 +612,7 @@ INTERNAL int zint_gs1_128_cc(struct zint_symbol *symbol, unsigned char source[],
}
}
- if (reduced_length > 48) { /* GS1 General Specifications 5.4.4.3 */
+ if (reduced_length > 48) { /* GS1 General Specifications Release 26.0 5.4.4.3 Maximum symbol length */
if (error_number == 0) { /* Don't overwrite any `zint_gs1_verify()` warning */
error_number = z_errtxtf(ZINT_WARN_NONCOMPLIANT, symbol, 843,
"Input too long, requires %d characters (maximum 48)", reduced_length);
@@ -620,7 +620,7 @@ INTERNAL int zint_gs1_128_cc(struct zint_symbol *symbol, unsigned char source[],
}
if (symbol->output_options & COMPLIANT_HEIGHT) {
- /* GS1 General Specifications 21.0.1 5.12.3.2 table 2, including footnote (**):
+ /* GS1 General Specifications Release 26.0 5.12.3.2 Symbol specification table 2, including footnote (**):
same as ITF-14: "in case of further space constraints" height 5.8mm / 1.016mm (X max) ~ 5.7;
default 31.75mm / 0.495mm ~ 64.14 */
const float min_height = 5.70866156f; /* 5.8 / 1.016 */
@@ -650,12 +650,7 @@ INTERNAL int zint_gs1_128_cc(struct zint_symbol *symbol, unsigned char source[],
"Cannot use Reader Initialisation in GS1 mode, ignoring");
}
- /* Note won't overflow `text` buffer due to symbol character maximum restricted to C128_SYMBOL_MAX */
- if (symbol->input_mode & GS1PARENS_MODE) {
- z_hrt_cpy_nochk(symbol, source, length);
- } else {
- z_hrt_conv_gs1_brackets_nochk(symbol, source, length);
- }
+ /* HRT set by `zint_gs1_verify()` */
if (content_segs && z_ct_cpy(symbol, reduced, reduced_length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
diff --git a/backend/code128_based.c b/backend/code128_based.c
index fefdbac8..88532deb 100644
--- a/backend/code128_based.c
+++ b/backend/code128_based.c
@@ -1,7 +1,7 @@
/* code128_based.c - Handles Code 128 derivatives NVE-18, EAN-14, DPD and Universal Postal Union S10 */
/*
libzint - the open source barcode library
- Copyright (C) 2008-2025 Robin Stuart
+ Copyright (C) 2008-2026 Robin Stuart
Bugfixes thanks to Christian Sakowski and BogDan Vatra
Redistribution and use in source and binary forms, with or without
@@ -94,7 +94,7 @@ static int nve18_or_ean14(struct zint_symbol *symbol, const unsigned char source
error_number = zint_gs1_128(symbol, ean128_equiv, data_len + 5);
- /* Use `raw_text` set by `zint_gs1_128()` */
+ /* Use `content_segs` set by `zint_gs1_128()` */
return error_number;
}
@@ -219,7 +219,7 @@ INTERNAL int zint_dpd(struct zint_symbol *symbol, unsigned char source[], int le
z_hrt_cpy_nochk(symbol, hrt, p + 1);
- /* Use `raw_text` from `zint_code128()` */
+ /* Use `content_segs` from `zint_code128()` */
/* Some compliance checks */
if (z_not_sane(NEON_F, local_source + length - 16, 16)) {
@@ -323,7 +323,7 @@ INTERNAL int zint_upu_s10(struct zint_symbol *symbol, unsigned char source[], in
}
z_hrt_cpy_nochk(symbol, hrt, j);
- /* Use `raw_text` set by `zint_code128()` */
+ /* Use `content_segs` set by `zint_code128()` */
if (symbol->output_options & COMPLIANT_HEIGHT) {
/* Universal Postal Union S10 Section 8, using max X 0.51mm & minimum height 12.5mm or 15% of width */
diff --git a/backend/common.c b/backend/common.c
index 2b7a5200..ae40691b 100644
--- a/backend/common.c
+++ b/backend/common.c
@@ -117,7 +117,7 @@ static const unsigned short flags[256] = {
/* Whether a character `ch` matches `flag` */
INTERNAL int z_is_chr(const unsigned int flag, const unsigned int ch) {
- return z_isascii(ch) && (flags[ch] & flag); /* As passed an int ch need to check it's ASCII */
+ return z_isascii(ch) && (flags[ch] & flag); /* As `ch` passed as an int need to check it's ASCII */
}
/* Verifies if a string only uses valid characters, returning 1-based position in `source` if not, 0 for success */
@@ -780,15 +780,16 @@ INTERNAL int z_utf8_to_unicode(struct zint_symbol *symbol, const unsigned char s
INTERNAL int z_hrt_cpy_iso8859_1(struct zint_symbol *symbol, const unsigned char source[], const int length) {
int i, j;
int warn_number = 0;
+ const int text_size = ARRAY_SIZE(symbol->text);
- for (i = 0, j = 0; i < length && j < ARRAY_SIZE(symbol->text); i++) {
+ for (i = 0, j = 0; i < length && j < text_size; i++) {
if (z_isascii(source[i])) {
symbol->text[j++] = z_iscntrl(source[i]) ? ' ' : source[i];
} else if (source[i] < 0xC0) {
if (source[i] < 0xA0) { /* 0x80-0x9F not valid ISO/IEC 8859-1 */
symbol->text[j++] = ' ';
} else {
- if (j + 2 >= ARRAY_SIZE(symbol->text)) {
+ if (j + 2 >= text_size) {
warn_number = ZINT_WARN_HRT_TRUNCATED;
break;
}
@@ -796,7 +797,7 @@ INTERNAL int z_hrt_cpy_iso8859_1(struct zint_symbol *symbol, const unsigned char
symbol->text[j++] = source[i];
}
} else {
- if (j + 2 >= ARRAY_SIZE(symbol->text)) {
+ if (j + 2 >= text_size) {
warn_number = ZINT_WARN_HRT_TRUNCATED;
break;
}
@@ -804,7 +805,7 @@ INTERNAL int z_hrt_cpy_iso8859_1(struct zint_symbol *symbol, const unsigned char
symbol->text[j++] = source[i] - 0x40;
}
}
- if (j == ARRAY_SIZE(symbol->text)) {
+ if (j == text_size) {
warn_number = ZINT_WARN_HRT_TRUNCATED;
j--;
}
@@ -955,7 +956,7 @@ static int ct_init_seg_source(struct zint_symbol *symbol, const int seg_idx, con
assert(length > 0);
if (!(symbol->content_segs[seg_idx].source = (unsigned char *) malloc((size_t) length))) {
- return z_errtxt(ZINT_ERROR_MEMORY, symbol, 245, "Insufficient memory for content text source buffer");
+ return z_errtxt(ZINT_ERROR_MEMORY, symbol, 245, "Insufficient memory for content segs source buffer");
}
return 0;
}
@@ -1013,6 +1014,9 @@ INTERNAL int z_ct_cpy_cat(struct zint_symbol *symbol, const unsigned char source
if (z_ct_init_segs(symbol, 1 /*seg_count*/) || ct_init_seg_source(symbol, 0 /*seg_idx*/, total_length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_init_segs()` & `ct_init_seg_source()` only fail with OOM */
}
+#ifdef ZINT_SANITIZEM /* Suppress clang-22 -fsanitize=memory false positive (seems unable to track `*s++ =`) */
+ memset(symbol->content_segs[0].source, 0, total_length);
+#endif
s = symbol->content_segs[0].source;
if (length > 0) {
memcpy(s, source, (size_t) length);
@@ -1044,6 +1048,9 @@ INTERNAL int z_ct_cpy_iso8859_1(struct zint_symbol *symbol, const unsigned char
if (z_ct_init_segs(symbol, 1 /*seg_count*/) || ct_init_seg_source(symbol, 0 /*seg_idx*/, length + iso_cnt)) {
return ZINT_ERROR_MEMORY; /* `z_ct_init_segs()` & `ct_init_seg_source()` only fail with OOM */
}
+#ifdef ZINT_SANITIZEM /* Suppress clang-22 -fsanitize=memory false positive (seems unable to track `*s++ =`) */
+ memset(symbol->content_segs[0].source, 0, length + iso_cnt);
+#endif
s = symbol->content_segs[0].source;
for (i = 0; i < length; i++) {
diff --git a/backend/gs1.c b/backend/gs1.c
index 75e5bcec..e3376678 100644
--- a/backend/gs1.c
+++ b/backend/gs1.c
@@ -95,7 +95,7 @@ static int gs1_numeric(const unsigned char *data, int data_len, int offset, int
return 1;
}
-/* GS1 General Specifications 21.0.1 Figure 7.9.5-1. GS1 AI encodable character reference values.
+/* GS1 General Specifications Release 26.0 Table 7-18 GS1 AI encodable character reference values.
Also used to determine if character in set 82 - a value of 82 means not in */
static const char gs1_c82[] = {
/* ! " # $ % & ' ( ) * */
@@ -118,7 +118,8 @@ static const char gs1_c82[] = {
72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
};
-/* Validate of character set 82 (GS1 General Specifications Figure 7.11-1) */
+/* Validate of character set 82
+ (GS1 General Specifications Release 26.0 Table 7-20 GS1 AI encodable character set 82) */
static int gs1_cset82(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no,
int *p_err_posn, char err_msg[50]) {
@@ -144,7 +145,8 @@ static int gs1_cset82(const unsigned char *data, int data_len, int offset, int m
return 1;
}
-/* Validate of character set 39 (GS1 General Specifications Figure 7.11-2) */
+/* Validate of character set 39
+ (GS1 General Specifications Release 26.0 Table 7-21 GS1 AI encodable character set 39) */
static int gs1_cset39(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no,
int *p_err_posn, char err_msg[50]) {
@@ -203,7 +205,8 @@ static int gs1_cset64(const unsigned char *data, int data_len, int offset, int m
return 1;
}
-/* Check a check digit (GS1 General Specifications 7.9.1) */
+/* Check a check digit
+ (GS1 General Specifications Release 26.0 7.9.1 Standard check digit calculations for GS1 data structures) */
static int gs1_csum(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no,
int *p_err_posn, char err_msg[50], const int length_only) {
@@ -237,7 +240,8 @@ static int gs1_csum(const unsigned char *data, int data_len, int offset, int min
return 1;
}
-/* Check alphanumeric check characters (GS1 General Specifications 7.9.5) */
+/* Check alphanumeric check characters
+ (GS1 General Specifications Release 26.0 7.9.5 Check character calculation (for alphanumeric keys)) */
static int gs1_csumalpha(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no,
int *p_err_posn, char err_msg[50], const int length_only) {
@@ -280,7 +284,7 @@ static int gs1_csumalpha(const unsigned char *data, int data_len, int offset, in
#define GS1_GCP_MIN_LENGTH 4 /* Minimum length of GS1 Company Prefix */
-/* Check for a GS1 Prefix (GS1 General Specifications GS1 1.4.2) */
+/* Check for a GS1 Prefix (GS1 General Specifications Release 26.0 1.2.3.3 GS1 Company Prefix) */
static int gs1_gcppos1(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no,
int *p_err_posn, char err_msg[50], const int length_only) {
(void)max;
@@ -406,7 +410,8 @@ static int gs1_yymmd0(const unsigned char *data, int data_len, int offset, int m
if (!length_only && data_len) {
/* For leap year detection, only matters if 00 represents century divisible by 400 or not */
- /* Following good until 2050 when 00 will mean 2100 (GS1 General Specifications 7.12) */
+ /* Following good until 2050 when 00 will mean 2100
+ (GS1 General Specifications Release 26.0 7.12 Determination of century in dates) */
unsigned char buf[8] = { '2', '0' };
memcpy(buf + 2, data + offset, 6);
@@ -697,7 +702,8 @@ static int gs1_yesno(const unsigned char *data, int data_len, int offset, int mi
return 1;
}
-/* Check for importer index (GS1 General Specifications 3.8.17) */
+/* Check for importer index
+ (GS1 General Specifications Release 26.0 3.8.18 GS1 UIC with Extension 1 and Importer index: AI (7040)) */
static int gs1_importeridx(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no,
int *p_err_posn, char err_msg[50], const int length_only) {
(void)max;
@@ -745,7 +751,7 @@ static int gs1_nonzero(const unsigned char *data, int data_len, int offset, int
return 1;
}
-/* Check winding direction (0/1/9) (GS1 General Specifications 3.9.1) */
+/* Check winding direction (0/1/9) (GS1 General Specifications Release 26.0 3.9.1 Roll products) */
static int gs1_winding(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no,
int *p_err_posn, char err_msg[50], const int length_only) {
(void)max;
@@ -789,7 +795,9 @@ static int gs1_zero(const unsigned char *data, int data_len, int offset, int min
return 1;
}
-/* Check piece of a trade item (GS1 General Specifications 3.9.6 and 3.9.17) */
+/* Check piece of a trade item
+ (GS1 General Specifications Release 26.0 3.9.6 Identification of an individual trade item piece
+ and 3.9.18 Identification of pieces of a trade item (ITIP) contained in a logistic unit) */
static int gs1_pieceoftotal(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no,
int *p_err_posn, char err_msg[50], const int length_only) {
(void)max;
@@ -914,8 +922,8 @@ static int gs1_nozeroprefix(const unsigned char *data, int data_len, int offset,
}
if (!length_only && data_len) {
- /* GS1 General Specifications 3.9.11 "The C/P serial number SHALL NOT begin with a "0" digit, unless the
- entire serial number consists of the single digit '0'." */
+ /* GS1 General Specifications Release 26.0 3.9.11 "The C/P serial number SHALL NOT begin with a "0" digit,
+ unless the entire serial number consists of the single digit '0'." */
if (data[0] == '0' && data_len != 1) {
*p_err_no = 3;
*p_err_posn = offset + 1;
@@ -1609,34 +1617,72 @@ static int gs1_packagetype(const unsigned char *data, int data_len, int offset,
return 1;
}
+/* Helper to say if AI pointed to by `source` has predefined length according to GS1 General Specifications 26.0
+ Figure 7-6 "Element strings with predefined length using GS1 Application Identifiers" */
+static int gs1_predefined_len(const unsigned char source[]) {
+ const int ai2 = z_to_int(source, 2); /* First 2 digits */
+
+ /* NOTE: previously allowed legacy 23, removed 2026-02-26 */
+ return (ai2 >= 0 && ai2 <= 4) || (ai2 >= 11 && ai2 <= 20) || (ai2 >= 31 && ai2 <= 36) || ai2 == 41;
+}
+
/* Generated by "php backend/tools/gen_gs1_linter.php > backend/gs1_lint.h" */
#include "gs1_lint.h"
+#ifdef ZINT_TEST /* Wrapper for direct testing */
+INTERNAL int zint_test_gs1_lint_parse_raw_caret(const unsigned char source[], const int length,
+ const int ai_max, int *ai_vals, int *ai_locs, int *data_locs, int *data_lens, int *p_ai_count,
+ int *p_err_no, int *p_err_posn) {
+ return gs1_lint_parse_raw_caret(source, length,
+ ai_max, ai_vals, ai_locs, data_locs, data_lens, p_ai_count, p_err_no, p_err_posn);
+}
+#endif
+
/* Whether starts with Digital Link URI */
static int gs1_is_digital_link(const unsigned char *source, const int length) {
- return (length >= 8 && (memcmp(source, "https://", 8) == 0 || memcmp(source, "HTTPS://", 8) == 0))
- || (length >= 7 && (memcmp(source, "http://", 7) == 0 || memcmp(source, "HTTP://", 7) == 0));
+ return length >= 7 && (memcmp(source, "http://", 7) == 0 || memcmp(source, "HTTP://", 7) == 0
+ || (length >= 8 && (memcmp(source, "https://", 8) == 0
+ || memcmp(source, "HTTPS://", 8) == 0)));
}
/* If built with GS1 Syntax Engine library */
#ifdef ZINT_HAVE_GS1SE
+/* Helper to set `errtxt` on internal error and exit, freeing `ctx` */
+static int gs1se_internal_errtxt(struct zint_symbol *symbol, const int err_id, gs1_encoder *ctx) {
+ const char *errmsg = gs1_encoder_getErrMsg(ctx);
+ z_errtxtf(0, symbol, err_id, "Internal error using GS1 Syntax Engine: %.80s", *errmsg ? errmsg : "unknown");
+ gs1_encoder_free(ctx);
+ return ZINT_ERROR_ENCODING_PROBLEM;
+}
+
+/* Helper to replace GSs with carets */
+static void gs1se_gs_caret_sub(const unsigned char *src, const int length, unsigned char *dst) {
+ int i;
+ for (i = 0; i < length; i++) {
+ dst[i] = src[i] == '\x1D' ? '^' : src[i];
+ }
+ dst[length] = '\0';
+}
+
/* Use GS1 Syntax Engine to verify */
static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[], const int length,
unsigned char reduced[], int *p_reduced_length) {
int i, j;
- const int is_composite = z_is_composite(symbol->symbology);
- const int primary_len = is_composite ? (int) strlen(symbol->primary) : 0;
+ const int primary_len = z_is_composite(symbol->symbology) ? (int) strlen(symbol->primary) : 0;
const int gs1parens_mode = symbol->input_mode & GS1PARENS_MODE;
- const char obracket = gs1parens_mode ? '(' : '[';
- const int parens_cnt = !gs1parens_mode ? z_chr_cnt(source, length, '(') : 0;
+ const int gs1raw_mode = !!(symbol->input_mode & GS1RAW_MODE);
+ const int gs1_caret = source[0] == '^';
+ const int is_digital_link = !primary_len && !gs1_caret && gs1_is_digital_link(source, length);
+ const int parens_cnt = !gs1parens_mode && !gs1raw_mode && !gs1_caret ? z_chr_cnt(source, length, '(') : 0;
+
int local_length = length;
const unsigned char *local_source = source;
const unsigned char *local_source2 = source;
- unsigned char *local_source_buf = (unsigned char *) z_alloca(ARRAY_SIZE(symbol->primary) + length + 1);
+ unsigned char *local_source_buf = (unsigned char *) z_alloca(ARRAY_SIZE(symbol->primary) + 4 + length + 1);
unsigned char *local_source2_buf = (unsigned char *) z_alloca(ARRAY_SIZE(symbol->primary) * 2 + length
+ parens_cnt + 1);
- int is_digital_link = 0;
+ int linear_len = 0;
char msgBuf[120];
gs1_encoder_init_status_t status = GS1_ENCODERS_INIT_SUCCESS;
gs1_encoder_init_opts_t opts = {
@@ -1646,35 +1692,89 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
gs1_encoder *ctx;
int gs1se_ret;
+ if (length < 2 + gs1_caret) {
+ return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 802, "Data does not start with an AI");
+ }
+
+ /* Only matrix symbols can encode Digital Link URIs */
+ if (is_digital_link && !z_is_fixed_ratio(symbol->symbology)) {
+ return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 264, "Data does not start with an AI");
+ }
+
/* Need "linear|composite" format to check required AIs */
- if (is_composite && primary_len) {
+ if (primary_len) {
if (symbol->symbology == BARCODE_GS1_128_CC || symbol->symbology == BARCODE_DBAR_EXP_CC
|| symbol->symbology == BARCODE_DBAR_EXPSTK_CC) {
- memcpy(local_source_buf, symbol->primary, primary_len);
- local_source_buf[primary_len] = '|';
- memcpy(local_source_buf + 1 + primary_len, source, length + 1); /* Include terminating NUL */
- local_length += 1 + primary_len;
+ /* These take GS1 data in the linear part */
+ if (gs1raw_mode) {
+ /* Need to add initial carets */
+ local_source_buf[0] = '^';
+ local_length = 1;
+ if (symbol->primary[0] == '\x1D') { /* Allow initial GS */
+ gs1se_gs_caret_sub(ZCUCP(symbol->primary + 1), primary_len - 1, local_source_buf + 1); /* Linear GSs */
+ local_length += primary_len - 1;
+ } else {
+ gs1se_gs_caret_sub(ZCUCP(symbol->primary), primary_len, local_source_buf + 1); /* Linear GSs */
+ local_length += primary_len;
+ }
+ local_source_buf[local_length++] = '|';
+ local_source_buf[local_length++] = '^';
+ if (source[0] == '\x1D') { /* Allow initial GS */
+ gs1se_gs_caret_sub(source + 1, length - 1, local_source_buf + primary_len + 3); /* CC GSs */
+ local_length += length - 1;
+ } else {
+ gs1se_gs_caret_sub(source, length, local_source_buf + primary_len + 3); /* CC GSs */
+ local_length += length;
+ }
+ linear_len = primary_len;
+ } else {
+ memcpy(local_source_buf, symbol->primary, primary_len);
+ local_source_buf[primary_len] = '|';
+ memcpy(local_source_buf + primary_len + 1, source, length + 1); /* Include terminating NUL */
+ local_length += primary_len + 1;
+ linear_len = primary_len - 1; /* Only actual linear data counts - exclude initial caret */
+ }
} else {
/* Just use dummy "01" linear */
- memcpy(local_source_buf, gs1parens_mode ? "(01)12345678901231|" : "[01]12345678901231|", 19);
- memcpy(local_source_buf + 19, source, length + 1); /* Include terminating NUL */
- local_length += 19;
+ if (gs1_caret || gs1raw_mode) {
+ memcpy(local_source_buf, "^0112345678901231|^", 18 + gs1raw_mode);
+ if (gs1_caret) {
+ memcpy(local_source_buf + 18, source, length + 1); /* Include terminating NUL */
+ } else {
+ gs1se_gs_caret_sub(source, length, local_source_buf + 19);
+ }
+ local_length += 18 + gs1raw_mode;
+ } else {
+ memcpy(local_source_buf, gs1parens_mode ? "(01)12345678901231|" : "[01]12345678901231|", 19);
+ memcpy(local_source_buf + 19, source, length + 1); /* Include terminating NUL */
+ local_length += 19;
+ }
+ linear_len = 16; /* Only actual linear data "0112345678901231" counts */
+ }
+ local_source = local_source_buf;
+ local_source2 = local_source_buf;
+ } else if (gs1raw_mode && !is_digital_link) {
+ if (symbol->symbology == BARCODE_GS1_128 || symbol->symbology == BARCODE_DBAR_EXP
+ || symbol->symbology == BARCODE_DBAR_EXPSTK || z_is_fixed_ratio(symbol->symbology)
+ || symbol->symbology == BARCODE_CODABLOCKF) { /* Codablock-F will be GS1-enabled in the future */
+ /* Prefix caret */
+ local_source_buf[0] = '^';
+ if (source[0] == '\x1D') { /* Allow initial GS */
+ gs1se_gs_caret_sub(source + 1, length - 1, local_source_buf + 1);
+ } else {
+ gs1se_gs_caret_sub(source, length, local_source_buf + 1);
+ local_length++;
+ }
+ } else {
+ /* Just copy over */
+ memcpy(local_source_buf, source, length + 1); /* Include terminating NULL */
}
local_source = local_source_buf;
local_source2 = local_source_buf;
}
- if (local_source[0] != obracket) {
- if (!z_is_fixed_ratio(symbol->symbology)) { /* Only matrix symbols can encode Digital Link URIs */
- return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 264, "Data does not start with an AI");
- }
- if (!(is_digital_link = gs1_is_digital_link(local_source, local_length))) {
- return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 265,
- "Data does not start with an AI or a Digital Link URI");
- }
- }
-
- if (!is_digital_link) {
+ if (!is_digital_link && !gs1raw_mode && !gs1_caret) {
+ assert(local_length > 0);
/* Convert to GS1 Syntax Engine parenthesis mode */
if (!gs1parens_mode) {
/* Replace '[' and ']' with '(' and ')' & escape any data opening parentheses (not closing parentheses) */
@@ -1711,19 +1811,20 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
if (!(ctx = gs1_encoder_init_ex(NULL /*mem*/, &opts))) {
const int error_number = status == GS1_ENCODERS_INIT_FAILED_NO_MEM
? ZINT_ERROR_MEMORY : ZINT_ERROR_ENCODING_PROBLEM;
- return z_errtxtf(error_number, symbol, 266, "GS1 Syntax Engine: %s", opts.msgBuf);
+ return z_errtxtf(error_number, symbol, 266, "Failed to initialize GS1 Syntax Engine: %.80s",
+ *opts.msgBuf ? opts.msgBuf : "unknown error");
}
/* Do not check for required checks for GS1-128 as may be spread across multiple barcodes - ticket #348
and https://github.com/gs1/gs1-syntax-dictionary/issues/24 */
if (symbol->symbology == BARCODE_GS1_128) {
if (!gs1_encoder_setValidationEnabled(ctx, gs1_encoder_vREQUISITE_AIS, false)) {
- const char *errmsg = gs1_encoder_getErrMsg(ctx);
- return z_errtxtf(ZINT_ERROR_ENCODING_PROBLEM, symbol, 0, "Internal error using GS1SE: %.80s",
- errmsg ? errmsg : "unknown");
+ return gs1se_internal_errtxt(symbol, 0 /*err_id*/, ctx);
}
}
- if (is_digital_link) {
+ if (is_digital_link || gs1raw_mode || gs1_caret) {
+ /* Required for `gs1_encoder_getScanData()` */
+ gs1_encoder_setSym(ctx, primary_len ? gs1_encoder_sGS1_128_CCA : gs1_encoder_sDM);
gs1se_ret = gs1_encoder_setDataStr(ctx, ZCCP(local_source2));
} else {
gs1se_ret = gs1_encoder_setAIdataStr(ctx, ZCCP(local_source2));
@@ -1733,81 +1834,285 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
const int errmsg_len = (int) strlen(errmsg);
const char *errmarkup = gs1_encoder_getErrMarkup(ctx);
int errmarkup_len = (int) strlen(errmarkup);
- if (errmarkup_len && errmsg_len + 1 + errmarkup_len < ARRAY_SIZE(symbol->errtxt)) {
+ int errtxt_set = 0;
+ if (errmsg_len && errmarkup_len && errmsg_len + 1 + errmarkup_len < ARRAY_SIZE(symbol->errtxt)) {
char *local_errmarkup = (char *) z_alloca(errmarkup_len * 4 + 1);
z_debug_print_escape(ZCUCP(errmarkup), errmarkup_len, local_errmarkup);
errmarkup_len = (int) strlen(local_errmarkup);
if (errmsg_len + 1 + errmarkup_len < ARRAY_SIZE(symbol->errtxt)) {
ZEXT z_errtxtf(0, symbol, 267, "%1$s %2$s", errmsg, local_errmarkup);
- } else {
- z_errtxt(0, symbol, 268, errmsg);
+ errtxt_set = 1;
}
- } else {
- z_errtxt(0, symbol, 268, errmsg);
+ }
+ if (!errtxt_set) {
+ z_errtxt(0, symbol, 268, *errmsg ? errmsg : "Unknown error using GS1 Syntax Engine");
}
gs1_encoder_free(ctx);
return ZINT_ERROR_INVALID_DATA;
}
- /* If Digital Link, set `reduced` */
- if (is_digital_link) {
+ /* If Digital Link or raw/caret mode, set `reduced` */
+ if (is_digital_link || gs1raw_mode || gs1_caret) {
const char *scan_data;
-
- gs1_encoder_setSym(ctx, gs1_encoder_sDM); /* Required for `gs1_encoder_getScanData()` */
+ int reduced_length;
if (!(scan_data = gs1_encoder_getScanData(ctx))) { /* Shouldn't happen */
- const char *errmsg = gs1_encoder_getErrMsg(ctx);
- z_errtxt(0, symbol, 269, strlen(errmsg) ? errmsg : "Internal error");
- gs1_encoder_free(ctx);
- return ZINT_ERROR_ENCODING_PROBLEM;
+ return gs1se_internal_errtxt(symbol, 269 /*err_id*/, ctx);
}
- *p_reduced_length = (int) strlen(scan_data);
+ reduced_length = (int) strlen(scan_data);
/* Skip over Symbology Identifier */
- if (*p_reduced_length >= 3 && scan_data[0] == ']') {
+ if (reduced_length >= 3 && scan_data[0] == ']') {
scan_data += 3;
- *p_reduced_length -= 3;
+ reduced_length -= 3;
}
+ /* Skip over any linear stuff */
+ if (linear_len) {
+ scan_data += linear_len;
+ reduced_length -= linear_len;
+ /* Need to check if the last linear AI was non-predefined length, when a GS is added */
+ if (*scan_data == '\x1D') { /* Skip */
+ scan_data++;
+ reduced_length--;
+ }
+ }
+ assert(reduced_length <= length);
- memcpy(reduced, scan_data, *p_reduced_length + 1); /* Include terminating NUL */
+ memcpy(reduced, scan_data, reduced_length + 1); /* Include terminating NUL */
+ reduced[reduced_length] = '\0';
+ *p_reduced_length = reduced_length;
} else {
- *p_reduced_length = 0; /* Not Digital Link & `reduced` not set */
+ *p_reduced_length = 0; /* `reduced` not set */
}
gs1_encoder_free(ctx);
return 0;
}
+
#endif /* ZINT_HAVE_GS1SE */
+/* Check for valid AI values and data lengths according to GS1 General Specifications Release 26, January 2026 */
+static int gs1_run_lint(struct zint_symbol *symbol, const unsigned char source[], const int ai_count,
+ int *ai_vals, int *ai_locs, int *data_locs, int *data_lens) {
+ int i;
+ int error_number = 0;
+
+ for (i = 0; i < ai_count; i++) {
+ int err_no, err_posn;
+ char err_msg[50];
+ if (!gs1_lint(ai_vals[i], source + data_locs[i], data_lens[i], &err_no, &err_posn,
+ err_msg)) {
+ if (err_no == 1) {
+ ZEXT z_errtxtf(0, symbol, 260, "Invalid AI (%1$02d) at position %2$d",
+ ai_vals[i], ai_locs[i] + 1);
+ } else if (err_no == 2 || err_no == 4) { /* 4 is backward-incompatible bad length */
+ ZEXT z_errtxtf(0, symbol, 259, "Invalid data length for AI (%1$02d) at position %2$d",
+ ai_vals[i], ai_locs[i] + 1);
+ } else {
+ ZEXT z_errtxtf(0, symbol, 261, "AI (%1$02d) data position %2$d: %3$s", ai_vals[i], err_posn, err_msg);
+ }
+ /* For backward compatibility only error on unknown AI or bad length */
+ if (err_no == 1 || err_no == 2) {
+ return ZINT_ERROR_INVALID_DATA;
+ }
+ error_number = ZINT_WARN_NONCOMPLIANT;
+ }
+ }
+ return error_number;
+}
+
+/* Helper to convert parsed AIs to HRT */
+static int gs1_hrt_conv_parsed(struct zint_symbol *symbol, const unsigned char source[], const int length,
+ const int ai_count, const int *ai_vals, const int *ai_locs, const int *data_locs, const int *data_lens,
+ const int no_errtxt) {
+ int i, j;
+ int warn_number = 0;
+ const int text_size = ARRAY_SIZE(symbol->text);
+#ifdef NDEBUG
+ (void)length;
+#endif
+
+ for (i = 0, j = 0; i < ai_count && j < text_size; i++) {
+ const int ai_len = 2 + (ai_vals[i] >= 100) + (ai_vals[i] >= 1000);
+ if (j + 1 + ai_len + 1 + data_lens[i] >= text_size) {
+ warn_number = ZINT_WARN_HRT_TRUNCATED;
+ break;
+ }
+ symbol->text[j++] = '(';
+ memcpy(symbol->text + j, source + ai_locs[i], ai_len);
+ j += ai_len;
+ symbol->text[j++] = ')';
+ assert(data_locs[i] + data_lens[i] <= length);
+ memcpy(symbol->text + j, source + data_locs[i], data_lens[i]);
+ j += data_lens[i];
+ }
+
+ if (j == text_size) {
+ warn_number = ZINT_WARN_HRT_TRUNCATED;
+ j--;
+ }
+ symbol->text_length = j;
+ symbol->text[j] = '\0';
+
+ if (warn_number && !no_errtxt) {
+ z_errtxt(0, symbol, 799, "Human Readable Text truncated");
+ }
+ return warn_number;
+
+}
+
+#ifdef ZINT_TEST /* Wrapper for direct testing */
+INTERNAL int zint_test_gs1_hrt_conv_parsed(struct zint_symbol *symbol, const unsigned char source[], const int length,
+ const int ai_count, const int *ai_vals, const int *ai_locs, const int *data_locs, const int *data_lens,
+ const int no_errtxt) {
+ return gs1_hrt_conv_parsed(symbol, source, length, ai_count, ai_vals, ai_locs, data_locs, data_lens,
+ no_errtxt);
+}
+#endif
+
+/* Helper to set HRT when have GS1PARENS_MODE - truncates if too long for HRT buffer */
+static int gs1_hrt_cpy(struct zint_symbol *symbol, const unsigned char source[], const int length,
+ const int no_errtxt) {
+ int warn_number;
+ const int text_size = ARRAY_SIZE(symbol->text);
+
+ assert(symbol->input_mode & GS1PARENS_MODE);
+ assert(source[0] == '(');
+
+ if (length < text_size) {
+ memcpy(symbol->text, source, length + 1); /* Include terminating NUL */
+ symbol->text_length = length;
+ warn_number = 0;
+ } else {
+ /* Find last full AI - need to scan forward to track escaped opening parens */
+ int i, last_opening_bracket = 0;
+ for (i = 0; i < text_size; i++) {
+ if (source[i] == '\\' && i + 1 < length && (source[i + 1] == '\\' || source[i + 1] == '(')) {
+ i++;
+ } else if (source[i] == '(') {
+ last_opening_bracket = i;
+ }
+ }
+ if (text_size < length && source[text_size] == '(') {
+ /* Finished at end of AI data */
+ memcpy(symbol->text, source, text_size - 1);
+ symbol->text_length = text_size - 1;
+ symbol->text[text_size - 1] = '\0';
+ } else {
+ /* Use last full AI + data */
+ memcpy(symbol->text, source, last_opening_bracket);
+ symbol->text_length = last_opening_bracket;
+ symbol->text[last_opening_bracket] = '\0';
+ }
+ warn_number = ZINT_WARN_HRT_TRUNCATED;
+ if (!no_errtxt) {
+ z_errtxt(0, symbol, 801, "Human Readable Text truncated");
+ }
+ }
+ return warn_number;
+}
+
+#ifdef ZINT_TEST /* Wrapper for direct testing */
+INTERNAL int zint_test_gs1_hrt_cpy(struct zint_symbol *symbol, const unsigned char source[], const int length,
+ const int no_errtxt) {
+ return gs1_hrt_cpy(symbol, source, length, no_errtxt);
+}
+#endif
+
+/* Helper to set HRT when don't have GS1PARENS_MODE - substitutes square brackets with parentheses
+ & truncates if too long for HRT buffer */
+static int gs1_hrt_conv_brackets(struct zint_symbol *symbol, const unsigned char source[], const int length,
+ const int no_errtxt) {
+ int i;
+ int warn_number = 0;
+ int bracket_level = 0; /* Non-compliant closing square brackets may be in text */
+ int last_opening_bracket = 0;
+ const int text_size = ARRAY_SIZE(symbol->text);
+ const int max_len = length > text_size ? text_size : length;
+
+ assert((symbol->input_mode & GS1PARENS_MODE) == 0);
+ assert(source[0] == '[');
+
+ for (i = 0; i < max_len; i++) {
+ if (source[i] == '[') {
+ symbol->text[i] = '(';
+ bracket_level++;
+ last_opening_bracket = i;
+ } else if (source[i] == ']' && bracket_level) {
+ symbol->text[i] = ')';
+ bracket_level--;
+ } else {
+ symbol->text[i] = source[i];
+ }
+ }
+ if (i == text_size) {
+ i--;
+ if (source[i] != '[') {
+ i = last_opening_bracket;
+ }
+ warn_number = ZINT_WARN_HRT_TRUNCATED;
+ }
+ symbol->text_length = i;
+ symbol->text[i] = '\0';
+
+ if (warn_number && !no_errtxt) {
+ z_errtxt(0, symbol, 798, "Human Readable Text truncated");
+ }
+ return warn_number;
+}
+
+#ifdef ZINT_TEST /* Wrapper for direct testing */
+INTERNAL int zint_test_gs1_hrt_conv_brackets(struct zint_symbol *symbol, const unsigned char source[],
+ const int length, const int no_errtxt) {
+ return gs1_hrt_conv_brackets(symbol, source, length, no_errtxt);
+}
+#endif
+
#define GS1_PARENS_PLACEHOLDER_MASK 0x20 /* Mask `(` or `)` by this if escaped (get BS (\x08) or HT (\x09)) */
+/* Helper to re-instate escaped parentheses */
+static void gs1_reinstate_escaped_parens(unsigned char source[], const int length) {
+ int i;
+ for (i = 0; i < length; i++) {
+ if (source[i] < '\x1D') {
+ source[i] |= GS1_PARENS_PLACEHOLDER_MASK;
+ }
+ }
+}
+
/* Verify a GS1 input string */
INTERNAL int zint_gs1_verify(struct zint_symbol *symbol, const unsigned char source[], const int length,
- unsigned char reduced[], int *p_reduced_length) {
+ unsigned char reduced[], int *p_reduced_length, const int set_hrt) {
int i, j;
- int error_number = 0;
+ int error_number = 0, warn_number = 0;
int bracket_level = 0;
int ai_latch;
int local_length = length;
const unsigned char *local_source = source;
unsigned char *local_source_buf = (unsigned char *) z_alloca(length + 1);
+ int *ai_vals, *ai_locs, *data_locs, *data_lens;
+
const int gs1parens_mode = symbol->input_mode & GS1PARENS_MODE;
const char obracket = gs1parens_mode ? '(' : '[';
const char cbracket = gs1parens_mode ? ')' : ']';
int done_gs1se = 0;
int is_digital_link = 0; /* Is Digital Link? */
+ const int gs1raw_mode = symbol->input_mode & GS1RAW_MODE;
+ const int gs1nocheck_mode = symbol->input_mode & GS1NOCHECK_MODE;
/* Note: Digital Link URIs only validated if have GS1 Syntax Engine and GS1SYNTAXENGINE_MODE set */
+ *p_reduced_length = 0;
+
#ifdef ZINT_HAVE_GS1SE
- if ((symbol->input_mode & GS1SYNTAXENGINE_MODE) && !(symbol->input_mode & GS1NOCHECK_MODE)) {
+ if ((symbol->input_mode & GS1SYNTAXENGINE_MODE) && !gs1nocheck_mode) {
/* Strict verification */
if ((error_number = gs1se_verify(symbol, source, length, reduced, p_reduced_length))) {
return error_number;
}
done_gs1se = 1;
- is_digital_link = *p_reduced_length != 0; /* `p_reduced_length` will be set if Digital Link */
+ /* `p_reduced_length` will be set if Digital Link or raw/caret */
}
#endif
@@ -1821,7 +2126,7 @@ INTERNAL int zint_gs1_verify(struct zint_symbol *symbol, const unsigned char sou
if (source[i] == '\0') {
return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 262, "NUL characters not permitted in GS1 mode");
}
- if (source[i] < 32) {
+ if (source[i] < 32 && (!gs1raw_mode || source[i] != '\x1D')) {
return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 251, "Control characters are not supported by GS1");
}
if (source[i] == 127) {
@@ -1829,24 +2134,90 @@ INTERNAL int zint_gs1_verify(struct zint_symbol *symbol, const unsigned char sou
}
}
+ is_digital_link = gs1_is_digital_link(source, length);
+
+ if (source[0] != obracket && !is_digital_link && (gs1raw_mode || source[0] == '^')) {
+ int ai_count;
+ int err_no, err_posn;
+ const int ai_max = (length + 2) / 3 + 1; /* Min AI 2, min data 1 */
+
+ ai_vals = (int *) z_alloca(sizeof(int) * ai_max);
+ ai_locs = (int *) z_alloca(sizeof(int) * ai_max);
+ data_locs = (int *) z_alloca(sizeof(int) * ai_max);
+ data_lens = (int *) z_alloca(sizeof(int) * ai_max);
+ if (!gs1_lint_parse_raw_caret(source, length, ai_max, ai_vals, ai_locs, data_locs, data_lens, &ai_count,
+ &err_no, &err_posn)) {
+ /* Both raw & caret modes require valid AIs and underlong data lengths to work, so check regardless of
+ GS1NOCHECK_MODE */
+ if (err_no == 1) {
+ if (ai_vals[ai_count] != -1) {
+ ZEXT z_errtxtf(0, symbol, 856, "Invalid AI (%1$02d) at position %2$d", ai_vals[ai_count],
+ err_posn);
+ } else {
+ z_errtxtf(0, symbol, 857, "Invalid AI at position %d", err_posn);
+ }
+ } else {
+ assert(err_no == 2);
+ if (data_lens[ai_count] == 0) {
+ ZEXT z_errtxtf(0, symbol, 858, "Empty data field for AI (%1$02d) at position %2$d",
+ ai_vals[ai_count], err_posn);
+ } else {
+ ZEXT z_errtxtf(0, symbol, 859, "Invalid data length for AI (%1$02d) at position %2$d",
+ ai_vals[ai_count], err_posn);
+ }
+ }
+ return ZINT_ERROR_INVALID_DATA;
+ }
+ assert(ai_count < ai_max); /* Suppress clang-tidy-22 clang-analyzer-security.ArrayBound */
+ if (!gs1nocheck_mode) {
+ /* Do lint to check that data values are ok */
+ error_number = gs1_run_lint(symbol, source, ai_count, ai_vals, ai_locs, data_locs, data_lens);
+ if (error_number >= ZINT_ERROR) {
+ return error_number;
+ }
+ }
+
+ if (set_hrt) {
+ warn_number = gs1_hrt_conv_parsed(symbol, source, length, ai_count, ai_vals, ai_locs, data_locs,
+ data_lens, error_number != 0 /*no_errtxt*/);
+ }
+
+ /* Set reduced - need to set it via `ai_vals` etc. so as to lose any superfluous carets/GSs */
+ for (i = 0, j = 0; i < ai_count; i++) {
+ const int ai_len = 2 + (ai_vals[i] >= 100) + (ai_vals[i] >= 1000);
+ memcpy(reduced + j, source + ai_locs[i], ai_len);
+ j += ai_len;
+ memcpy(reduced + j, source + data_locs[i], data_lens[i]);
+ j += data_lens[i];
+ if (i + 1 != ai_count && !gs1_predefined_len(source + ai_locs[i])) {
+ reduced[j++] = '\x1D';
+ }
+ }
+ reduced[j] = '\0';
+ *p_reduced_length = j;
+ return error_number ? error_number : warn_number;
+ }
if (source[0] != obracket) {
if (!z_is_fixed_ratio(symbol->symbology)) { /* Only matrix symbols can encode Digital Link URIs */
return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 252, "Data does not start with an AI");
}
- if (!(is_digital_link = gs1_is_digital_link(source, length))) {
+ if (!is_digital_link) {
return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 855,
"Data does not start with an AI or Digital Link URI");
}
}
}
- if (is_digital_link) {
+ if (is_digital_link || (done_gs1se && *p_reduced_length)) {
if (!done_gs1se) {
/* Just copy over Digital Link URI - no verification */
memcpy(reduced, source, length + 1); /* Include terminating NUL */
*p_reduced_length = length;
+ if (set_hrt) {
+ error_number = z_hrt_cpy_iso8859_1(symbol, source, length);
+ }
}
- return 0;
+ return error_number;
}
if (gs1parens_mode) {
@@ -1881,10 +2252,11 @@ INTERNAL int zint_gs1_verify(struct zint_symbol *symbol, const unsigned char sou
int ai_zero_len_no_data = 0, ai_single_digit = 0, ai_nonnumeric = 0;
int ai_nonnumeric_pos = 0; /* Suppress gcc 14 "-Wmaybe-uninitialized" false positive */
const int ai_max = z_chr_cnt(local_source, local_length, obracket) + 1; /* Plus 1 so non-zero */
- int *ai_value = (int *) z_alloca(sizeof(int) * ai_max);
- int *ai_location = (int *) z_alloca(sizeof(int) * ai_max);
- int *data_location = (int *) z_alloca(sizeof(int) * ai_max);
- int *data_length = (int *) z_alloca(sizeof(int) * ai_max);
+
+ ai_vals = (int *) z_alloca(sizeof(int) * ai_max);
+ ai_locs = (int *) z_alloca(sizeof(int) * ai_max);
+ data_locs = (int *) z_alloca(sizeof(int) * ai_max);
+ data_lens = (int *) z_alloca(sizeof(int) * ai_max);
/* Check the balance of the brackets & AI lengths */
ai_latch = 0;
@@ -1941,7 +2313,7 @@ INTERNAL int zint_gs1_verify(struct zint_symbol *symbol, const unsigned char sou
if (min_ai_length <= 1) {
/* Allow too short AI if GS1NOCHECK_MODE and no single-digit AIs and all zero-length AIs have some data
- permits dummy "[]" workaround for ticket #204 data with no valid AI */
- if (!(symbol->input_mode & GS1NOCHECK_MODE) || ai_single_digit || ai_zero_len_no_data) {
+ if (!gs1nocheck_mode || ai_single_digit || ai_zero_len_no_data) {
/* AI is too short */
return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 256,
"Invalid AI at position %d in input (AI too short)", min_ai_pos);
@@ -1954,36 +2326,32 @@ INTERNAL int zint_gs1_verify(struct zint_symbol *symbol, const unsigned char sou
"Invalid AI at position %d in input (non-numeric characters in AI)", ai_nonnumeric_pos);
}
- if (!(symbol->input_mode & GS1NOCHECK_MODE)) {
+ if (!gs1nocheck_mode) {
const unsigned char *local_source2 = local_source;
unsigned char *local_source2_buf = (unsigned char *) z_alloca(local_length + 1);
int ai_count = 0;
for (i = 1; i < local_length; i++) {
if (local_source[i - 1] == obracket) {
- ai_location[ai_count] = i;
+ ai_locs[ai_count] = i - 1;
for (j = 1; local_source[i + j] != cbracket; j++);
- ai_value[ai_count] = z_to_int(local_source + i, j);
+ ai_vals[ai_count] = z_to_int(local_source + i, j);
ai_count++;
i += j;
}
}
for (i = 0; i < ai_count; i++) {
- if (ai_value[i] >= 1000) {
- data_location[i] = ai_location[i] + 5;
- } else if (ai_value[i] >= 100) {
- data_location[i] = ai_location[i] + 4;
- } else {
- data_location[i] = ai_location[i] + 3;
+ data_locs[i] = ai_locs[i] + 2 /*brackets*/ + 2 + (ai_vals[i] >= 100) + (ai_vals[i] >= 1000);
+ data_lens[i] = 0;
+ while (data_locs[i] + data_lens[i] < local_length
+ && local_source[data_locs[i] + data_lens[i]] != obracket) {
+ data_lens[i]++;
}
- data_length[i] = 0;
- while (data_location[i] + data_length[i] < local_length
- && local_source[data_location[i] + data_length[i]] != obracket) {
- data_length[i]++;
- }
- if (data_length[i] == 0) {
+ if (data_lens[i] == 0) {
/* No data for given AI */
- return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 258, "Empty data field in input");
+ return ZEXT z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 258,
+ "Empty data field for AI (%1$02d) at position %2$d",
+ ai_vals[i], ai_locs[i] + 1);
}
}
@@ -1991,82 +2359,54 @@ INTERNAL int zint_gs1_verify(struct zint_symbol *symbol, const unsigned char sou
/* Temporarily re-instate escaped parentheses before linting */
local_source2 = local_source2_buf;
memcpy(local_source2_buf, local_source, local_length + 1); /* Include terminating NUL */
- for (i = 0; i < local_length; i++) {
- if (local_source2_buf[i] < '\x1D') {
- local_source2_buf[i] |= GS1_PARENS_PLACEHOLDER_MASK;
- }
- }
+ gs1_reinstate_escaped_parens(local_source2_buf, local_length);
}
- /* Check for valid AI values and data lengths according to GS1 General
- Specifications Release 25, January 2025 */
- for (i = 0; i < ai_count; i++) {
- int err_no, err_posn;
- char err_msg[50];
- if (!gs1_lint(ai_value[i], local_source2 + data_location[i], data_length[i], &err_no, &err_posn,
- err_msg)) {
- if (err_no == 1) {
- z_errtxtf(0, symbol, 260, "Invalid AI (%02d)", ai_value[i]);
- } else if (err_no == 2 || err_no == 4) { /* 4 is backward-incompatible bad length */
- z_errtxtf(0, symbol, 259, "Invalid data length for AI (%02d)", ai_value[i]);
- } else {
- ZEXT z_errtxtf(0, symbol, 261, "AI (%1$02d) position %2$d: %3$s", ai_value[i], err_posn,
- err_msg);
- }
- /* For backward compatibility only error on unknown AI or bad length */
- if (err_no == 1 || err_no == 2) {
- return ZINT_ERROR_INVALID_DATA;
- }
- error_number = ZINT_WARN_NONCOMPLIANT;
- }
+ /* Check AI/data */
+ error_number = gs1_run_lint(symbol, local_source2, ai_count, ai_vals, ai_locs, data_locs, data_lens);
+ if (error_number >= ZINT_ERROR) {
+ return error_number;
}
}
}
- /* Resolve AI data - put resulting string in 'reduced' */
- j = 0;
- ai_latch = 1;
- for (i = 0; i < local_length; i++) {
- if (local_source[i] == obracket) {
- bracket_level++;
- /* Start of an AI string */
- if (ai_latch == 0) {
- reduced[j++] = '\x1D';
- }
- if (i + 1 != local_length) {
- int last_ai = z_to_int(local_source + i + 1, 2);
- ai_latch = 0;
- /* The following values from GS1 General Specifications Release 25.0
- Figure 7.8.5-2 "Element strings with predefined length using GS1 Application Identifiers" */
- if ((last_ai >= 0 && last_ai <= 4) || (last_ai >= 11 && last_ai <= 20)
- /* NOTE: as noted by Terry Burton the following complies with ISO/IEC 24724:2011 Table
- D.1, but clashes with TPX AI [235], introduced May 2019; awaiting feedback from GS1 */
- || last_ai == 23 /* legacy support */ /* TODO: probably remove */
- || (last_ai >= 31 && last_ai <= 36) || last_ai == 41) {
- ai_latch = 1;
+ if (!*p_reduced_length) {
+ /* Resolve AI data - put resulting string in `reduced` */
+ j = 0;
+ ai_latch = 1;
+ for (i = 0; i < local_length; i++) {
+ if (local_source[i] == obracket) {
+ bracket_level++;
+ /* Start of an AI string */
+ if (ai_latch == 0) {
+ reduced[j++] = '\x1D';
}
+ if (i + 1 != local_length) {
+ ai_latch = gs1_predefined_len(local_source + i + 1);
+ }
+ } else if (local_source[i] == cbracket && bracket_level) {
+ bracket_level--;
+ } else {
+ reduced[j++] = local_source[i];
}
- } else if (local_source[i] == cbracket && bracket_level) {
- /* The closing bracket is simply dropped from the input */
- bracket_level--;
- } else {
- reduced[j++] = local_source[i];
}
- }
- reduced[j] = '\0';
- *p_reduced_length = j;
+ reduced[j] = '\0';
+ *p_reduced_length = j;
- if (local_length != length) {
- /* Re-instate escaped parentheses */
- for (i = 0; i < *p_reduced_length; i++) {
- if (reduced[i] < '\x1D') {
- reduced[i] |= GS1_PARENS_PLACEHOLDER_MASK;
+ if (local_length != length) {
+ gs1_reinstate_escaped_parens(reduced, *p_reduced_length);
+ }
+ if (set_hrt) {
+ if (gs1parens_mode) {
+ warn_number = gs1_hrt_cpy(symbol, source, length, error_number != 0 /*no_errtxt*/);
+ } else {
+ warn_number = gs1_hrt_conv_brackets(symbol, source, length, error_number != 0 /*no_errtxt*/);
}
}
}
/* The character '\x1D' (GS) in the reduced string refers to the FNC1 character */
- return error_number;
+ return error_number ? error_number : warn_number;
}
/* Helper to return standard GS1 check digit (GS1 General Specifications 7.9.1) */
diff --git a/backend/gs1.h b/backend/gs1.h
index 480e944f..6d836c01 100644
--- a/backend/gs1.h
+++ b/backend/gs1.h
@@ -1,7 +1,7 @@
/* gs1.h - Verifies GS1 data */
/*
libzint - the open source barcode library
- Copyright (C) 2009-2025 Robin Stuart
+ Copyright (C) 2009-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -38,7 +38,7 @@ extern "C" {
#endif /* __cplusplus */
INTERNAL int zint_gs1_verify(struct zint_symbol *symbol, const unsigned char source[], const int length,
- unsigned char reduced[], int *p_reduced_length);
+ unsigned char reduced[], int *p_reduced_length, const int set_hrt);
INTERNAL char zint_gs1_check_digit(const unsigned char source[], const int length);
INTERNAL int zint_gs1_iso3166_alpha2(const unsigned char *cc);
diff --git a/backend/gs1_lint.h b/backend/gs1_lint.h
index 2da08212..f8205a9d 100644
--- a/backend/gs1_lint.h
+++ b/backend/gs1_lint.h
@@ -4,7 +4,7 @@
*/
/*
libzint - the open source barcode library
- Copyright (C) 2021-2025 Robin Stuart
+ Copyright (C) 2021-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -713,6 +713,7 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len,
/* Assume data length failure */
*p_err_no = 2;
+ *p_err_posn = 1;
if (ai < 100) {
@@ -1072,4 +1073,386 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len,
return 0;
}
+/* Helper to parse non-bracketed input */
+static int gs1_lint_parse_ai(const unsigned char source[], const int length, const int position,
+ int *p_ai, int *p_min, int *p_max) {
+ int ai, ai2, ai3 = -1, ai4 = -1, min, max = 0;
+
+ *p_ai = -1;
+
+ if (position + 1 >= length || !z_isdigit(source[position]) || !z_isdigit(source[position + 1])) {
+ return 0;
+ }
+ ai2 = z_to_int(source + position, 2);
+ if (position + 3 < length && z_isdigit(source[position + 2])) {
+ ai3 = z_to_int(source + position, 3);
+ if (position + 4 < length && z_isdigit(source[position + 3])) {
+ ai4 = z_to_int(source + position, 4);
+ }
+ }
+
+ ai = ai2;
+ if (ai == 0) {
+ min = 18, max = 18;
+ } else if (ai >= 1 && ai <= 3) {
+ min = 14, max = 14;
+ } else if (ai == 10 || ai == 21 || ai == 22) {
+ min = 1, max = 20;
+ } else if ((ai >= 11 && ai <= 13) || (ai >= 15 && ai <= 17)) {
+ min = 6, max = 6;
+ } else if (ai == 20) {
+ min = 2, max = 2;
+ } else if (ai == 30 || ai == 37) {
+ min = 1, max = 8;
+ } else if (ai == 90) {
+ min = 1, max = 30;
+ } else if (ai >= 91) {
+ min = 1, max = 90;
+ }
+
+ if (max == 0 && ai3 != -1) {
+
+ if (ai3 < 300) {
+ ai = ai3;
+ if (ai == 235) {
+ min = 1, max = 28;
+ } else if (ai == 240 || ai == 241 || ai == 250 || ai == 251) {
+ min = 1, max = 30;
+ } else if (ai == 242) {
+ min = 1, max = 6;
+ } else if (ai == 243 || ai == 254) {
+ min = 1, max = 20;
+ } else if (ai == 253) {
+ min = 13, max = 30;
+ } else if (ai == 255) {
+ min = 13, max = 25;
+ }
+
+ } else if (ai3 < 500) {
+ ai = ai3;
+ if (ai == 400 || ai == 403) {
+ min = 1, max = 30;
+ } else if (ai == 401) {
+ min = 1, max = 30;
+ } else if (ai == 402) {
+ min = 17, max = 17;
+ } else if (ai >= 410 && ai <= 417) {
+ min = 13, max = 13;
+ } else if (ai == 420) {
+ min = 1, max = 20;
+ } else if (ai == 421) {
+ min = 4, max = 12;
+ } else if (ai == 422 || ai == 424 || ai == 426) {
+ min = 3, max = 3;
+ } else if (ai == 423 || ai == 425) {
+ min = 3, max = 15;
+ } else if (ai == 427) {
+ min = 1, max = 3;
+ }
+
+ } else if (ai3 < 800) {
+ ai = ai3;
+ if (ai >= 710 && ai <= 717) {
+ min = 1, max = 20;
+ }
+ }
+
+ }
+
+ if (max == 0 && ai4 != -1) {
+
+ if (ai4 < 3200) {
+ ai = ai4;
+ if ((ai >= 3100 && ai <= 3105) || (ai >= 3110 && ai <= 3115) || (ai >= 3120 && ai <= 3125)
+ || (ai >= 3130 && ai <= 3135) || (ai >= 3140 && ai <= 3145) || (ai >= 3150 && ai <= 3155)
+ || (ai >= 3160 && ai <= 3165)) {
+ min = 6, max = 6;
+ }
+
+ } else if (ai4 < 3300) {
+ ai = ai4;
+ if (ai <= 3205 || (ai >= 3210 && ai <= 3215) || (ai >= 3220 && ai <= 3225) || (ai >= 3230 && ai <= 3235)
+ || (ai >= 3240 && ai <= 3245) || (ai >= 3250 && ai <= 3255) || (ai >= 3260 && ai <= 3265)
+ || (ai >= 3270 && ai <= 3275) || (ai >= 3280 && ai <= 3285) || (ai >= 3290 && ai <= 3295)) {
+ min = 6, max = 6;
+ }
+
+ } else if (ai4 < 3400) {
+ ai = ai4;
+ if (ai <= 3305 || (ai >= 3310 && ai <= 3315) || (ai >= 3320 && ai <= 3325) || (ai >= 3330 && ai <= 3335)
+ || (ai >= 3340 && ai <= 3345) || (ai >= 3350 && ai <= 3355) || (ai >= 3360 && ai <= 3365)
+ || (ai >= 3370 && ai <= 3375)) {
+ min = 6, max = 6;
+ }
+
+ } else if (ai4 < 3500) {
+ ai = ai4;
+ if (ai <= 3405 || (ai >= 3410 && ai <= 3415) || (ai >= 3420 && ai <= 3425) || (ai >= 3430 && ai <= 3435)
+ || (ai >= 3440 && ai <= 3445) || (ai >= 3450 && ai <= 3455) || (ai >= 3460 && ai <= 3465)
+ || (ai >= 3470 && ai <= 3475) || (ai >= 3480 && ai <= 3485) || (ai >= 3490 && ai <= 3495)) {
+ min = 6, max = 6;
+ }
+
+ } else if (ai4 < 3600) {
+ ai = ai4;
+ if (ai <= 3505 || (ai >= 3510 && ai <= 3515) || (ai >= 3520 && ai <= 3525) || (ai >= 3530 && ai <= 3535)
+ || (ai >= 3540 && ai <= 3545) || (ai >= 3550 && ai <= 3555) || (ai >= 3560 && ai <= 3565)
+ || (ai >= 3570 && ai <= 3575)) {
+ min = 6, max = 6;
+ }
+
+ } else if (ai4 < 3700) {
+ ai = ai4;
+ if (ai <= 3605 || (ai >= 3610 && ai <= 3615) || (ai >= 3620 && ai <= 3625) || (ai >= 3630 && ai <= 3635)
+ || (ai >= 3640 && ai <= 3645) || (ai >= 3650 && ai <= 3655) || (ai >= 3660 && ai <= 3665)
+ || (ai >= 3670 && ai <= 3675) || (ai >= 3680 && ai <= 3685) || (ai >= 3690 && ai <= 3695)) {
+ min = 6, max = 6;
+ }
+
+ } else if (ai4 < 4000) {
+ ai = ai4;
+ if ((ai >= 3900 && ai <= 3909) || (ai >= 3920 && ai <= 3929)) {
+ min = 1, max = 15;
+ } else if ((ai >= 3910 && ai <= 3919) || (ai >= 3930 && ai <= 3939)) {
+ min = 4, max = 18;
+ } else if (ai >= 3940 && ai <= 3943) {
+ min = 4, max = 4;
+ } else if (ai >= 3950 && ai <= 3955) {
+ min = 6, max = 6;
+ }
+
+ } else if (ai4 < 4400) {
+ ai = ai4;
+ if (ai == 4300 || ai == 4301 || ai == 4310 || ai == 4311 || ai == 4320) {
+ min = 1, max = 35;
+ } else if ((ai >= 4302 && ai <= 4306) || (ai >= 4312 && ai <= 4316)) {
+ min = 1, max = 70;
+ } else if (ai == 4307 || ai == 4317) {
+ min = 2, max = 2;
+ } else if (ai == 4308 || ai == 4319) {
+ min = 1, max = 30;
+ } else if (ai == 4309) {
+ min = 20, max = 20;
+ } else if (ai == 4318) {
+ min = 1, max = 20;
+ } else if (ai >= 4321 && ai <= 4323) {
+ min = 1, max = 1;
+ } else if (ai == 4324 || ai == 4325) {
+ min = 10, max = 10;
+ } else if (ai == 4326) {
+ min = 6, max = 6;
+ } else if (ai >= 4330 && ai <= 4333) {
+ min = 6, max = 7;
+ }
+
+ } else if (ai4 < 7100) {
+ ai = ai4;
+ if (ai == 7001) {
+ min = 13, max = 13;
+ } else if (ai == 7002) {
+ min = 1, max = 30;
+ } else if (ai == 7003) {
+ min = 10, max = 10;
+ } else if (ai == 7004) {
+ min = 1, max = 4;
+ } else if (ai == 7005) {
+ min = 1, max = 12;
+ } else if (ai == 7006) {
+ min = 6, max = 6;
+ } else if (ai == 7007) {
+ min = 6, max = 12;
+ } else if (ai == 7008) {
+ min = 1, max = 3;
+ } else if (ai == 7009) {
+ min = 1, max = 10;
+ } else if (ai == 7010) {
+ min = 1, max = 2;
+ } else if (ai == 7011) {
+ min = 6, max = 10;
+ } else if (ai >= 7020 && ai <= 7022) {
+ min = 1, max = 20;
+ } else if (ai == 7023) {
+ min = 1, max = 30;
+ } else if (ai >= 7030 && ai <= 7039) {
+ min = 4, max = 30;
+ } else if (ai == 7040) {
+ min = 4, max = 4;
+ } else if (ai == 7041) {
+ min = 1, max = 4;
+ }
+
+ } else if (ai4 < 7300) {
+ ai = ai4;
+ if (ai >= 7230 && ai <= 7239) {
+ min = 3, max = 30;
+ } else if (ai == 7240) {
+ min = 1, max = 20;
+ } else if (ai == 7241) {
+ min = 2, max = 2;
+ } else if (ai == 7242) {
+ min = 1, max = 25;
+ } else if (ai == 7250) {
+ min = 8, max = 8;
+ } else if (ai == 7251) {
+ min = 12, max = 12;
+ } else if (ai == 7252) {
+ min = 1, max = 1;
+ } else if (ai == 7253 || ai == 7254 || ai == 7259) {
+ min = 1, max = 40;
+ } else if (ai == 7255) {
+ min = 1, max = 10;
+ } else if (ai == 7256) {
+ min = 1, max = 90;
+ } else if (ai == 7257) {
+ min = 1, max = 70;
+ } else if (ai == 7258) {
+ min = 3, max = 3;
+ }
+
+ } else if (ai4 < 8100) {
+ ai = ai4;
+ if (ai == 8001) {
+ min = 14, max = 14;
+ } else if (ai == 8002 || ai == 8012) {
+ min = 1, max = 20;
+ } else if (ai == 8003) {
+ min = 14, max = 30;
+ } else if (ai == 8004) {
+ min = 1, max = 30;
+ } else if (ai == 8005) {
+ min = 6, max = 6;
+ } else if (ai == 8006 || ai == 8026) {
+ min = 18, max = 18;
+ } else if (ai == 8007) {
+ min = 1, max = 34;
+ } else if (ai == 8008) {
+ min = 8, max = 12;
+ } else if (ai == 8009) {
+ min = 1, max = 50;
+ } else if (ai == 8010) {
+ min = 1, max = 30;
+ } else if (ai == 8011) {
+ min = 1, max = 12;
+ } else if (ai == 8013) {
+ min = 1, max = 25;
+ } else if (ai == 8014) {
+ min = 1, max = 25;
+ } else if (ai == 8017 || ai == 8018) {
+ min = 18, max = 18;
+ } else if (ai == 8019) {
+ min = 1, max = 10;
+ } else if (ai == 8020) {
+ min = 1, max = 25;
+ } else if (ai == 8030) {
+ min = 1, max = 90;
+ } else if (ai == 8040 || ai == 8041) {
+ min = 15, max = 15;
+ } else if (ai == 8042) {
+ min = 32, max = 32;
+ } else if (ai == 8043) {
+ min = 18, max = 20;
+ }
+
+ } else if (ai4 < 8200) {
+ ai = ai4;
+ if (ai == 8110) {
+ min = 1, max = 70;
+ } else if (ai == 8111) {
+ min = 4, max = 4;
+ } else if (ai == 8112) {
+ min = 1, max = 70;
+ }
+
+ } else if (ai4 < 8300) {
+ ai = ai4;
+ if (ai == 8200) {
+ min = 1, max = 70;
+ }
+ }
+ }
+
+ if (max == 0) {
+ *p_ai = ai2; /* Use 2-digit as feedback */
+ return 0;
+ }
+ assert(ai >= 0 && ai <= 9999);
+ assert(min >= 1);
+ assert(max >= min);
+
+ *p_ai = ai;
+ if (p_min) {
+ *p_min = min;
+ }
+ if (p_max) {
+ *p_max = max;
+ }
+ return 1;
+}
+
+/* Parse non-bracketed input */
+static int gs1_lint_parse_raw_caret(const unsigned char source[], const int length,
+ const int ai_max, int *ai_vals, int *ai_locs, int *data_locs, int *data_lens, int *p_ai_count,
+ int *p_err_no, int *p_err_posn) {
+ int i, j;
+ const int gs1_caret = source[0] == '^';
+ const unsigned char separator = gs1_caret ? '^' : '\x1D';
+ int ai, max;
+ int ai_count = 0, ai_len;
+ #ifdef NDEBUG
+ (void)ai_max;
+ #endif
+
+ i = gs1_caret || source[0] == '\x1D'; /* Allow GS at start also */
+
+ if (i >= length) {
+ *p_ai_count = 0; /* For feedback */
+ ai_vals[0] = -1;
+ ai_locs[0] = i - 1;
+ *p_err_no = 1;
+ *p_err_posn = i;
+ return 0;
+ }
+
+ while (i < length) {
+ int data_start, data_max, on_separator;
+ assert(ai_count < ai_max);
+ ai_locs[ai_count] = i;
+ if (!gs1_lint_parse_ai(source, length, i, &ai, NULL /*min*/, &max)) {
+ *p_ai_count = ai_count; /* For feedback */
+ ai_vals[ai_count] = ai; /* May be -1 */
+ *p_err_no = 1;
+ *p_err_posn = i + 1; /* Position 1-base */
+ return 0;
+ }
+ ai_vals[ai_count] = ai;
+ ai_len = ai < 100 ? 2 : ai < 1000 ? 3 : 4;
+
+ /* Following GS1 Syntax Engine tolerating superfluous FNC1s at end of AI data
+ (for both final AI and AIs with predefined length) */
+ data_start = i + ai_len;
+ data_max = data_start + max;
+ for (j = data_start; j < length && j < data_max; j++) {
+ if (source[j] == separator) {
+ break;
+ }
+ }
+ data_locs[ai_count] = data_start;
+ /* Only checking that have at least one char, and haven't exceeded max */
+ on_separator = j < length && source[j] == separator;
+ if (j == data_start || (j + 1 == length && length > data_max && !on_separator)) {
+ *p_ai_count = ai_count; /* For feedback */
+ data_lens[ai_count] = j - data_start;
+ *p_err_no = 2;
+ *p_err_posn = i + 1; /* Position 1-base */
+ return 0;
+ }
+ data_lens[ai_count] = j - data_locs[ai_count];
+ ai_count++;
+ i = j + on_separator;
+ }
+
+ *p_ai_count = ai_count;
+ return 1;
+}
+
#endif /* Z_GS1_LINT_H */
diff --git a/backend/library.c b/backend/library.c
index e01e3954..67f19412 100644
--- a/backend/library.c
+++ b/backend/library.c
@@ -1218,7 +1218,7 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[
if (is_composite || !check_force_gs1(symbol->symbology)) {
unsigned char *reduced = (unsigned char *) z_alloca(local_segs[0].length + 1);
error_number = zint_gs1_verify(symbol, local_segs[0].source, local_segs[0].length, reduced,
- &local_segs[0].length);
+ &local_segs[0].length, 0 /*set_hrt*/);
if (error_number) {
#ifdef ZINT_HAVE_GS1SE
if (is_composite && !(symbol->input_mode & GS1SYNTAXENGINE_MODE)) {
@@ -1387,7 +1387,7 @@ static int txt_hex_plot(struct zint_symbol *symbol) {
}
if (!zint_fm_close(fmp, symbol)) {
- return ZEXT z_errtxtf(ZINT_ERROR_FILE_WRITE, symbol, 792, "Failure on closing TXT output file (%1$d: %2$s)",
+ return ZEXT z_errtxtf(ZINT_ERROR_FILE_WRITE, symbol, 796, "Failure on closing TXT output file (%1$d: %2$s)",
fmp->err, strerror(fmp->err));
}
diff --git a/backend/rss.c b/backend/rss.c
index 94fde662..59564efd 100644
--- a/backend/rss.c
+++ b/backend/rss.c
@@ -1,7 +1,7 @@
/* rss.c - GS1 DataBar (formerly Reduced Space Symbology) */
/*
libzint - the open source barcode library
- Copyright (C) 2008-2025 Robin Stuart
+ Copyright (C) 2008-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -1188,17 +1188,6 @@ static void dbar_exp_separator(struct zint_symbol *symbol, int width, const int
}
}
-/* Set HRT for DataBar Expanded */
-static void dbar_exp_hrt(struct zint_symbol *symbol, unsigned char source[], const int length) {
-
- /* Max possible length is 77 digits so will fit */
- if (symbol->input_mode & GS1PARENS_MODE) {
- z_hrt_cpy_nochk(symbol, source, length);
- } else {
- z_hrt_conv_gs1_brackets_nochk(symbol, source, length);
- }
-}
-
/* Return DataBar Expanded group (-1) */
static int dbar_exp_group(const int val) {
int i;
@@ -1225,10 +1214,11 @@ INTERNAL int zint_dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[]
int reduced_length;
/* Allow for 8 bits + 5-bit latch per char + 200 bits overhead/padding */
char *binary_string = (char *) z_alloca(13 * length + 200 + 1);
+ const int set_hrt = symbol->symbology == BARCODE_DBAR_EXP || symbol->symbology == BARCODE_DBAR_EXP_CC;
const int content_segs = symbol->output_options & BARCODE_CONTENT_SEGS;
const int debug_print = symbol->debug & ZINT_DEBUG_PRINT;
- error_number = zint_gs1_verify(symbol, source, length, reduced, &reduced_length);
+ error_number = zint_gs1_verify(symbol, source, length, reduced, &reduced_length, set_hrt);
if (error_number >= ZINT_ERROR) {
return error_number;
}
@@ -1318,10 +1308,6 @@ INTERNAL int zint_dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[]
check_char = 211 * (symbol_chars - 4) + checksum % 211;
- if (debug_print) {
- printf("Data chars: %d, Check char: %d\n", data_chars, check_char);
- }
-
group = dbar_exp_group(check_char);
odd = (check_char - dbar_exp_g_sum[group]) / dbar_exp_t_even[group];
@@ -1335,6 +1321,11 @@ INTERNAL int zint_dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[]
pattern_width = codeblocks * 5 + symbol_chars * 8 + 4;
memset(elements, 0, sizeof(int) * pattern_width);
+ if (debug_print) {
+ printf("Data chars: %d, Check char: %d, Codeblocks: %d, Symbol chars: %d\n",
+ data_chars, check_char, codeblocks, symbol_chars);
+ }
+
/* Put finder patterns in element array */
p = (symbol_chars - 1) / 2 - 1;
for (i = 0; i < codeblocks; i++) {
@@ -1380,7 +1371,7 @@ INTERNAL int zint_dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[]
}
symbol->rows++;
- dbar_exp_hrt(symbol, source, length);
+ /* HRT set by `zint_gs1_verify()` */
if (content_segs && z_ct_cpy(symbol, reduced, reduced_length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
@@ -1498,7 +1489,7 @@ INTERNAL int zint_dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[]
if (symbol->symbology == BARCODE_DBAR_EXP_CC || symbol->symbology == BARCODE_DBAR_EXPSTK_CC) {
/* Composite separator */
- dbar_exp_separator(symbol, symbol->width, 4, separator_row, 1 /*above*/, 0 /*special_case_row*/,
+ dbar_exp_separator(symbol, symbol->width, codeblocks, separator_row, 1 /*above*/, 0 /*special_case_row*/,
1 /*left_to_right*/, 0 /*odd_last_row*/, NULL);
}
diff --git a/backend/tests/test_aztec.c b/backend/tests/test_aztec.c
index e488b24a..b27fafde 100644
--- a/backend/tests/test_aztec.c
+++ b/backend/tests/test_aztec.c
@@ -4934,7 +4934,7 @@ static void test_encode(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[8192];
- char cmp_buf[32768];
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
diff --git a/backend/tests/test_code1.c b/backend/tests/test_code1.c
index 57449ed0..8b24a16b 100644
--- a/backend/tests/test_code1.c
+++ b/backend/tests/test_code1.c
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2020-2025 Robin Stuart
+ Copyright (C) 2020-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -2897,7 +2897,7 @@ static void test_encode(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[8192];
- char bwipp_buf[32768];
+ char bwipp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
@@ -3286,7 +3286,7 @@ static void test_encode_segs(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[8192];
- char bwipp_buf[32768];
+ char bwipp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
@@ -3574,7 +3574,7 @@ static void test_fuzz(const testCtx *const p_ctx) {
int i, length, ret;
struct zint_symbol *symbol = NULL;
- char bwipp_buf[32768];
+ char bwipp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
diff --git a/backend/tests/test_code128.c b/backend/tests/test_code128.c
index f4abc997..8222c717 100644
--- a/backend/tests/test_code128.c
+++ b/backend/tests/test_code128.c
@@ -104,7 +104,7 @@ static void test_large(const testCtx *const p_ctx) {
char escaped2[1024];
char cmp_buf[8192];
char cmp_msg[1024];
- char ret_buf[8192] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char ret_buf[8192] ZINT_TESTUTIL_SANITIZEM_INIT;
/* Only do BWIPP/zxing-cpp tests if asked, too slow otherwise */
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript();
@@ -937,7 +937,7 @@ static void test_hibc_input(const testCtx *const p_ctx) {
char escaped[1024];
char escaped2[1024];
- char cmp_buf[8192];
+ char cmp_buf[8192] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
char ret_buf[8192];
diff --git a/backend/tests/test_composite.c b/backend/tests/test_composite.c
index ddee9396..64091db9 100644
--- a/backend/tests/test_composite.c
+++ b/backend/tests/test_composite.c
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2019-2025 Robin Stuart
+ Copyright (C) 2019-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -124,17 +124,21 @@ static void test_eanx_leading_zeroes(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/,
+ -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d\n", i, symbol->rows, data[i].expected_rows);
- assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n", i, symbol->width, data[i].expected_width);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d\n",
+ i, symbol->rows, data[i].expected_rows);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n",
+ i, symbol->width, data[i].expected_width);
ZBarcode_Delete(symbol);
}
@@ -153,20 +157,24 @@ static void test_helper_generate(const struct zint_symbol *symbol, int ret, int
if (ret == 0) {
if (bwipp_cmp == -1) {
printf(" /*%2d*/ { %s, %d, \"%s\", \"%s\", %d, %d, %d, \"%s\",\n",
- i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite, ret, symbol->rows, symbol->width, comment);
+ i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite,
+ ret, symbol->rows, symbol->width, comment);
} else {
printf(" /*%2d*/ { %s, %d, \"%s\", \"%s\", %d, %d, %d, %d, \"%s\",\n",
- i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite, ret, symbol->rows, symbol->width, bwipp_cmp, comment);
+ i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite,
+ ret, symbol->rows, symbol->width, bwipp_cmp, comment);
}
testUtilModulesPrint(symbol, " ", "\n");
printf(" },\n");
} else {
if (bwipp_cmp == -1) {
printf(" /*%2d*/ { %s, %d, \"%s\", \"%s\", %s, %d, %d, \"%s\", \"\" },\n",
- i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite, testUtilErrorName(ret), symbol->rows, symbol->width, comment);
+ i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite,
+ testUtilErrorName(ret), symbol->rows, symbol->width, comment);
} else {
printf(" /*%2d*/ { %s, %d, \"%s\", \"%s\", %s, %d, %d, %d, \"%s\", \"\" },\n",
- i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite, testUtilErrorName(ret), symbol->rows, symbol->width, bwipp_cmp, comment);
+ i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite,
+ testUtilErrorName(ret), symbol->rows, symbol->width, bwipp_cmp, comment);
}
}
}
@@ -186,12 +194,14 @@ static void test_examples(const testCtx *const p_ctx) {
int expected_rows;
int expected_width;
int bwipp_cmp;
+ int compare_previous;
const char *comment;
const char *expected;
};
/* Verified manually against GS1 General Specifications 21.0.1 (GGS) and ISO/IEC 24723:2010, with noted exceptions, and verified via bwipp_dump.ps against BWIPP */
+ /* s/\v(\/\*)[ 0-9]*(\*\/)/\=printf("%s%3d%s", submatch(1), (@z+setreg('z',@z+1)), submatch(2))/ | let @z=0: */
static const struct item data[] = {
- /* 0*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "0401234567890", "[17]050101[10]ABC123", 0, 11, 56, 1, "GSS Figure 5.1-5. GS1 DataBar Stacked Omnidirectional barcode with a Composite Component",
+ /* 0*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "0401234567890", "[17]050101[10]ABC123", 0, 11, 56, 1, -1, "GSS Figure 5.1-5. GS1 DataBar Stacked Omnidirectional barcode with a Composite Component",
"01101100110101110001001100001000000110100111011110101001"
"01101101110110001100010100001100001000010110011100101001"
"01101101100111000101110001101001100011111010011101101001"
@@ -204,7 +214,33 @@ static void test_examples(const testCtx *const p_ctx) {
"00001000110000101010000000101010111011001111000000000000"
"10100111001111010101111111000001000100110000110101000000"
},
- /* 1*/ { BARCODE_DBAR_LTD_CC, -1, 1, "1311234567890", "[17]010615[10]A123456", 0, 6, 79, 1, "GGS Figure 5.11.2-1. (24723:2010 Figure 1) GS1 DataBar Limited Composite symbol with CC-A",
+ /* 1*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "0401234567890", "^1705010110ABC123", 0, 11, 56, 1, 0, "See above",
+ "01101100110101110001001100001000000110100111011110101001"
+ "01101101110110001100010100001100001000010110011100101001"
+ "01101101100111000101110001101001100011111010011101101001"
+ "01101101000110111100010011001111110100111011011101001001"
+ "01101001000111110111110100101010100000010000011101001101"
+ "00000000100110111010100000101010101100110001100000000000"
+ "01001111011001000100011111000001010011001110011010000000"
+ "00000000100110111010100000101010101100110001100000000000"
+ "00000101010101010101010101010101010101010101010000000000"
+ "00001000110000101010000000101010111011001111000000000000"
+ "10100111001111010101111111000001000100110000110101000000"
+ },
+ /* 2*/ { BARCODE_DBAR_OMNSTK_CC, GS1RAW_MODE, 1, "0401234567890", "1705010110ABC123", 0, 11, 56, 1, 0, "See above",
+ "01101100110101110001001100001000000110100111011110101001"
+ "01101101110110001100010100001100001000010110011100101001"
+ "01101101100111000101110001101001100011111010011101101001"
+ "01101101000110111100010011001111110100111011011101001001"
+ "01101001000111110111110100101010100000010000011101001101"
+ "00000000100110111010100000101010101100110001100000000000"
+ "01001111011001000100011111000001010011001110011010000000"
+ "00000000100110111010100000101010101100110001100000000000"
+ "00000101010101010101010101010101010101010101010000000000"
+ "00001000110000101010000000101010111011001111000000000000"
+ "10100111001111010101111111000001000100110000110101000000"
+ },
+ /* 3*/ { BARCODE_DBAR_LTD_CC, -1, 1, "1311234567890", "[17]010615[10]A123456", 0, 6, 79, 1, -1, "GGS Figure 5.11.2-1. (24723:2010 Figure 1) GS1 DataBar Limited Composite symbol with CC-A",
"0111100010110110001010011000111110100110011101110100111100111011101001101000000"
"0100111110001101001010111000111101111010111101001111011100111011101011101000000"
"0100110011010000001010110000111001000110111101111011110010100011101011001000000"
@@ -212,7 +248,23 @@ static void test_examples(const testCtx *const p_ctx) {
"0000001100000101010011001110101011010100110010101111000101100110100111000000000"
"0101110011111010101100110001010100101011001101010000111010011001011000010100000"
},
- /* 2*/ { BARCODE_GS1_128_CC, -1, 3, "[01]03812345678908", "[10]ABCD123456[410]3898765432108", 0, 7, 154, 1, "GGS Figure 5.11.2-2. GS1-128 Composite symbol with CC-C **NOT SAME** as zint uses encodation '10', same if '0' forced",
+ /* 4*/ { BARCODE_DBAR_LTD_CC, -1, 1, "1311234567890", "^1701061510A123456", 0, 6, 79, 1, 0, "See above",
+ "0111100010110110001010011000111110100110011101110100111100111011101001101000000"
+ "0100111110001101001010111000111101111010111101001111011100111011101011101000000"
+ "0100110011010000001010110000111001000110111101111011110010100011101011001000000"
+ "0111100010101000001010010000101110110111111001110011001110010011101010001000000"
+ "0000001100000101010011001110101011010100110010101111000101100110100111000000000"
+ "0101110011111010101100110001010100101011001101010000111010011001011000010100000"
+ },
+ /* 5*/ { BARCODE_DBAR_LTD_CC, GS1RAW_MODE, 1, "1311234567890", "1701061510A123456", 0, 6, 79, 1, 0, "See above",
+ "0111100010110110001010011000111110100110011101110100111100111011101001101000000"
+ "0100111110001101001010111000111101111010111101001111011100111011101011101000000"
+ "0100110011010000001010110000111001000110111101111011110010100011101011001000000"
+ "0111100010101000001010010000101110110111111001110011001110010011101010001000000"
+ "0000001100000101010011001110101011010100110010101111000101100110100111000000000"
+ "0101110011111010101100110001010100101011001101010000111010011001011000010100000"
+ },
+ /* 6*/ { BARCODE_GS1_128_CC, -1, 3, "[01]03812345678908", "[10]ABCD123456[410]3898765432108", 0, 7, 154, 1, -1, "GGS Figure 5.11.2-2. GS1-128 Composite symbol with CC-C **NOT SAME** as zint uses encodation '10', same if '0' forced",
"1111111101010100011110101011110000111101011001111101110111110111010010000010000100010110010000101100001111011110110011011110101001111000111111101000101001"
"1111111101010100011111101010001110100001000111101001100101110010000011100001011000100100100111110110001011100001011111011111101010111000111111101000101001"
"1111111101010100011101010011111100110001111010001101000101011110000010001111101100010111101101111101001001011000111110011101010001111110111111101000101001"
@@ -221,7 +273,25 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000001011000110000101000100110010011011011001110110100001100010010001010001001110111101001100100100001011100110110100001000100100001001001110001010000"
"0000000110100111001111010111011001101100100100110001001011110011101101110101110110001000010110011011011110100011001001011110111011011110110110001110101100"
},
- /* 3*/ { BARCODE_GS1_128_CC, -1, 3, "[01]93812345678901", "[10]ABCD123456[410]3898765432108", 0, 7, 154, 1, "24723:2010 Figure 2 GS1-128 Composite symbol with 5-row CC-C **NOT SAME** ditto as above",
+ /* 7*/ { BARCODE_GS1_128_CC, -1, 3, "^0103812345678908", "^10ABCD123456^4103898765432108", 0, 7, 154, 1, 0, "See above",
+ "1111111101010100011110101011110000111101011001111101110111110111010010000010000100010110010000101100001111011110110011011110101001111000111111101000101001"
+ "1111111101010100011111101010001110100001000111101001100101110010000011100001011000100100100111110110001011100001011111011111101010111000111111101000101001"
+ "1111111101010100011101010011111100110001111010001101000101011110000010001111101100010111101101111101001001011000111110011101010001111110111111101000101001"
+ "1111111101010100010101111001111000110010011001110001111010100111100010011110111101000110000110001000101100001011101111011111010111111010111111101000101001"
+ "1111111101010100011101011100001100101000111111011101011110001001111011111011001000100111100111011101001101101111001000011101011100110000111111101000101001"
+ "0000000001011000110000101000100110010011011011001110110100001100010010001010001001110111101001100100100001011100110110100001000100100001001001110001010000"
+ "0000000110100111001111010111011001101100100100110001001011110011101101110101110110001000010110011011011110100011001001011110111011011110110110001110101100"
+ },
+ /* 8*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, 3, "0103812345678908", "10ABCD123456\0354103898765432108", 0, 7, 154, 1, 0, "See above",
+ "1111111101010100011110101011110000111101011001111101110111110111010010000010000100010110010000101100001111011110110011011110101001111000111111101000101001"
+ "1111111101010100011111101010001110100001000111101001100101110010000011100001011000100100100111110110001011100001011111011111101010111000111111101000101001"
+ "1111111101010100011101010011111100110001111010001101000101011110000010001111101100010111101101111101001001011000111110011101010001111110111111101000101001"
+ "1111111101010100010101111001111000110010011001110001111010100111100010011110111101000110000110001000101100001011101111011111010111111010111111101000101001"
+ "1111111101010100011101011100001100101000111111011101011110001001111011111011001000100111100111011101001101101111001000011101011100110000111111101000101001"
+ "0000000001011000110000101000100110010011011011001110110100001100010010001010001001110111101001100100100001011100110110100001000100100001001001110001010000"
+ "0000000110100111001111010111011001101100100100110001001011110011101101110101110110001000010110011011011110100011001001011110111011011110110110001110101100"
+ },
+ /* 9*/ { BARCODE_GS1_128_CC, -1, 3, "[01]93812345678901", "[10]ABCD123456[410]3898765432108", 0, 7, 154, 1, -1, "24723:2010 Figure 2 GS1-128 Composite symbol with 5-row CC-C **NOT SAME** ditto as above",
"1111111101010100011110101011110000111101011001111101110111110111010010000010000100010110010000101100001111011110110011011110101001111000111111101000101001"
"1111111101010100011111101010001110100001000111101001100101110010000011100001011000100100100111110110001011100001011111011111101010111000111111101000101001"
"1111111101010100011101010011111100110001111010001101000101011110000010001111101100010111101101111101001001011000111110011101010001111110111111101000101001"
@@ -230,7 +300,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000001011000110000101000100110010011010111000010110100001100010010001010001001110111101001100100100001001100100110100001000100001001001001110001010000"
"0000000110100111001111010111011001101100101000111101001011110011101101110101110110001000010110011011011110110011011001011110111011110110110110001110101100"
},
- /* 4*/ { BARCODE_EAN13_CC, -1, 1, "331234567890", "[21]1234-abcd", 0, 7, 99, 1, "GGS Figure 5.11.8-1. EAN-13 symbol with a four-column CC-A component (note [21] not [99])",
+ /* 10*/ { BARCODE_EAN13_CC, -1, 1, "331234567890", "[21]1234-abcd", 0, 7, 99, 1, -1, "GGS Figure 5.11.8-1. EAN-13 symbol with a four-column CC-A component (note [21] not [99])",
"110110111011010000100000110100110011101100001001110100100001011001100001100111000110001011011000101"
"110110110011000110111100010111011001110000101001100100100000010111101001101011100010000011001000101"
"110110100010011010001110000111111010001100101001100110111111010001101001010000011011111011101000101"
@@ -239,7 +309,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
},
- /* 5*/ { BARCODE_EANX_CC, -1, 1, "331234567890", "[21]1234-abcd", 0, 7, 99, 1, "GGS Figure 5.11.8-1. EAN-13 symbol with a four-column CC-A component (note [21] not [99])",
+ /* 11*/ { BARCODE_EAN13_CC, -1, 1, "331234567890", "^211234-abcd", 0, 7, 99, 1, 0, "See above",
"110110111011010000100000110100110011101100001001110100100001011001100001100111000110001011011000101"
"110110110011000110111100010111011001110000101001100100100000010111101001101011100010000011001000101"
"110110100010011010001110000111111010001100101001100110111111010001101001010000011011111011101000101"
@@ -248,7 +318,43 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
},
- /* 6*/ { BARCODE_EAN13_CC, -1, 1, "331234567890", "[99]1234-abcd", 0, 7, 99, 1, "24723:2010 Figure 5 An EAN-13 composite symbol (with CC-A)",
+ /* 12*/ { BARCODE_EAN13_CC, GS1RAW_MODE, 1, "331234567890", "211234-abcd", 0, 7, 99, 1, 0, "See above",
+ "110110111011010000100000110100110011101100001001110100100001011001100001100111000110001011011000101"
+ "110110110011000110111100010111011001110000101001100100100000010111101001101011100010000011001000101"
+ "110110100010011010001110000111111010001100101001100110111111010001101001010000011011111011101000101"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
+ },
+ /* 13*/ { BARCODE_EANX_CC, -1, 1, "331234567890", "[21]1234-abcd", 0, 7, 99, 1, -1, "GGS Figure 5.11.8-1. EAN-13 symbol with a four-column CC-A component (note [21] not [99])",
+ "110110111011010000100000110100110011101100001001110100100001011001100001100111000110001011011000101"
+ "110110110011000110111100010111011001110000101001100100100000010111101001101011100010000011001000101"
+ "110110100010011010001110000111111010001100101001100110111111010001101001010000011011111011101000101"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
+ },
+ /* 14*/ { BARCODE_EANX_CC, -1, 1, "331234567890", "^211234-abcd", 0, 7, 99, 1, 0, "See above",
+ "110110111011010000100000110100110011101100001001110100100001011001100001100111000110001011011000101"
+ "110110110011000110111100010111011001110000101001100100100000010111101001101011100010000011001000101"
+ "110110100010011010001110000111111010001100101001100110111111010001101001010000011011111011101000101"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
+ },
+ /* 15*/ { BARCODE_EANX_CC, GS1RAW_MODE, 1, "331234567890", "211234-abcd", 0, 7, 99, 1, 0, "See above",
+ "110110111011010000100000110100110011101100001001110100100001011001100001100111000110001011011000101"
+ "110110110011000110111100010111011001110000101001100100100000010111101001101011100010000011001000101"
+ "110110100010011010001110000111111010001100101001100110111111010001101001010000011011111011101000101"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
+ },
+ /* 16*/ { BARCODE_EAN13_CC, -1, 1, "331234567890", "[99]1234-abcd", 0, 7, 99, 1, -1, "24723:2010 Figure 5 An EAN-13 composite symbol (with CC-A)",
"110110111011100110111011110100010100000010001001110100111011010110000001100110010000100011011000101"
"110110110011100010011101100111110001000101101001100100100001101011111101101011100010000011001000101"
"110110100010001011101111110110011100100011101001100110100000011101011001011110001001000011101000101"
@@ -257,7 +363,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
},
- /* 7*/ { BARCODE_EANX_CC, -1, 1, "331234567890", "[99]1234-abcd", 0, 7, 99, 1, "24723:2010 Figure 5 An EAN-13 composite symbol (with CC-A)",
+ /* 17*/ { BARCODE_EAN13_CC, -1, 1, "331234567890", "^991234-abcd", 0, 7, 99, 1, 0, "See above",
"110110111011100110111011110100010100000010001001110100111011010110000001100110010000100011011000101"
"110110110011100010011101100111110001000101101001100100100001101011111101101011100010000011001000101"
"110110100010001011101111110110011100100011101001100110100000011101011001011110001001000011101000101"
@@ -266,7 +372,25 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
},
- /* 8*/ { BARCODE_UPCA_CC, -1, 2, "61414101234", "[91]abcdefghijklmnopqrstuvwxyz", 0, 14, 99, 1, "GGS Figure 5.11.8-2. UPC-A symbol with a four-column CC-B component **NOT SAME** (using [91] not [10] as length > 20 max for [10])",
+ /* 18*/ { BARCODE_EAN13_CC, GS1RAW_MODE, 1, "331234567890", "991234-abcd", 0, 7, 99, 1, 0, "See above",
+ "110110111011100110111011110100010100000010001001110100111011010110000001100110010000100011011000101"
+ "110110110011100010011101100111110001000101101001100100100001101011111101101011100010000011001000101"
+ "110110100010001011101111110110011100100011101001100110100000011101011001011110001001000011101000101"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
+ },
+ /* 19*/ { BARCODE_EANX_CC, -1, 1, "331234567890", "[99]1234-abcd", 0, 7, 99, 1, -1, "24723:2010 Figure 5 An EAN-13 composite symbol (with CC-A)",
+ "110110111011100110111011110100010100000010001001110100111011010110000001100110010000100011011000101"
+ "110110110011100010011101100111110001000101101001100100100001101011111101101011100010000011001000101"
+ "110110100010001011101111110110011100100011101001100110100000011101011001011110001001000011101000101"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
+ },
+ /* 20*/ { BARCODE_UPCA_CC, -1, 2, "61414101234", "[91]abcdefghijklmnopqrstuvwxyz", 0, 14, 99, 1, -1, "GGS Figure 5.11.8-2. UPC-A symbol with a four-column CC-B component **NOT SAME** (using [91] not [10] as length > 20 max for [10])",
"110001001010000001110010110110011111101100101001111010100100101111000001110101001111110011000100101"
"111001001011101110101000000111101101000111001011111010100011000110000101110011010000110011100100101"
"111101001011110110001101000111101000100000101011110010101001111001000001011111010001110011110100101"
@@ -282,7 +406,39 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101010111100110010100011001100101000110011001010101110010110011011011001000010101110010000101010"
},
- /* 9*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, 2, "61414101234", "[10]abcdefghijklmnopqrstuvwxyz", 0, 14, 99, 1, "GGS Figure 5.11.8-2. UPC-A symbol with a four-column CC-B component **NOT SAME** as zint uses encodation '10', same if '0' forced",
+ /* 21*/ { BARCODE_UPCA_CC, -1, 2, "61414101234", "^91abcdefghijklmnopqrstuvwxyz", 0, 14, 99, 1, 0, "See above",
+ "110001001010000001110010110110011111101100101001111010100100101111000001110101001111110011000100101"
+ "111001001011101110101000000111101101000111001011111010100011000110000101110011010000110011100100101"
+ "111101001011110110001101000111101000100000101011110010101001111001000001011111010001110011110100101"
+ "111101011011110100111100010111011111001011001011110110111110001001110101011111001110011011110101101"
+ "111101010010001100011100110111001000010011101001110110100011011010000001001100000110001011110101001"
+ "111001010010000001011110100111100110110100001001110100111001011000010001111010010100000011100101001"
+ "111011010010011111101110100101110001000011001001100100100011110010000101011110000110011011101101001"
+ "111010010011100011101000100100001011011000001001100110110001110110100001000110011101100011101001001"
+ "111010011010110111111011000101111101100111101001000110110100111100001101111100001101010011101001101"
+ "111010111010111000001000110110111110010001001001000010111100101111101101000110001000111011101011101"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "000101010111100110010100011001100101000110011001010101110010110011011011001000010101110010000101010"
+ },
+ /* 22*/ { BARCODE_UPCA_CC, GS1RAW_MODE, 2, "61414101234", "91abcdefghijklmnopqrstuvwxyz", 0, 14, 99, 1, 0, "See above",
+ "110001001010000001110010110110011111101100101001111010100100101111000001110101001111110011000100101"
+ "111001001011101110101000000111101101000111001011111010100011000110000101110011010000110011100100101"
+ "111101001011110110001101000111101000100000101011110010101001111001000001011111010001110011110100101"
+ "111101011011110100111100010111011111001011001011110110111110001001110101011111001110011011110101101"
+ "111101010010001100011100110111001000010011101001110110100011011010000001001100000110001011110101001"
+ "111001010010000001011110100111100110110100001001110100111001011000010001111010010100000011100101001"
+ "111011010010011111101110100101110001000011001001100100100011110010000101011110000110011011101101001"
+ "111010010011100011101000100100001011011000001001100110110001110110100001000110011101100011101001001"
+ "111010011010110111111011000101111101100111101001000110110100111100001101111100001101010011101001101"
+ "111010111010111000001000110110111110010001001001000010111100101111101101000110001000111011101011101"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
+ "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
+ "000101010111100110010100011001100101000110011001010101110010110011011011001000010101110010000101010"
+ },
+ /* 23*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, 2, "61414101234", "[10]abcdefghijklmnopqrstuvwxyz", 0, 14, 99, 1, -1, "GGS Figure 5.11.8-2. UPC-A symbol with a four-column CC-B component **NOT SAME** as zint uses encodation '10', same if '0' forced",
"110001001010000001110010110110011111101100101001111010111000101011111101011010001110000011000100101"
"111001001010110011100011000100010000100000101011111010111000111010010001011000111101110011100100101"
"111101001011000001000111010111010000110100001011110010111011001111001101110101100000010011110100101"
@@ -298,7 +454,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101010111100110010100011001100101000110011001010101110010110011011011001000010101110010000101010"
},
- /* 10*/ { BARCODE_EAN8_CC, -1, -1, "1234567", "[21]A12345678", 0, 8, 72, 1, "GGS Figure 5.11.8-3. (24723:2010 Figure 4) EAN-8 symbol with a three-column CC-A",
+ /* 24*/ { BARCODE_EAN8_CC, -1, -1, "1234567", "[21]A12345678", 0, 8, 72, 1, -1, "GGS Figure 5.11.8-3. (24723:2010 Figure 4) EAN-8 symbol with a three-column CC-A",
"101001111000001001010011000111110101110111101001101001111110011101001101"
"111110010011100101010111000101110011011100001111110100011001011101011101"
"110011001000010001010110000101000001000010001001000110110000011101011001"
@@ -308,7 +464,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000010000000000000000000000000000000000000000000000000000000000000000010"
"000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 11*/ { BARCODE_EANX_CC, -1, -1, "1234567", "[21]A12345678", 0, 8, 72, 1, "GGS Figure 5.11.8-3. (24723:2010 Figure 4) EAN-8 symbol with a three-column CC-A",
+ /* 25*/ { BARCODE_EAN8_CC, -1, -1, "1234567", "^21A12345678", 0, 8, 72, 1, 0, "See above",
"101001111000001001010011000111110101110111101001101001111110011101001101"
"111110010011100101010111000101110011011100001111110100011001011101011101"
"110011001000010001010110000101000001000010001001000110110000011101011001"
@@ -318,7 +474,27 @@ static void test_examples(const testCtx *const p_ctx) {
"000010000000000000000000000000000000000000000000000000000000000000000010"
"000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 12*/ { BARCODE_UPCE_CC, -1, 1, "0121230", "[15]021231", 0, 9, 55, 1, "GGS Figure 5.11.8-4. (24723:2010 Figure 3) UPC-E symbol with a two-column CC-A",
+ /* 26*/ { BARCODE_EAN8_CC, GS1RAW_MODE, -1, "1234567", "21A12345678", 0, 8, 72, 1, 0, "See above",
+ "101001111000001001010011000111110101110111101001101001111110011101001101"
+ "111110010011100101010111000101110011011100001111110100011001011101011101"
+ "110011001000010001010110000101000001000010001001000110110000011101011001"
+ "101011110010000001010010000111011100111101001111001001000010011101010001"
+ "000010000000000000000000000000000000000000000000000000000000000000000010"
+ "000100000000000000000000000000000000000000000000000000000000000000000001"
+ "000010000000000000000000000000000000000000000000000000000000000000000010"
+ "000010100110010010011011110101000110101010011101010000100010011100101010"
+ },
+ /* 27*/ { BARCODE_EANX_CC, -1, -1, "1234567", "[21]A12345678", 0, 8, 72, 1, -1, "GGS Figure 5.11.8-3. (24723:2010 Figure 4) EAN-8 symbol with a three-column CC-A",
+ "101001111000001001010011000111110101110111101001101001111110011101001101"
+ "111110010011100101010111000101110011011100001111110100011001011101011101"
+ "110011001000010001010110000101000001000010001001000110110000011101011001"
+ "101011110010000001010010000111011100111101001111001001000010011101010001"
+ "000010000000000000000000000000000000000000000000000000000000000000000010"
+ "000100000000000000000000000000000000000000000000000000000000000000000001"
+ "000010000000000000000000000000000000000000000000000000000000000000000010"
+ "000010100110010010011011110101000110101010011101010000100010011100101010"
+ },
+ /* 28*/ { BARCODE_UPCE_CC, -1, 1, "0121230", "[15]021231", 0, 9, 55, 1, -1, "GGS Figure 5.11.8-4. (24723:2010 Figure 3) UPC-E symbol with a two-column CC-A",
"1101100110111010011111010001100111100010110011110101001"
"1101101110110010010000110001101000011011100011100101001"
"1101101100111101001000000101000101111000010011101101001"
@@ -329,14 +505,50 @@ static void test_examples(const testCtx *const p_ctx) {
"0001000000000000000000000000000000000000000000000000010"
"0001010110011001001100110010011011011110101001110101010"
},
- /* 13*/ { BARCODE_DBAR_OMN_CC, -1, 1, "0361234567890", "[11]990102", 0, 5, 100, 1, "GGS Figure 5.11.8-5. (24723:2010 Figure 8) GS1 DataBar Omnidirectional symbol with a four-column CC-A",
+ /* 29*/ { BARCODE_UPCE_CC, -1, 1, "0121230", "^15021231", 0, 9, 55, 1, 0, "See above",
+ "1101100110111010011111010001100111100010110011110101001"
+ "1101101110110010010000110001101000011011100011100101001"
+ "1101101100111101001000000101000101111000010011101101001"
+ "1101101000111011110100011101001110011011100011101001001"
+ "1101001000111000010110111101001110001110010011101001101"
+ "0001000000000000000000000000000000000000000000000000010"
+ "0010000000000000000000000000000000000000000000000000001"
+ "0001000000000000000000000000000000000000000000000000010"
+ "0001010110011001001100110010011011011110101001110101010"
+ },
+ /* 30*/ { BARCODE_UPCE_CC, GS1RAW_MODE, 1, "0121230", "15021231", 0, 9, 55, 1, 0, "See above",
+ "1101100110111010011111010001100111100010110011110101001"
+ "1101101110110010010000110001101000011011100011100101001"
+ "1101101100111101001000000101000101111000010011101101001"
+ "1101101000111011110100011101001110011011100011101001001"
+ "1101001000111000010110111101001110001110010011101001101"
+ "0001000000000000000000000000000000000000000000000000010"
+ "0010000000000000000000000000000000000000000000000000001"
+ "0001000000000000000000000000000000000000000000000000010"
+ "0001010110011001001100110010011011011110101001110101010"
+ },
+ /* 31*/ { BARCODE_DBAR_OMN_CC, -1, 1, "0361234567890", "[11]990102", 0, 5, 100, 1, -1, "GGS Figure 5.11.8-5. (24723:2010 Figure 8) GS1 DataBar Omnidirectional symbol with a four-column CC-A",
"1101101110110000101000110001111001010111100010011101001110011101100110011001001100111000110110001010"
"1101101100110111011111001001000011010111111010011001001101000000111010010010111111001110110010001010"
"1101101000110010010111110001011001101111000010011001101111010011110010010000011001011100111010001010"
"0000000000010110001110100000000101001011010111111011001101010000011010000000010100101000110011110000"
"0000010011101001110001001111111000010100101000000100110010101111100101111111100011010111001100001101"
},
- /* 14*/ { BARCODE_DBAR_STK_CC, -1, 1, "0341234567890", "[17]010200", 0, 9, 56, 1, "GGS Figure 5.11.8-6. (24723:2010 Figure 6) GS1 DataBar Stacked symbol with a two-column CC-A",
+ /* 32*/ { BARCODE_DBAR_OMN_CC, -1, 1, "0361234567890", "^11990102", 0, 5, 100, 1, 0, "See above",
+ "1101101110110000101000110001111001010111100010011101001110011101100110011001001100111000110110001010"
+ "1101101100110111011111001001000011010111111010011001001101000000111010010010111111001110110010001010"
+ "1101101000110010010111110001011001101111000010011001101111010011110010010000011001011100111010001010"
+ "0000000000010110001110100000000101001011010111111011001101010000011010000000010100101000110011110000"
+ "0000010011101001110001001111111000010100101000000100110010101111100101111111100011010111001100001101"
+ },
+ /* 33*/ { BARCODE_DBAR_OMN_CC, GS1RAW_MODE, 1, "0361234567890", "11990102", 0, 5, 100, 1, 0, "See above",
+ "1101101110110000101000110001111001010111100010011101001110011101100110011001001100111000110110001010"
+ "1101101100110111011111001001000011010111111010011001001101000000111010010010111111001110110010001010"
+ "1101101000110010010111110001011001101111000010011001101111010011110010010000011001011100111010001010"
+ "0000000000010110001110100000000101001011010111111011001101010000011010000000010100101000110011110000"
+ "0000010011101001110001001111111000010100101000000100110010101111100101111111100011010111001100001101"
+ },
+ /* 34*/ { BARCODE_DBAR_STK_CC, -1, 1, "0341234567890", "[17]010200", 0, 9, 56, 1, -1, "GGS Figure 5.11.8-6. (24723:2010 Figure 6) GS1 DataBar Stacked symbol with a two-column CC-A",
"01101100110101110011100111101010000100001111011110101001"
"01101101110110110001000010001110111101100100011100101001"
"01101101100110100001111011001111110011010110011101101001"
@@ -347,7 +559,29 @@ static void test_examples(const testCtx *const p_ctx) {
"00000011010111101010000010101010101001001101010000000000"
"10101100111000010101111111110111000110110011100101000000"
},
- /* 15*/ { BARCODE_DBAR_LTD_CC, -1, 2, "0351234567890", "[91]abcdefghijklmnopqrstuv", 0, 17, 88, 1, "GGS Figure 5.11.8-7. (24723:2010 Figure 7) GS1 DataBar Limited symbol with a three-column CC-B **NOT SAME** (using [91] not [21] as length > 20 max for [21])",
+ /* 35*/ { BARCODE_DBAR_STK_CC, -1, 1, "0341234567890", "^17010200", 0, 9, 56, 1, 0, "See above",
+ "01101100110101110011100111101010000100001111011110101001"
+ "01101101110110110001000010001110111101100100011100101001"
+ "01101101100110100001111011001111110011010110011101101001"
+ "01101101000100110000101110001011100000110111011101001001"
+ "01101001000101110111110111001001100110100000011101001101"
+ "00000001011011100010000010101010100000101101010000000000"
+ "01001110100100011101111100000001011111010010100010000000"
+ "00000011010111101010000010101010101001001101010000000000"
+ "10101100111000010101111111110111000110110011100101000000"
+ },
+ /* 36*/ { BARCODE_DBAR_STK_CC, GS1RAW_MODE, 1, "0341234567890", "17010200", 0, 9, 56, 1, 0, "See above",
+ "01101100110101110011100111101010000100001111011110101001"
+ "01101101110110110001000010001110111101100100011100101001"
+ "01101101100110100001111011001111110011010110011101101001"
+ "01101101000100110000101110001011100000110111011101001001"
+ "01101001000101110111110111001001100110100000011101001101"
+ "00000001011011100010000010101010100000101101010000000000"
+ "01001110100100011101111100000001011111010010100010000000"
+ "00000011010111101010000010101010101001001101010000000000"
+ "10101100111000010101111111110111000110110011100101000000"
+ },
+ /* 37*/ { BARCODE_DBAR_LTD_CC, -1, 2, "0351234567890", "[91]abcdefghijklmnopqrstuv", 0, 17, 88, 1, -1, "GGS Figure 5.11.8-7. (24723:2010 Figure 7) GS1 DataBar Limited symbol with a three-column CC-B **NOT SAME** (using [91] not [21] as length > 20 max for [21])",
"1101110100111011111011101001011000100100000100001000101111101101001111011011101001000000"
"1101100100111111010100111001011000110111101100001100101010000111100010011011001001000000"
"1101100110100111100001001001010000110111011100101111001101110010001110011011001101000000"
@@ -366,7 +600,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000111101110001101000111010101011010100110010111010010011100011010111000000000"
"0000000000101000010001110010111000101010100101011001101000101101100011100101000010100000"
},
- /* 16*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, 2, "0351234567890", "[21]abcdefghijklmnopqrstuv", 0, 17, 88, 1, "GGS Figure 5.11.8-7. (24723:2010 Figure 7) GS1 DataBar Limited symbol with a three-column CC-B, same",
+ /* 38*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, 2, "0351234567890", "[21]abcdefghijklmnopqrstuv", 0, 17, 88, 1, -1, "GGS Figure 5.11.8-7. (24723:2010 Figure 7) GS1 DataBar Limited symbol with a three-column CC-B, same",
"1101110100111011111011101001011000100100000100001000101111010011011111011011101001000000"
"1101100100101111100101110001011000110111110001010011001111101100001001011011001001000000"
"1101100110101111000110110001010000110111011100101111001101110010001110011011001101000000"
@@ -385,14 +619,28 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000111101110001101000111010101011010100110010111010010011100011010111000000000"
"0000000000101000010001110010111000101010100101011001101000101101100011100101000010100000"
},
- /* 17*/ { BARCODE_DBAR_EXP_CC, -1, 1, "[01]93712345678904[3103]001234", "[91]1A2B3C4D5E", 0, 5, 151, 1, "GGS Figure 5.11.8-8. (24723:2010 Figure 9) GS1 DataBar Expanded symbol with a four-column CC-A, same, verified against BWIPP and tec-it",
+ /* 39*/ { BARCODE_DBAR_EXP_CC, -1, 1, "[01]93712345678904[3103]001234", "[91]1A2B3C4D5E", 0, 5, 151, 1, -1, "GGS Figure 5.11.8-8. (24723:2010 Figure 9) GS1 DataBar Expanded symbol with a four-column CC-A, same, verified against BWIPP and tec-it",
"0011011011101110011010011000011100011100110110100111010011010001000011000101101110011000001101100010100000000000000000000000000000000000000000000000000"
"0011011011001101110111110100011010001111001100100110010010111111001001100100101111110011101100100010100000000000000000000000000000000000000000000000000"
"0011011010001010111011111100011111011011110010100110011011000011010011110100001011001111101110100010100000000000000000000000000000000000000000000000000"
"0000011011111011000100000000101001010000011101001110100110001100111101000010101000011010001110001000100001010000111001010000001010010111000110010110000"
"0101100100000100111011111111000010101111100010110001011001110011000010111100000011100101110001110111011110101111000110001111110000101000111001101000010"
},
- /* 18*/ { BARCODE_GS1_128_CC, -1, 1, "[01]03212345678906", "[21]A1B2C3D4E5F6G7H8", 0, 6, 145, 1, "GGS Figure 5.11.8-9. (24723:2010 Figure 11) GS1-128 symbol with a four-column CC-A",
+ /* 40*/ { BARCODE_DBAR_EXP_CC, -1, 1, "^01937123456789043103001234", "^911A2B3C4D5E", 0, 5, 151, 1, 0, "See above",
+ "0011011011101110011010011000011100011100110110100111010011010001000011000101101110011000001101100010100000000000000000000000000000000000000000000000000"
+ "0011011011001101110111110100011010001111001100100110010010111111001001100100101111110011101100100010100000000000000000000000000000000000000000000000000"
+ "0011011010001010111011111100011111011011110010100110011011000011010011110100001011001111101110100010100000000000000000000000000000000000000000000000000"
+ "0000011011111011000100000000101001010000011101001110100110001100111101000010101000011010001110001000100001010000111001010000001010010111000110010110000"
+ "0101100100000100111011111111000010101111100010110001011001110011000010111100000011100101110001110111011110101111000110001111110000101000111001101000010"
+ },
+ /* 41*/ { BARCODE_DBAR_EXP_CC, GS1RAW_MODE, 1, "01937123456789043103001234", "911A2B3C4D5E", 0, 5, 151, 1, 0, "See above",
+ "0011011011101110011010011000011100011100110110100111010011010001000011000101101110011000001101100010100000000000000000000000000000000000000000000000000"
+ "0011011011001101110111110100011010001111001100100110010010111111001001100100101111110011101100100010100000000000000000000000000000000000000000000000000"
+ "0011011010001010111011111100011111011011110010100110011011000011010011110100001011001111101110100010100000000000000000000000000000000000000000000000000"
+ "0000011011111011000100000000101001010000011101001110100110001100111101000010101000011010001110001000100001010000111001010000001010010111000110010110000"
+ "0101100100000100111011111111000010101111100010110001011001110011000010111100000011100101110001110111011110101111000110001111110000101000111001101000010"
+ },
+ /* 42*/ { BARCODE_GS1_128_CC, -1, 1, "[01]03212345678906", "[21]A1B2C3D4E5F6G7H8", 0, 6, 145, 1, -1, "GGS Figure 5.11.8-9. (24723:2010 Figure 11) GS1-128 symbol with a four-column CC-A",
"0000000000000000000001101001000110100001000001101101011110111110010010001101010000010010000011101110100010000111011001010000000000000000000000000"
"0000000000000000000001101011000110101111001100001111010001101100010010000101111000011001101011100101100001000110011001010000000000000000000000000"
"0000000000000000000001101011100100011001100111101011000101110000010110000101001100110011110011011110011001110110111001010000000000000000000000000"
@@ -400,7 +648,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0010110001100001010001001100100110110110011100100011011000100100010100010011101111010011001001000010110011011100010100001000100010010011100010100"
"1101001110011110101110110011011001001001100011011100100111011011101011101100010000101100110110111101001100100011101011110111011101101100011101011"
},
- /* 19*/ { BARCODE_DBAR_EXPSTK_CC, -1, 1, "[01]00012345678905[10]ABCDEF", "[21]12345678", 0, 13, 102, 1, "24723:2010 Figure 10 — A GS1 DataBar Expanded Stacked Composite symbol (with CC-A) **NOT SAME** bottom 1st and top 2nd linear row separators different; zint same as BWIPP and hard to see how figure in standard could be correct",
+ /* 43*/ { BARCODE_DBAR_EXPSTK_CC, -1, 1, "[01]00012345678905[10]ABCDEF", "[21]12345678", 0, 13, 102, 1, -1, "24723:2010 Figure 10 — A GS1 DataBar Expanded Stacked Composite symbol (with CC-A) **NOT SAME** bottom 1st and top 2nd linear row separators different; zint same as BWIPP and hard to see how figure in standard could be correct",
"001101101110110100001000001101001100111011000010011101001000110011100110010100111011100000110110001010"
"001101101100101111110100011001111101101000001010011001001011111011011110011010111000100000110010001010"
"001101101000100101001111000001000111011101111010011001101011110110110000011010001011111000111010001010"
@@ -415,7 +663,37 @@ static void test_examples(const testCtx *const p_ctx) {
"000000111001111101010100001010100101011111000010100000000000000000000000000000000000000000000000000000"
"010111000110000010100011110000001010100000111101000100000000000000000000000000000000000000000000000000"
},
- /* 20*/ { BARCODE_GS1_128_CC, -1, 3, "[00]030123456789012340", "[02]13012345678909[37]24[10]1234567ABCDEFG", 0, 7, 174, 1, "24723:2010 Figure 12 — A GS1-128 Composite symbol (with CC-C)",
+ /* 44*/ { BARCODE_DBAR_EXPSTK_CC, -1, 1, "^010001234567890510ABCDEF", "^2112345678", 0, 13, 102, 1, 0, "See above",
+ "001101101110110100001000001101001100111011000010011101001000110011100110010100111011100000110110001010"
+ "001101101100101111110100011001111101101000001010011001001011111011011110011010111000100000110010001010"
+ "001101101000100101001111000001000111011101111010011001101011110110110000011010001011111000111010001010"
+ "000001000111011100010000000010100100001101100000101010000110010000010100000101010001110100111100100000"
+ "010110111000100011101111111100001011110010011111010101111001101111101011111000000110001011000011011101"
+ "000001000111011100010000000010100100001101100000101010000110010000010100000101010001110100111100100000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000110001000010100001000000001010010000001000110101111011001110001001010000001010000101001000010000"
+ "101111001110111101011100111111110101101111110111001010000100110001110100001111110001111010110111100010"
+ "000000110001000010100001000000001010010000001000110101111011001110001001010000001010000101001000010000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000111001111101010100001010100101011111000010100000000000000000000000000000000000000000000000000000"
+ "010111000110000010100011110000001010100000111101000100000000000000000000000000000000000000000000000000"
+ },
+ /* 45*/ { BARCODE_DBAR_EXPSTK_CC, GS1RAW_MODE, 1, "010001234567890510ABCDEF", "2112345678", 0, 13, 102, 1, 0, "See above",
+ "001101101110110100001000001101001100111011000010011101001000110011100110010100111011100000110110001010"
+ "001101101100101111110100011001111101101000001010011001001011111011011110011010111000100000110010001010"
+ "001101101000100101001111000001000111011101111010011001101011110110110000011010001011111000111010001010"
+ "000001000111011100010000000010100100001101100000101010000110010000010100000101010001110100111100100000"
+ "010110111000100011101111111100001011110010011111010101111001101111101011111000000110001011000011011101"
+ "000001000111011100010000000010100100001101100000101010000110010000010100000101010001110100111100100000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000110001000010100001000000001010010000001000110101111011001110001001010000001010000101001000010000"
+ "101111001110111101011100111111110101101111110111001010000100110001110100001111110001111010110111100010"
+ "000000110001000010100001000000001010010000001000110101111011001110001001010000001010000101001000010000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000111001111101010100001010100101011111000010100000000000000000000000000000000000000000000000000000"
+ "010111000110000010100011110000001010100000111101000100000000000000000000000000000000000000000000000000"
+ },
+ /* 46*/ { BARCODE_GS1_128_CC, -1, 3, "[00]030123456789012340", "[02]13012345678909[37]24[10]1234567ABCDEFG", 0, 7, 174, 1, -1, "24723:2010 Figure 12 — A GS1-128 Composite symbol (with CC-C)",
"111111110101010001111010101111000011010111011110000111011111011101001000001000010001011110101100111110111010010001110001000100011000011011111010100111110111111101000101001000"
"111111110101010001111110101000111010000100111101000110011110101111101111010001010000011111000110010100111001011100011001001001111101100011111101010111000111111101000101001000"
"111111110101010001010100011110000011001111100001010110100010111110001110111101011100011000001101011110101111001000000101100001011111101011101010001111110111111101000101001000"
@@ -424,7 +702,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000000101100011000010100010010011001101101100111001100100110001001000101000100111011110100110010010000100110010011000100100010011101011101000010001000100001010011100010100"
"000000011010011100111101011101101100110010010011000110011011001110110111010111011000100001011001101101111011001101100111011011101100010100010111101110111011110101100011101011"
},
- /* 21*/ { BARCODE_DBAR_STK_CC, -1, 1, "12345678901231", "[91]12345678901234567890", 0, 10, 56, 1, "Example with CC-A 2 cols, 6 rows",
+ /* 47*/ { BARCODE_DBAR_STK_CC, -1, 1, "12345678901231", "[91]12345678901234567890", 0, 10, 56, 1, -1, "Example with CC-A 2 cols, 6 rows",
"01100100010111100110100111001011101110001000011100101101"
"01110100010110001011101000001000111010111110011000101101"
"01110110010110101100111111001000111100001001011000101001"
@@ -436,7 +714,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000110001101011010101010101010101101010000100000000000"
"10101001111010000101100000000111000010100111011101000000"
},
- /* 22*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012", 0, 13, 56, 1, "Example with CC-A 2 cols, 7 rows",
+ /* 48*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012", 0, 13, 56, 1, -1, "Example with CC-A 2 cols, 7 rows",
"01110110110100100011111001101110001011100110011100010101"
"01110010110111000110101111101001111100110010011000010101"
"01100010110111010110011110001110001110110011011000110101"
@@ -451,7 +729,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000110000101111010010101010000111101011000100000000000"
"10101001111010000101100000000111000010100111011101000000"
},
- /* 23*/ { BARCODE_UPCE_CC, -1, 1, "1234567", "[91]1234567890123456789012345678", 0, 12, 55, 1, "Example with CC-A 3 cols, 8 rows",
+ /* 49*/ { BARCODE_UPCE_CC, -1, 1, "1234567", "[91]1234567890123456789012345678", 0, 12, 55, 1, -1, "Example with CC-A 3 cols, 8 rows",
"1110111010100100011111001101110001011100110011011011101"
"1110011010111000110101111101001111100110010011011011001"
"1111011010111010110011110001110001110110011011011010001"
@@ -465,7 +743,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0001000000000000000000000000000000000000000000000000010"
"0001010010011011110101000110111001000010100100010101010"
},
- /* 24*/ { BARCODE_DBAR_STK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901", 0, 13, 56, 1, "Example with CC-A 2 cols, 9 rows",
+ /* 50*/ { BARCODE_DBAR_STK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901", 0, 13, 56, 1, -1, "Example with CC-A 2 cols, 9 rows",
"01100011010100100011111001101110001011100110011010111101"
"01100010010111000110101111101001111100110010011010011101"
"01110010010111010110011110001110001110110011011010011001"
@@ -480,7 +758,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000110001101011010101010101010101101010000100000000000"
"10101001111010000101100000000111000010100111011101000000"
},
- /* 25*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901234567", 0, 16, 56, 1, "Example with CC-A 2 cols, 10 rows",
+ /* 51*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901234567", 0, 16, 56, 1, -1, "Example with CC-A 2 cols, 10 rows",
"01101001000111100110100111001011101110001000011101001101"
"01101011000110001011101000001000111010111110011101011101"
"01101011100110101100111111001000111100001001011101011001"
@@ -498,7 +776,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000110000101111010010101010000111101011000100000000000"
"10101001111010000101100000000111000010100111011101000000"
},
- /* 26*/ { BARCODE_UPCE_CC, -1, 1, "1234567", "[91]123456789012345678901234567890123456789012334", 0, 16, 55, 1, "Example with CC-A 2 cols, 12 rows",
+ /* 52*/ { BARCODE_UPCE_CC, -1, 1, "1234567", "[91]123456789012345678901234567890123456789012334", 0, 16, 55, 1, -1, "Example with CC-A 2 cols, 12 rows",
"1110010100100100011111001101110001011100110011011000101"
"1110110100111000110101111101001111100110010011001000101"
"1110100100111010110011110001110001110110011011101000101"
@@ -516,7 +794,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0001000000000000000000000000000000000000000000000000010"
"0001010010011011110101000110111001000010100100010101010"
},
- /* 27*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345", 0, 7, 79, 1, "Example with CC-A 3 cols, 5 rows",
+ /* 53*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345", 0, 7, 79, 1, -1, "Example with CC-A 3 cols, 5 rows",
"0111100110100111001001101000101110111000100001011101110010000011000010101000000"
"0100011101011111001011101000111010110010000001100111101011111011000110101000000"
"0101100111011111001011001000110110000010111101110001011111001011000100101000000"
@@ -525,7 +803,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 28*/ { BARCODE_EAN8_CC, -1, 1, "1234567", "[91]1234567890123456789012345678901", 0, 10, 72, 1, "Example with CC-A 3 cols, 6 rows",
+ /* 54*/ { BARCODE_EAN8_CC, -1, 1, "1234567", "[91]1234567890123456789012345678901", 0, 10, 72, 1, -1, "Example with CC-A 3 cols, 6 rows",
"100100011111001101011000100111000101110011001100010111010000011110100101"
"100111110011001001011000110110101100111111001000111100001001011110101101"
"111100100010111101010000110111011000001011001000010100001000011110101001"
@@ -537,7 +815,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000010000000000000000000000000000000000000000000000000000000000000000010"
"000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 29*/ { BARCODE_EANX_CC, -1, 1, "1234567", "[91]1234567890123456789012345678901", 0, 10, 72, 1, "Example with CC-A 3 cols, 6 rows",
+ /* 55*/ { BARCODE_EANX_CC, -1, 1, "1234567", "[91]1234567890123456789012345678901", 0, 10, 72, 1, -1, "Example with CC-A 3 cols, 6 rows",
"100100011111001101011000100111000101110011001100010111010000011110100101"
"100111110011001001011000110110101100111111001000111100001001011110101101"
"111100100010111101010000110111011000001011001000010100001000011110101001"
@@ -549,7 +827,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000010000000000000000000000000000000000000000000000000000000000000000010"
"000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 30*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901234567", 0, 9, 79, 1, "Example with CC-A 3 cols, 7 rows",
+ /* 56*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901234567", 0, 9, 79, 1, -1, "Example with CC-A 3 cols, 7 rows",
"0100010001101111101011010000110001101000111101110001101011111011001010001000000"
"0110000010011011101001010000111010110011110001110001110110011011001011001000000"
"0110010111101100001001011000100100001111000101110001011101100011001011101000000"
@@ -560,7 +838,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 31*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]123456789012345678901234567890123456789012345", 0, 10, 79, 1, "Example with CC-A 3 cols, 8 rows",
+ /* 57*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]123456789012345678901234567890123456789012345", 0, 10, 79, 1, -1, "Example with CC-A 3 cols, 8 rows",
"0100010001101111101011001110110001101000111101110001101011111011100101101000000"
"0110000010011011101001001110111010110011110001110001110110011011000101101000000"
"0110010111101100001001101110100100001111000101110001011101100011000101001000000"
@@ -572,7 +850,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 32*/ { BARCODE_UPCA_CC, -1, 1, "12345678901", "[91]12345678901234567890", 0, 7, 99, 1, "Example with CC-A 4 cols, 3 rows",
+ /* 58*/ { BARCODE_UPCA_CC, -1, 1, "12345678901", "[91]12345678901234567890", 0, 7, 99, 1, -1, "Example with CC-A 4 cols, 3 rows",
"110110111011110011010011100101110111000100001001110100101110111001000001100000100110111011011000101"
"110110110011101011001000000110011110101111101001100100110010111101100001110010111011000011001000101"
"110110100010011101000001100100111111011101001001100110111111001011010001000001100010111011101000101"
@@ -581,7 +859,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
},
- /* 33*/ { BARCODE_DBAR_OMN_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678", 0, 6, 100, 1, "Example with CC-A 4 cols, 4 rows",
+ /* 59*/ { BARCODE_DBAR_OMN_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678", 0, 6, 100, 1, -1, "Example with CC-A 4 cols, 4 rows",
"1101001000111100110100111001011101110001000010010001101011101110010000011000001001101110111011001010"
"1101011000111010110010000001100111101011111010010000101100101111011000011011011110000100110011001010"
"1101011100100011111011001001000000100101111010110000101100011111010010011000110101111000110111001010"
@@ -589,7 +867,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000001100011000110101000000001001011011100001001010110000101111010010101010000111101011000100000"
"0000010010011100111001000111111110010100100011110110101001111010000101100000000111000010100111011101"
},
- /* 34*/ { BARCODE_DBAR_EXP_CC, -1, 1, "[01]12345678901231", "[91]1234567890123456789012345678901234567", 0, 7, 134, 1, "Example with CC-A 4 cols, 5 rows",
+ /* 60*/ { BARCODE_DBAR_EXP_CC, -1, 1, "[01]12345678901231", "[91]1234567890123456789012345678901234567", 0, 7, 134, 1, -1, "Example with CC-A 4 cols, 5 rows",
"00110101111011110011010011100101110111000100001011100010101110111001000001100000100110111011011110101000000000000000000000000000000000"
"00110100111011101011001000000110011110101111101011100110110010111101100001001000011110001011001110101000000000000000000000000000000000"
"00110100110010001101001110000110001010011111001011100100101111100001100101000111100010100011101110101000000000000000000000000000000000"
@@ -598,7 +876,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00001011100111110001000000001010010011000000101001100011100100111011010000101010000111000011110101001101011110000010010100000010100000"
"01010100011000001110111111110000101100111111010110011100011011000100101111000000111000111100001010110010100001111101100011111100001010"
},
- /* 35*/ { BARCODE_DBAR_EXPSTK_CC, -1, 1, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345", 0, 12, 102, 1, "Example with CC-A 4 cols, 6 rows",
+ /* 61*/ { BARCODE_DBAR_EXPSTK_CC, -1, 1, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345", 0, 12, 102, 1, -1, "Example with CC-A 4 cols, 6 rows",
"001100010110111100110100111001011101110001000010011100101011101110010000011000001001101110110101111010"
"001100010100111010110010000001100111101011111010011110101100101111011000010010000111100010110100111010"
"001100110100100011010011100001100010100111110010111110101011111000011001010001111000101000110100110010"
@@ -612,7 +890,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000101111000001001010000001010010111100111110110000000000000000000000000000000000000000000000000000"
"001001010000111110110001111110000101000011000001001010000000000000000000000000000000000000000000000000"
},
- /* 36*/ { BARCODE_EAN13_CC, -1, 1, "123456789012", "[91]123456789012345678901234567890123456789012345678901234", 0, 11, 99, 1, "Example with CC-A 4 cols, 7 rows",
+ /* 62*/ { BARCODE_EAN13_CC, -1, 1, "123456789012", "[91]123456789012345678901234567890123456789012345678901234", 0, 11, 99, 1, -1, "Example with CC-A 4 cols, 7 rows",
"110010111010010001111100110111000101110011001000011010110001011101000001000111010111110011011011001"
"110010011011010110011111100100011110000100101000111010101100111011111001011100010011000011011010001"
"110011011011011101110011000101100011010000001000110010111101111001001001100001101100011011010010001"
@@ -625,7 +903,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001001101111010011101011000100001010010001010101001000111010011100101100110110110010010001010"
},
- /* 37*/ { BARCODE_EANX_CC, -1, 1, "123456789012", "[91]123456789012345678901234567890123456789012345678901234", 0, 11, 99, 1, "Example with CC-A 4 cols, 7 rows",
+ /* 63*/ { BARCODE_EANX_CC, -1, 1, "123456789012", "[91]123456789012345678901234567890123456789012345678901234", 0, 11, 99, 1, -1, "Example with CC-A 4 cols, 7 rows",
"110010111010010001111100110111000101110011001000011010110001011101000001000111010111110011011011001"
"110010011011010110011111100100011110000100101000111010101100111011111001011100010011000011011010001"
"110011011011011101110011000101100011010000001000110010111101111001001001100001101100011011010010001"
@@ -638,7 +916,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001001101111010011101011000100001010010001010101001000111010011100101100110110110010010001010"
},
- /* 38*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]1234567890123", 0, 12, 55, 1, "Example with CC-B 2 cols, 8 rows",
+ /* 64*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]1234567890123", 0, 12, 55, 1, -1, "Example with CC-B 2 cols, 8 rows",
"1100100010111011111011101001000001000010001011001000101"
"1110100010110100001111011001100101110000100011101000101"
"1110110010101100100111000001011111011000001011101100101"
@@ -652,7 +930,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0001000000000000000000000000000000000000000000000000010"
"0001010010011011110101000110111001000010100100010101010"
},
- /* 39*/ { BARCODE_DBAR_STK_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567", 0, 15, 56, 1, "Example with CC-B 2 cols, 11 rows",
+ /* 65*/ { BARCODE_DBAR_STK_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567", 0, 15, 56, 1, -1, "Example with CC-B 2 cols, 11 rows",
"01100100010111011111011101001000001000010001011100110101"
"01110100010110100001111011001100101110000100011110110101"
"01110110010101100100111000001011111011000001011110010101"
@@ -669,7 +947,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000110001101011010101010101010101101010000100000000000"
"10101001111010000101100000000111000010100111011101000000"
},
- /* 40*/ { BARCODE_DBAR_OMNSTK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123", 0, 20, 56, 1, "Example with CC-B 2 cols, 14 rows",
+ /* 66*/ { BARCODE_DBAR_OMNSTK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123", 0, 20, 56, 1, -1, "Example with CC-B 2 cols, 14 rows",
"01110111010100011111010011101101111110101110011101110101"
"01110011010100100101111000001001000100001111011100110101"
"01111011010101101111001110001111011110101000011110110101"
@@ -691,7 +969,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000110000101111010010101010000111101011000100000000000"
"10101001111010000101100000000111000010100111011101000000"
},
- /* 41*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567", 0, 21, 55, 1, "Example with CC-B 2 cols, 17 rows",
+ /* 67*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567", 0, 21, 55, 1, -1, "Example with CC-B 2 cols, 17 rows",
"1100110100100000011100101101100111111011001011001101001"
"1101110100111110110100111101110110010000110011011101001"
"1101100100111001011001000001110001101110100011011001001"
@@ -714,7 +992,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0001000000000000000000000000000000000000000000000000010"
"0001010010011011110101000110111001000010100100010101010"
},
- /* 42*/ { BARCODE_DBAR_STK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890", 0, 24, 56, 1, "Example with CC-B 2 cols, 20 rows",
+ /* 68*/ { BARCODE_DBAR_STK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890", 0, 24, 56, 1, -1, "Example with CC-B 2 cols, 20 rows",
"01111010100111011111011101001000001000010001011110101001"
"01110010100110100001111011001100101110000100011100101001"
"01110110100101100100111000001011111011000001011101101001"
@@ -740,7 +1018,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000110001101011010101010101010101101010000100000000000"
"10101001111010000101100000000111000010100111011101000000"
},
- /* 43*/ { BARCODE_DBAR_OMNSTK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012", 0, 29, 56, 1, "Example with CC-B 2 cols, 23 rows",
+ /* 69*/ { BARCODE_DBAR_OMNSTK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012", 0, 29, 56, 1, -1, "Example with CC-B 2 cols, 23 rows",
"01110011010100000011100101101100111111011001011110100101"
"01111011010111110110100111101110110010000110011110101101"
"01111001010111001011001000001110001101110100011110101001"
@@ -771,7 +1049,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000110000101111010010101010000111101011000100000000000"
"10101001111010000101100000000111000010100111011101000000"
},
- /* 44*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 30, 55, 1, "Example with CC-B 2 cols, 26 rows",
+ /* 70*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 30, 55, 1, -1, "Example with CC-B 2 cols, 26 rows",
"1100101000100000011100101101000001111001010011000101001"
"1100101100111110110100111101110110010000110011001101001"
"1100101110111001011001000001110001101110100011011101001"
@@ -803,7 +1081,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0001000000000000000000000000000000000000000000000000010"
"0001010010011011110101000110111001000010100100010101010"
},
- /* 45*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456", 0, 8, 88, 1, "Example with CC-B 3 cols, 6 rows",
+ /* 71*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456", 0, 8, 88, 1, -1, "Example with CC-B 3 cols, 6 rows",
"1100100010111011111011101001011001110100000100001000101110100001000111011001000101000000"
"1110100010111010111101110001001001110101000011110010001101011100000010011101000101000000"
"1110110010110011010000111101001101110110111110100010001011001001110000011101100101000000"
@@ -813,7 +1091,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 46*/ { BARCODE_EAN8_CC, -1, 2, "1234567", "[91]123456789012345678", 0, 12, 82, 1, "Example with CC-B 3 cols, 8 rows",
+ /* 72*/ { BARCODE_EAN8_CC, -1, 2, "1234567", "[91]123456789012345678", 0, 12, 82, 1, -1, "Example with CC-B 3 cols, 8 rows",
"1100111010111011111011101001000010110100000100001000101111101101001111011001110101"
"1110111010110010111000010001000010010111001011001000001110001101110100011101110101"
"1110011010110111111001101001000011010101000101111000001100100110111111011100110101"
@@ -827,7 +1105,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
"0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 47*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]123456789012345678", 0, 12, 82, 1, "Example with CC-B 3 cols, 8 rows",
+ /* 73*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]123456789012345678", 0, 12, 82, 1, -1, "Example with CC-B 3 cols, 8 rows",
"1100111010111011111011101001000010110100000100001000101111101101001111011001110101"
"1110111010110010111000010001000010010111001011001000001110001101110100011101110101"
"1110011010110111111001101001000011010101000101111000001100100110111111011100110101"
@@ -841,7 +1119,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
"0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 48*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]12345678901234567890123456789", 0, 12, 88, 1, "Example with CC-B 3 cols, 10 rows",
+ /* 74*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]12345678901234567890123456789", 0, 12, 88, 1, -1, "Example with CC-B 3 cols, 10 rows",
"1100010010100000011100101101001111010110011111101100101001001011110000011000100101000000"
"1110010010111011001000011001011111010101101111001110001111011110101000011100100101000000"
"1111010010110001110111110101011110010111010001110001101110110011110011011110100101000000"
@@ -855,7 +1133,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 49*/ { BARCODE_EAN8_CC, -1, 2, "1234567", "[91]12345678901234567890123456789012345678901", 0, 16, 82, 1, "Example with CC-B 3 cols, 12 rows",
+ /* 75*/ { BARCODE_EAN8_CC, -1, 2, "1234567", "[91]12345678901234567890123456789012345678901", 0, 16, 82, 1, -1, "Example with CC-B 3 cols, 12 rows",
"1110101100111011111011101001011000010100000100001000101111101101001111011101011001"
"1110101000110010111000010001011100010111001011001000001110001101110100011101010001"
"1100101000110111111001101001011100110110010110011111101100110010001111011001010001"
@@ -873,7 +1151,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
"0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 50*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]12345678901234567890123456789012345678901", 0, 16, 82, 1, "Example with CC-B 3 cols, 12 rows",
+ /* 76*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]12345678901234567890123456789012345678901", 0, 16, 82, 1, -1, "Example with CC-B 3 cols, 12 rows",
"1110101100111011111011101001011000010100000100001000101111101101001111011101011001"
"1110101000110010111000010001011100010111001011001000001110001101110100011101010001"
"1100101000110111111001101001011100110110010110011111101100110010001111011001010001"
@@ -891,7 +1169,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
"0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 51*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567", 0, 17, 88, 1, "Example with CC-B 3 cols, 15 rows",
+ /* 77*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567", 0, 17, 88, 1, -1, "Example with CC-B 3 cols, 15 rows",
"1101110100111011111011101001011000100100000100001000101111101101001111011011101001000000"
"1101100100110010111000010001011000110111001011001000001110001101110100011011001001000000"
"1101100110110111111001101001010000110110010110011111101100110010001111011011001101000000"
@@ -910,7 +1188,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 52*/ { BARCODE_EAN8_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]12345678901234567890123", 0, 30, 82, 1, "Example with CC-B 3 cols, 26 rows",
+ /* 78*/ { BARCODE_EAN8_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]12345678901234567890123", 0, 30, 82, 1, -1, "Example with CC-B 3 cols, 26 rows",
"1100100010111011111011101001000011010100000100001000101111101101001111011110100101"
"1110100010110010111000010001000111010111001011001000001110001101110100011110101101"
"1110110010110111111001101001000110010110010110011111101100110010001111011110101001"
@@ -942,7 +1220,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
"0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 53*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]12345678901234567890123", 0, 30, 82, 1, "Example with CC-B 3 cols, 26 rows",
+ /* 79*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]12345678901234567890123", 0, 30, 82, 1, -1, "Example with CC-B 3 cols, 26 rows",
"1100100010111011111011101001000011010100000100001000101111101101001111011110100101"
"1110100010110010111000010001000111010111001011001000001110001101110100011110101101"
"1110110010110111111001101001000110010110010110011111101100110010001111011110101001"
@@ -974,7 +1252,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
"0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
},
- /* 54*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234", 0, 34, 88, 1, "Example with CC-B 3 cols, 32 rows",
+ /* 80*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234", 0, 34, 88, 1, -1, "Example with CC-B 3 cols, 32 rows",
"1110110100100000011100101101011101100110011111101100101001001011110000011011101001000000"
"1110100100111011001000011001001101100101101111001110001111011110101000011011001001000000"
"1110100110110001110111110101000101100111010001110001101110110011110011011011001101000000"
@@ -1010,7 +1288,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 55*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]1234567890123456789012345678901234567890123456789012345678", 0, 40, 88, 1, "Example with CC-B 3 cols, 38 rows",
+ /* 81*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]1234567890123456789012345678901234567890123456789012345678", 0, 40, 88, 1, -1, "Example with CC-B 3 cols, 38 rows",
"1100010010100000011100101101000101100110011111101100101001001011110000011010011101000000"
"1110010010111011001000011001000101000101101111001110001111011110101000011010011001000000"
"1111010010110001110111110101001101000111010001110001101110110011110011011010001001000000"
@@ -1052,7 +1330,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 56*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234567890123456789012345678901", 0, 46, 88, 1, "Example with CC-B 3 cols, 44 rows",
+ /* 82*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234567890123456789012345678901", 0, 46, 88, 1, -1, "Example with CC-B 3 cols, 44 rows",
"1100100010111011111011101001011000010110001110001101001111101101001111011010001001000000"
"1110100010110010111000010001011100010111001011001000001110001101110100011010001101000000"
"1110110010110111111001101001011100110110010110011111101100110010001111011010000101000000"
@@ -1100,7 +1378,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
"0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
},
- /* 57*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]1234567890123", 0, 8, 99, 1, "Example with CC-B 4 cols, 4 rows",
+ /* 83*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]1234567890123", 0, 8, 99, 1, -1, "Example with CC-B 4 cols, 4 rows",
"110100111010001111101001110110111111010111001001110110110100001111011001100101110000100011010010001"
"110100110010110010011100000101111101100000101001110100110111111001101001110100111110010011010110001"
"110100010011100110100001100110010000010110001001100100100111101111010001110001110100010011010111001"
@@ -1110,7 +1388,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
},
- /* 58*/ { BARCODE_EAN13_CC, -1, 2, "123456789012", "[91]1234567890123456789012345", 0, 10, 99, 1, "Example with CC-B 4 cols, 6 rows",
+ /* 84*/ { BARCODE_EAN13_CC, -1, 2, "123456789012", "[91]1234567890123456789012345", 0, 10, 99, 1, -1, "Example with CC-B 4 cols, 6 rows",
"110010001011101111101110100110001110001101001011001110111110110100111101110110010000110011001000101"
"111010001011100101100100000111000110111010001001001110110001110111110101110100011100011011101000101"
"111011001011001100100011110100101000011110001001101110101100010111000001010011000111110011101100101"
@@ -1122,7 +1400,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001001101111010011101011000100001010010001010101001000111010011100101100110110110010010001010"
},
- /* 59*/ { BARCODE_EANX_CC, -1, 2, "123456789012", "[91]1234567890123456789012345", 0, 10, 99, 1, "Example with CC-B 4 cols, 6 rows",
+ /* 85*/ { BARCODE_EANX_CC, -1, 2, "123456789012", "[91]1234567890123456789012345", 0, 10, 99, 1, -1, "Example with CC-B 4 cols, 6 rows",
"110010001011101111101110100110001110001101001011001110111110110100111101110110010000110011001000101"
"111010001011100101100100000111000110111010001001001110110001110111110101110100011100011011101000101"
"111011001011001100100011110100101000011110001001101110101100010111000001010011000111110011101100101"
@@ -1134,7 +1412,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001001101111010011101011000100001010010001010101001000111010011100101100110110110010010001010"
},
- /* 60*/ { BARCODE_GS1_128_CC, -1, 2, "[01]12345678901231", "[91]12345678901234567890123456789012345678901", 0, 10, 145, 1, "Example with CC-B 4 cols, 8 rows",
+ /* 86*/ { BARCODE_GS1_128_CC, -1, 2, "[01]12345678901231", "[91]12345678901234567890123456789012345678901", 0, 10, 145, 1, -1, "Example with CC-B 4 cols, 8 rows",
"0000000000000000000001100111010111011111011101001000001000010001010000101101111101101001111011101100100001100110011101010000000000000000000000000"
"0000000000000000000001110111010111001011001000001110001101110100010000100101100011101111101011101000111000110111011101010000000000000000000000000"
"0000000000000000000001110011010110011001000111101001010000111100010000110101011000101110000011111010011101000111001101010000000000000000000000000"
@@ -1146,7 +1424,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
},
- /* 61*/ { BARCODE_DBAR_OMN_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567", 0, 12, 100, 1, "Example with CC-B 4 cols, 10 rows",
+ /* 87*/ { BARCODE_DBAR_OMN_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567", 0, 12, 100, 1, -1, "Example with CC-B 4 cols, 10 rows",
"1100010010100000011100101101100111111011001010011110101001001011110000010010001000011110110001001010"
"1110010010101101111001110001111011110101000010111110101100001100101000011111001010111110111001001010"
"1111010010111011001111001101110100011000010010111100101001011111011000011111101001011100111101001010"
@@ -1160,7 +1438,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000001100011000110101000000001001011011100001001010110000101111010010101010000111101011000100000"
"0000010010011100111001000111111110010100100011110110101001111010000101100000000111000010100111011101"
},
- /* 62*/ { BARCODE_DBAR_EXP_CC, -1, 2, "[01]12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890123", 0, 14, 134, 1, "Example with CC-B 4 cols, 12 rows",
+ /* 88*/ { BARCODE_DBAR_EXP_CC, -1, 2, "[01]12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890123", 0, 14, 134, 1, -1, "Example with CC-B 4 cols, 12 rows",
"00111010110011101111101110100100000100001000101011000010111110110100111101110110010000110011101011001000000000000000000000000000000000"
"00111010100011100101100100000111000110111010001011100010110001110111110101110100011100011011101010001000000000000000000000000000000000"
"00110010100011001100100011110100101000011110001011100110101100010111000001111101001110100011001010001000000000000000000000000000000000"
@@ -1176,7 +1454,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00001011100111110001000000001010010011000000101001100011100100111011010000101010000111000011110101001101011110000010010100000010100000"
"01010100011000001110111111110000101100111111010110011100011011000100101111000000111000111100001010110010100001111101100011111100001010"
},
- /* 63*/ { BARCODE_UPCA_CC, -1, 2, "123456789012", "[91]12345678901234567890123456789012345678901234567890123456789012345678901234", 0, 19, 99, 1, "Example with CC-B 4 cols, 15 rows",
+ /* 89*/ { BARCODE_UPCA_CC, -1, 2, "123456789012", "[91]12345678901234567890123456789012345678901234567890123456789012345678901234", 0, 19, 99, 1, -1, "Example with CC-B 4 cols, 15 rows",
"110111010011101111101110100100000100001000101011000100111110110100111101110110010000110011011101001"
"110110010011100101100100000111000110111010001011000110110001110111110101110100011100011011011001001"
"110110011011001100100011110100101000011110001010000110101100010111000001111101001110100011011001101"
@@ -1197,7 +1475,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
},
- /* 64*/ { BARCODE_DBAR_EXPSTK_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]1234567890123456789012345678901234567890123456", 0, 26, 102, 1, "Example with CC-B 4 cols, 20 rows",
+ /* 90*/ { BARCODE_DBAR_EXPSTK_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]1234567890123456789012345678901234567890123456", 0, 26, 102, 1, -1, "Example with CC-B 4 cols, 20 rows",
"001100100010111011111011101001000001000010001010111100101111101101001111011101100100001100111001011010"
"001110100010111001011001000001110001101110100010111101101100011101111101011101000111000110110001011010"
"001110110010110011001000111101001010000111100010011101101011000101110000011111010011101000110001010010"
@@ -1225,7 +1503,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000101111000001001010000001010010111100111110110000000000000000000000000000000000000000000000000000"
"001001010000111110110001111110000101000011000001001010000000000000000000000000000000000000000000000000"
},
- /* 65*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]12345678901234567890123456789012345678901234567", 0, 30, 99, 1, "Example with CC-B 4 cols, 26 rows",
+ /* 91*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]12345678901234567890123456789012345678901234567", 0, 30, 99, 1, -1, "Example with CC-B 4 cols, 26 rows",
"110010001011101111101110100110001110001101001000011010111110110100111101110110010000110011110100101"
"111010001011100101100100000111000110111010001000111010110001110111110101110100011100011011110101101"
"111011001011001100100011110100101000011110001000110010101100010111000001111101001110100011110101001"
@@ -1257,7 +1535,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
},
- /* 66*/ { BARCODE_DBAR_EXP_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234", 0, 34, 134, 1, "Example with CC-B 4 cols, 32 rows",
+ /* 92*/ { BARCODE_DBAR_EXP_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234", 0, 34, 134, 1, -1, "Example with CC-B 4 cols, 32 rows",
"00111011010010000001110010110110011111101100101011101100100100101111000001001000100001111011011101001000000000000000000000000000000000"
"00111010010010110111100111000111101111010100001001101100110000110010100001111100101011111011011001001000000000000000000000000000000000"
"00111010011011101100111100110111010001100001001000101100100101111101100001111110100101110011011001101000000000000000000000000000000000"
@@ -1293,7 +1571,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00001011100111110001000000001010010011000000101001100011100100111011010000101010000111000011110101001101011110000010010100000010100000"
"01010100011000001110111111110000101100111111010110011100011011000100101111000000111000111100001010110010100001111101100011111100001010"
},
- /* 67*/ { BARCODE_DBAR_EXPSTK_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234567890123456789012345678901234567890123456789012", 0, 44, 102, 1, "Example with CC-B 4 cols, 38 rows",
+ /* 93*/ { BARCODE_DBAR_EXPSTK_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234567890123456789012345678901234567890123456789012", 0, 44, 102, 1, -1, "Example with CC-B 4 cols, 38 rows",
"001100010010100000011100101101100111111011001010001011001001001011110000010010001000011110110100111010"
"001110010010101101111001110001111011110101000010001010001100001100101000011111001010111110110100110010"
"001111010010111011001111001101110100011000010010011010001001011111011000011111101001011100110100010010"
@@ -1339,7 +1617,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000101111000001001010000001010010111100111110110000000000000000000000000000000000000000000000000000"
"001001010000111110110001111110000101000011000001001010000000000000000000000000000000000000000000000000"
},
- /* 68*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567", 0, 48, 99, 1, "Example with CC-B 4 cols, 44 rows",
+ /* 94*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567", 0, 48, 99, 1, -1, "Example with CC-B 4 cols, 44 rows",
"110010001011101111101110100100000100001000101011000010111110110100111101110110010000110011010001001"
"111010001011100101100100000111000110111010001011100010110001110111110101110100011100011011010001101"
"111011001011001100100011110100101000011110001011100110101100010111000001111101001110100011010000101"
@@ -1389,7 +1667,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
"000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
},
- /* 69*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]12345678901234567890123456789012345678901234567890123456789012345678901234567", 0, 32, 154, 1, "Example with CC-C 5 cols, 30 rows",
+ /* 95*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]12345678901234567890123456789012345678901234567890123456789012345678901234567", 0, 32, 154, 1, -1, "Example with CC-C 5 cols, 30 rows",
"1111111101010100010101000001000000101000001000001001110111110111010010000010000100010111110110100111101110110010000110011110101001111000111111101000101001"
"1111111101010100011111010100000110111001011001000001110001101110100011000111011111010111010001110001101110110011110011011111010100001100111111101000101001"
"1111111101010100011101010011111100100101000011110001011000101110000011111010011101000100010110001111101011100100001100011111101011010000111111101000101001"
@@ -1423,7 +1701,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000000001011000110000101000100110010011010011000110111010011100011101001001111010110010000100101001100011001001110010100001000101110010001001110001010000"
"0000000110100111001111010111011001101100101100111001000101100011100010110110000101001101111011010110011100110110001101011110111010001101110110001110101100"
},
- /* 70*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]12345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 28, 171, 1, "Example with CC-C 6 cols, 25 rows",
+ /* 96*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]12345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 28, 171, 1, -1, "Example with CC-C 6 cols, 25 rows",
"111111110101010001101010000110000011010000001001100111011111011101001000001000010001011111011010011110111011001000011001011011110011100011111010100111110111111101000101001"
"111111110101010001111010100000100011100011011101000110001110111110101110100011100011011101100111100110111010001100001001001011111011000011110101000010000111111101000101001"
"111111110101010001010100011110000011111010011101000100010110001111101011100100001100010011110000010010101100010111000001011010011100000010101000001111000111111101000101001"
@@ -1453,7 +1731,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001010000100010111001000100111000101000000000000000000000"
"000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110101111011101000110111011000111010110000000000000000000"
},
- /* 71*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]1234567890123456789012345678901234567890", 0, 32, 528, 1, "Example with CC-C 27 cols, 30 rows",
+ /* 97*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]1234567890123456789012345678901234567890", 0, 32, 528, 1, -1, "Example with CC-C 27 cols, 30 rows",
"111111110101010001010100000100000010000100001000010111011111011101001000001000010001011111011010011110111011001000011001011011110011100011110111101010000110000110010100001111100101011111010001011000110000101000001100011001100100010000110011010011110111110101100011000010001100110110110000011111011110010110110010001000011001001011100011100011001000010011000100010110000011001000100001000001011011110011101000100001001000010001111101101001111010111001110010000111101001001111001001000010010000011101011100111110111111101000101001"
"111111110101010001111010110011000010010000111101000101000001111010001111110101000111011100110011101000101111010111100001111000100110110011111101001001110111001101110010001001100111110001010101111000010000111100100011011001011010011111100011110011011010000100111011111101001111100110110011010001110100111110111010000111011001001110100111110011000110111101000110000100001110101000111001011111010101111100110000111110001010110001110000001011001011111011010000100100000100011110101101011100000100011111010100001100111111101000101001"
"111111110101010001111110101110011010001111011101110110001110100111001100011000101111011110111010111110110010001001111101110011111001011010110100000111000100010000010111101000110100000111011111101001100100111110100111000101011100010001100011101110101111000110010010001111101001001000001111011101101011111000101100000110111101000111101000010011011101000011100100110110111100001100010010111110011101101111110100100111100011011001000111001000011011001001101111110111010111111011001110011110010111011111101011000100111111101000101001"
@@ -1487,7 +1765,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001010000100010111001000100111000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110101111011101000110111011000111010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
- /* 72*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123" "456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345", 0, 32, 579, 1, "Example with CC-C 30 cols, 30 rows (max)",
+ /* 98*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123" "456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345", 0, 32, 579, 1, -1, "Example with CC-C 30 cols, 30 rows (max)",
"111111110101010001010100000100000010001110111000100111011111011101001100011100011010011111011010011110111011001000011001011011110011100011110111101010000110000110010100001111100101011111010001011000110000101000001100011001100100010000110011010011110111110101100011000010001100110110110000011111011110010110110010001000011001001011100011100011001000010011000100010110000011001000100001000001011011110011101000100001001000010001111101101001111010111001110010000111101001001111001001000010010000011100110111011110101101100010000001110101000111000010101111011110000111111101000101001"
"111111110101010001111101011011100011100110011101000101111010111100001111000100110110011111101001001110111001101110010001001100111110001010101111000010000111100100011011001011010011111100011110011011010000100111011111101001111100110110011010001110100111110111010000111011001001110100111110011000110111101000110000100001110101000111001011111010101111100110000111110001010110001110000001011001011111011010000100100000100011110101101011100000100010111100010111100100010000111101001001101111110110011111011001100110111001011100110001110000010011001011111010100001100111111101000101001"
"111111110101010001010111000111111010110100000111000100010000010111101000110100000111011111101001100100111110100111000101011100010001100011101110101111000110010010001111101001001000001111011101101011111000101100000110111101000111101000010011011101000011100100110110111100001100010010111110011101101111110100100111100011011001000111001000011011001001101111110111010111111011001110011110010111010011110001100110101110000010110001011000001001110010110110000111100100001000010111101101100110011111010101101111100000100101110011111101000011001000111011111101011001000111111101000101001"
@@ -1521,7 +1799,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001010000100010111001000100111000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110101111011101000110111011000111010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
- /* 73*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[97]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[98]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[99]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", 0, 32, 579, 1, "Example with CC-C 30 cols, 30 rows (max)",
+ /* 99*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[97]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[98]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[99]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", 0, 32, 579, 1, -1, "Example with CC-C 30 cols, 30 rows (max)",
"111111110101010001010100000100000010001110111000100111011111011101001100011100011010011111011010011110110100100110000001001100110100000011001100100100000100011000001101001011001100001000010001100001100010100001011000001101110111101101000010000010100001000100100001100110001011000111000011010011000001100010111011001000011001110110100000110010001010000001000100011000110000101100110000100001011110110101110000111011001000110001100100010110000011101100101100000100101110111000001100001011001110011000010000100110110010000100110001110011101000010010101111011110000111111101000101001"
"111111110101010001111101011011100011010001110000100111010001100010001010011111101110011111011001100110111010000011010001111010001000100011111101110110110111100110110010001111001011000011011110001000100010101110011011111101111110011010011011110000101000010111100100100001001110100111101110010001000111100100111101011101110001110101111000111011111101100101100100010011110100001110001000110010011111100010101110101101111100001001111001010000100011110101100110000111010000111011001111101100010100011000100011110110111111011010001101111101100000101011111010100001100111111101000101001"
"111111110101010001010111000111111010010111011111100100001101000011101111110110011101011101011111000100110110001001111001001110011001110010011000011011110111001111100101101110110001011111010010010111100000110001101011110001101110101110000010010110001111100101001011110000001101000100111110011100110100111110111010111110000101101110011001111011100100011111010110111111001100101010010011110000011101011111010000110011000101111001001001100011111010001110110001110111001110101111001110111111010010010000011010011100110111000101110001100111000101110011111101011001000111111101000101001"
@@ -1555,49 +1833,49 @@ static void test_examples(const testCtx *const p_ctx) {
"000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001010000100010111001000100111000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110101111011101000110111011000111010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
- /* 74*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123", "[20]12", 0, 5, 205, 1, "Example with min CC-C input and smallest linear input to bump rows (2 to 3), CC-C 8 cols, 3 rows",
+ /*100*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123", "[20]12", 0, 5, 205, 1, -1, "Example with min CC-C input and smallest linear input to bump rows (2 to 3), CC-C 8 cols, 3 rows",
"1111111101010100011101010111000000111010110011110001110111110111010010000010000100010111010011011110001001100111101110010000110111001100111000101101111001000101110111000011101010001110000111111101000101001"
"1111111101010100011110101000010000111010111011000001111110111001010011111001000100110111000000100110101100100111000001011111010001101110110101110001000001111010100001000011111010101100000111111101000101001"
"1111111101010100011101010001111110100010100011110001111101011100001011000011001011110100101001111000001011111011010000011101111110010100110111100010001101011001001110000010101000011110000111111101000101001"
"0000000001011000110000101000100110010011010011000110111010011100011101001001111010110010000100101001100011001001110010010000100101001100011010000100010011010001100010100001001000100010011100010100000000000"
"0000000110100111001111010111011001101100101100111001000101100011100010110110000101001101111011010110011100110110001101101111011010110011100101111011101100101110011101011110110111011101100011101011000000000"
},
- /* 75*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]12", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, "Example with overlarge linear input and min CC-C input, CC-C 30 cols, 3 rows (bumped up from 1)",
+ /*101*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]12", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, -1, "Example with overlarge linear input and min CC-C input, CC-C 30 cols, 3 rows (bumped up from 1)",
"111111110101010001110101011100000010100010000010000111011111011101001000001000010001011101001101111000100110011110111001000011011100110011100010110111100100010111011100001010111000111000010000101100000110100100000010010001100001100010100011011000111001110110010011101111001000101111011110010100001110001110100011000011010001101111011100010010100110001100000101100011110111001111011110101000010000010001101100100011011001000001110101101111000010001100011100110111011010110000001110111010000100011000010110001110110100001000011001000010010000001010101111011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"111111110101010001111010100001000011110011011000100111100000100010101110010001100001011101011101100000111111011100101001111100100010011011100000010011010110010011100000101111001010000001010110011111001000111111010001011101110001100011101011111000110010100110101111101110001110010011110111011100011011101000110111110010111101110111001111001011110101101100000110011101111100101101000011100100011011000011110010100010001111101101010011110000100010011000111110100111100110110001001111000001000101011100100011000010111010111011000001111110111001010011111010101100000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"111111110101010001010111000111111011011101011100000110001111101000101100010111111001011001001111110010100010001001111001101000001011111011100011110101110110111110011001101101001000111110010011010011100000101111101100000101000000110010111010000110110111100110101101111110001011111000111011010110100001110000101110000100110001101111000010011010100110001111100110101100111111001001010011110000011110101111001000110101000111110001000110001001110010100011001111100100000111001001101000110011011110010011010000111000110111111001101001110101111101000010101000011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010000101000100001001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011101000010001001100110010011100010100"
"000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101111010111011110110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100010111101110110011001101100011101011"
},
- /* 76*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]01[90]123456789012345678901234567890[91]123456789012", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, "Example with overlarge linear input and medium CC-C input, CC-C 30 cols, 3 rows (bumped up from 1 (before last digit) than 2)",
+ /*102*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]01[90]123456789012345678901234567890[91]123456789012", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, -1, "Example with overlarge linear input and medium CC-C input, CC-C 30 cols, 3 rows (bumped up from 1 (before last digit) than 2)",
"111111110101010001110101011100000010100010000010000111011111011101001000001000010001011101001101111000111000101000111001100100011101111010001011000001100101100000110000101101101100110000011010010000110000110000100011011101001110011101000011110111011011100111101100010011101111001001011110011101110001000010111000101001110001011000001100010011010010011000000110011100001101001100011011000011011101110001010000110100001000001101010011000110000010110001111011100111101111010100001000001000110110010001101100100000111010110111100001000110001110011010101111011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"111111110101010001111010100001000011010000111001000110110000111100101000100011111011010100111100001000100110001111101001111001101100010011110000010001010111001000110000101110101110110000011111101110010100111110010001001101110000001001101011001001110000010111100101000000101011001111100100011111101000101110111000110001110101111100011001010011010111110111000111001001111011101110001101110100011011111001011110111011100111100101111010110110000011001110111110010110100001110010001101100001111001010001000111110110101001111000010001001100011111010011111010101100000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"111111110101010001010111000111111010001100110111100101111110111000101001100101110000010101110011111100101111000010000101101110101110000011000111110100010110001011111100101100100111111001010001000100111100110100000101111101110001111010111011011111001100110110100100011111001001101001110000010111110110000010100000011001011101000011011011110010101000011110000101001100011111001101011001111110010010100111100000111111010011010001000110101110000011101111100100110110100011011111101100111110100001011001111100001010100001010011110001101011111100010010101000011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010000101000100001001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011101000010001001100110010011100010100"
"000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101111010111011110110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100010111101110110011001101100011101011"
},
- /* 77*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]01[90]123456789012345678901234567890[91]1234567890123", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, "Example with overlarge linear input and medium CC-C input, CC-C 30 cols, 3 rows (bumped up from 2)",
+ /*103*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]01[90]123456789012345678901234567890[91]1234567890123", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, -1, "Example with overlarge linear input and medium CC-C input, CC-C 30 cols, 3 rows (bumped up from 2)",
"111111110101010001110101011100000010100010000010000111011111011101001000001000010001011101001101111000111000101000111001100100011101111010001011000001100101100000110000101101101100110000011010010000110000110000100011011101001110011101000011110111011011100111101100010011101111001001011110011101110001000010111000101001110001011000001100010011010010011000000110011100001101001100011011000011010111001111001100110100000100110001010011000110000010110001111011100111101111010100001000001000110110010001101100100000111010110111100001000110001110011010101111011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"111111110101010001111010100001000011010000111001000110110000111100101000100011111011010100111100001000100110001111101001111001101100010011110000010001010111001000110000101110101110110000011111101110010100111110010001001101110000001001101011001001110000010111100101000000101011001111100100011111101000101110111000110001110101111100011001010011010111110111000111001001111011101110001101110100011011111001011110111011100111100101111010110110000011001110111110010110100001110010001101100001111001010001000111110110101001111000010001001100011111010011111010101100000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"111111110101010001010111000111111010001100110111100101111110111000101001100101110000010101110011111100101111000010000101101110101110000011000111110100010110001011111100101100100111111001010001000100111100110100000101111101110001111010111011011111001100110110100100011111001001101001110000010111110110000010100000011001011101000011011011110010101000011110000101001100011111001101011001111110010010100111100000111011110001011101101111000001011010111100000100010110100100011111001011101000011000010001101011100000101111110001110101011110110011000010101000011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010000101000100001001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011101000010001001100110010011100010100"
"000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101111010111011110110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100010111101110110011001101100011101011"
},
- /* 78*/ { BARCODE_GS1_128_CC, -1, 3, "[90]1234567890123456789012345678", "[20]01", 0, 5, 239, 1, "Example with linear input length triggering difference between new (BWIPP) 52 and old 53 adjustment",
+ /*104*/ { BARCODE_GS1_128_CC, -1, 3, "[90]1234567890123456789012345678", "[20]01", 0, 5, 239, 1, -1, "Example with linear input length triggering difference between new (BWIPP) 52 and old 53 adjustment",
"11111111010101000111010101110000001101011101111000011101111101110100100000100001000101110100110111100010110000011001000110001000110111001010000100001000010010111100111100101011100011100001000010110000011010101000001000000111111101000101001"
"11111111010101000111101010000100001111100100010011011100000010011010110010011100000101111001010000001010110011111001000111111010001011101110001100011101011111000110010100110101110001000001111010100001000011111010101100000111111101000101001"
"11111111010101000110101000011111001010011000111110011010110011111100110111110010001001100001111010110010111111011110110110110001011110001110010111110010011110101111100110101110011000011101100110100001111010101000011110000111111101000101001"
"00000000010110001100001010001001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011010000100010010000100100111000101000000000000"
"00000001101001110011110101110110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100101111011101101111011011000111010110000000000"
},
- /* 79*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123", "[20]12", 0, 5, 205, 1, "Example with 8 cols, left/right padding of linear (BWIPP)",
+ /*105*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123", "[20]12", 0, 5, 205, 1, -1, "Example with 8 cols, left/right padding of linear (BWIPP)",
"1111111101010100011101010111000000111010110011110001110111110111010010000010000100010111010011011110001001100111101110010000110111001100111000101101111001000101110111000011101010001110000111111101000101001"
"1111111101010100011110101000010000111010111011000001111110111001010011111001000100110111000000100110101100100111000001011111010001101110110101110001000001111010100001000011111010101100000111111101000101001"
"1111111101010100011101010001111110100010100011110001111101011100001011000011001011110100101001111000001011111011010000011101111110010100110111100010001101011001001110000010101000011110000111111101000101001"
"0000000001011000110000101000100110010011010011000110111010011100011101001001111010110010000100101001100011001001110010010000100101001100011010000100010011010001100010100001001000100010011100010100000000000"
"0000000110100111001111010111011001101100101100111001000101100011100010110110000101001101111011010110011100110110001101101111011010110011100101111011101100101110011101011110110111011101100011101011000000000"
},
- /* 80*/ { BARCODE_EAN13_CC, -1, 1, "123456789012+12", "[91]123456789012345678901", 0, 8, 125, 1, "Example of EAN-13 with 2-digit addon, CC-A 4 cols, 4 rows",
+ /*106*/ { BARCODE_EAN13_CC, -1, 1, "123456789012+12", "[91]123456789012345678901", 0, 8, 125, 1, -1, "Example of EAN-13 with 2-digit addon, CC-A 4 cols, 4 rows",
"11010010001111001101001110010111011100010000100100011010111011100100000110000010011011101110110010100000000000000000000000000"
"11010110001110101100100000011001111010111110100100001011001011110110000110010011100000101100110010100000000000000000000000000"
"11010111001110101111101000011111100110111010101100001011111010111100110100110100111000001101110010100000000000000000000000000"
@@ -1607,7 +1885,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
"00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110011001010010011"
},
- /* 81*/ { BARCODE_EANX_CC, -1, 1, "123456789012+12", "[91]123456789012345678901", 0, 8, 125, 1, "Example of EAN-13 with 2-digit addon, CC-A 4 cols, 4 rows",
+ /*107*/ { BARCODE_EANX_CC, -1, 1, "123456789012+12", "[91]123456789012345678901", 0, 8, 125, 1, -1, "Example of EAN-13 with 2-digit addon, CC-A 4 cols, 4 rows",
"11010010001111001101001110010111011100010000100100011010111011100100000110000010011011101110110010100000000000000000000000000"
"11010110001110101100100000011001111010111110100100001011001011110110000110010011100000101100110010100000000000000000000000000"
"11010111001110101111101000011111100110111010101100001011111010111100110100110100111000001101110010100000000000000000000000000"
@@ -1617,7 +1895,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
"00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110011001010010011"
},
- /* 82*/ { BARCODE_EAN13_CC, -1, 1, "123456789012+54321", "[91]1234567890", 0, 7, 152, 1, "Example of EAN-13 with 5-digit addon, CC-B 4 cols, 3 rows",
+ /*108*/ { BARCODE_EAN13_CC, -1, 1, "123456789012+54321", "[91]1234567890", 0, 7, 152, 1, -1, "Example of EAN-13 with 5-digit addon, CC-B 4 cols, 3 rows",
"11011011101111001101001110010111011100010000100111010010111011100100000110000010011011101101100010100000000000000000000000000000000000000000000000000000"
"11011011001111110101001110011111000100100110100110010011010001110001000100101111110011101100100010100000000000000000000000000000000000000000000000000000"
"11011010001010000010111100011100111100101110100110011011001111101001000100111110110100001110100010100000000000000000000000000000000000000000000000000000"
@@ -1626,7 +1904,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
"00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110111001010100011010100001010010011010011001"
},
- /* 83*/ { BARCODE_EANX_CC, -1, 1, "123456789012+54321", "[91]1234567890", 0, 7, 152, 1, "Example of EAN-13 with 5-digit addon, CC-B 4 cols, 3 rows",
+ /*109*/ { BARCODE_EANX_CC, -1, 1, "123456789012+54321", "[91]1234567890", 0, 7, 152, 1, -1, "Example of EAN-13 with 5-digit addon, CC-B 4 cols, 3 rows",
"11011011101111001101001110010111011100010000100111010010111011100100000110000010011011101101100010100000000000000000000000000000000000000000000000000000"
"11011011001111110101001110011111000100100110100110010011010001110001000100101111110011101100100010100000000000000000000000000000000000000000000000000000"
"11011010001010000010111100011100111100101110100110011011001111101001000100111110110100001110100010100000000000000000000000000000000000000000000000000000"
@@ -1635,7 +1913,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
"00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110111001010100011010100001010010011010011001"
},
- /* 84*/ { BARCODE_UPCA_CC, -1, 1, "12345678901+12", "[91]123456789", 0, 7, 127, 1, "Example of UPC-A with 2-digit addon, CC-A 4 cols, 3 rows",
+ /*110*/ { BARCODE_UPCA_CC, -1, 1, "12345678901+12", "[91]123456789", 0, 7, 127, 1, -1, "Example of UPC-A with 2-digit addon, CC-A 4 cols, 3 rows",
"1101101110111100110100111001011101110001000010011101001011101110010000011000001001101110110110001010000000000000000000000000000"
"1101101100111001110011110101100001000111001010011001001110101100100000010010111111001110110010001010000000000000000000000000000"
"1101101000100001111001000101011110100000010010011001101000111000010110011011100010001110111010001010000000000000000000000000000"
@@ -1644,7 +1922,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000"
"0001010011001001001101111010100011011000101011110101010001001001000111010011100101100110110110010100000000010110011001010010011"
},
- /* 85*/ { BARCODE_UPCA_CC, -1, 2, "12345678901+12121", "[91]1234567890123", 0, 8, 154, 1, "Example of UPC-A with 5-digit addon, CC-B 4 cols, 4 rows",
+ /*111*/ { BARCODE_UPCA_CC, -1, 2, "12345678901+12121", "[91]1234567890123", 0, 8, 154, 1, -1, "Example of UPC-A with 5-digit addon, CC-B 4 cols, 4 rows",
"1101001110100011111010011101101111110101110010011101101101000011110110011001011100001000110100100010000000000000000000000000000000000000000000000000000000"
"1101001100101100100111000001011111011000001010011101001101111110011010011101001111100100110101100010000000000000000000000000000000000000000000000000000000"
"1101000100111001101000011001100100000101100010011001001001111011110100011100011101000100110101110010000000000000000000000000000000000000000000000000000000"
@@ -1654,7 +1932,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
"0001010011001001001101111010100011011000101011110101010001001001000111010011100101100110110110010100000000010110011001010010011010110011010011011010011001"
},
- /* 86*/ { BARCODE_UPCE_CC, -1, 1, "0654321+89", "[91]1", 0, 9, 81, 1, "Example of UPC-E with 2-digit addon, CC-A 2 cols, 5 rows",
+ /*112*/ { BARCODE_UPCE_CC, -1, 1, "0654321+89", "[91]1", 0, 9, 81, 1, -1, "Example of UPC-E with 2-digit addon, CC-A 2 cols, 5 rows",
"110110011011110111010111110101000100011110001111010100100000000000000000000000000"
"110110111011101100001000110111001010111000001110010100100000000000000000000000000"
"110110110011000101111101110111101000010010001110110100100000000000000000000000000"
@@ -1665,7 +1943,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000001000000000000000000000000000"
"000101000010101100010011101011110100110110011001010101000000010110110111010010111"
},
- /* 87*/ { BARCODE_UPCE_CC, -1, 2, "1876543+56789", "[91]12345", 0, 12, 108, 1, "Example of UPC-E with 5-digit addon, CC-B 2 cols, 8 rows",
+ /*113*/ { BARCODE_UPCE_CC, -1, 2, "1876543+56789", "[91]12345", 0, 12, 108, 1, -1, "Example of UPC-E with 5-digit addon, CC-B 2 cols, 8 rows",
"110010001011101111101110100100000100001000101100100010100000000000000000000000000000000000000000000000000000"
"111010001011010000111101100110010111000010001110100010100000000000000000000000000000000000000000000000000000"
"111011001011101100100111110100011110010000101110110010100000000000000000000000000000000000000000000000000000"
@@ -1679,7 +1957,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
"000101011011100100010000101011000101000110100001010101000000010110110001010101111010010001010110111010010111"
},
- /* 88*/ { BARCODE_EAN8_CC, -1, 1, "9876543+65", "[91]1234567", ZINT_WARN_NONCOMPLIANT, 8, 98, 1, "Example of EAN-8 with 2-digit addon, CC-A 3 cols, 4 rows",
+ /*114*/ { BARCODE_EAN8_CC, -1, 1, "9876543+65", "[91]1234567", ZINT_WARN_NONCOMPLIANT, 8, 98, 1, -1, "Example of EAN-8 with 2-digit addon, CC-A 3 cols, 4 rows",
"10010001111100110101001100011100010111001100110001011101000001110100110100000000000000000000000000"
"11011111100110100101011100011011110010110000111100010011110101110101110100000000000000000000000000"
"10000101100000110101011000010101111101111100111010010000111001110101100100000000000000000000000000"
@@ -1689,7 +1967,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
"00001010001011011011101110110101111010101001110101110010000101110010101000000010110101111010111001"
},
- /* 89*/ { BARCODE_EANX_CC, -1, 1, "9876543+65", "[91]1234567", ZINT_WARN_NONCOMPLIANT, 8, 98, 1, "Example of EAN-8 with 2-digit addon, CC-A 3 cols, 4 rows",
+ /*115*/ { BARCODE_EANX_CC, -1, 1, "9876543+65", "[91]1234567", ZINT_WARN_NONCOMPLIANT, 8, 98, 1, -1, "Example of EAN-8 with 2-digit addon, CC-A 3 cols, 4 rows",
"10010001111100110101001100011100010111001100110001011101000001110100110100000000000000000000000000"
"11011111100110100101011100011011110010110000111100010011110101110101110100000000000000000000000000"
"10000101100000110101011000010101111101111100111010010000111001110101100100000000000000000000000000"
@@ -1699,7 +1977,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
"00001010001011011011101110110101111010101001110101110010000101110010101000000010110101111010111001"
},
- /* 90*/ { BARCODE_EAN8_CC, -1, 2, "9876543+74083", "[91]123456789012345678", ZINT_WARN_NONCOMPLIANT, 12, 135, 1, "Example of EAN-8 with 5-digit addon, CC-B 3 cols, 8 rows",
+ /*116*/ { BARCODE_EAN8_CC, -1, 2, "9876543+74083", "[91]123456789012345678", ZINT_WARN_NONCOMPLIANT, 12, 135, 1, -1, "Example of EAN-8 with 5-digit addon, CC-B 3 cols, 8 rows",
"110011101011101111101110100100001011010000010000100010111110110100111101100111010100000000000000000000000000000000000000000000000000000"
"111011101011001011100001000100001001011100101100100000111000110111010001110111010100000000000000000000000000000000000000000000000000000"
"111001101011011111100110100100001101010100010111100000110010011011111101110011010100000000000000000000000000000000000000000000000000000"
@@ -1713,7 +1991,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
"000000000000001010001011011011101110110101111010101001110101110010000101110010101000000010110111011010011101010001101010110111010100001"
},
- /* 91*/ { BARCODE_EANX_CC, -1, 2, "9876543+74083", "[91]123456789012345678", ZINT_WARN_NONCOMPLIANT, 12, 135, 1, "Example of EAN-8 with 5-digit addon, CC-B 3 cols, 8 rows",
+ /*117*/ { BARCODE_EANX_CC, -1, 2, "9876543+74083", "[91]123456789012345678", ZINT_WARN_NONCOMPLIANT, 12, 135, 1, -1, "Example of EAN-8 with 5-digit addon, CC-B 3 cols, 8 rows",
"110011101011101111101110100100001011010000010000100010111110110100111101100111010100000000000000000000000000000000000000000000000000000"
"111011101011001011100001000100001001011100101100100000111000110111010001110111010100000000000000000000000000000000000000000000000000000"
"111001101011011111100110100100001101010100010111100000110010011011111101110011010100000000000000000000000000000000000000000000000000000"
@@ -1727,7 +2005,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
"000000000000001010001011011011101110110101111010101001110101110010000101110010101000000010110111011010011101010001101010110111010100001"
},
- /* 92*/ { BARCODE_EAN13_CC, -1, 1, "1234567890128+65", "[91]1234567", 0, 7, 125, 1, "Example of EAN-13 + CHK with 2-digit addon, CC-A 3 cols, 4 rows",
+ /*118*/ { BARCODE_EAN13_CC, -1, 1, "1234567890128+65", "[91]1234567", 0, 7, 125, 1, -1, "Example of EAN-13 + CHK with 2-digit addon, CC-A 3 cols, 4 rows",
"11011011101111001101001110010111011100010000100111010010111011100100000110000110010100001101100010100000000000000000000000000"
"11011011001001100101111110011111011001000010100110010011111101110010100110101110001000001100100010100000000000000000000000000"
"11011010001101011111100100011011101000011100100110011010001001001111000101000011011111001110100010100000000000000000000000000"
@@ -1736,7 +2014,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
"00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110101111010111001"
},
- /* 93*/ { BARCODE_EANX_CC, -1, 1, "1234567890128+65", "[91]1234567", 0, 7, 125, 1, "Example of EAN-13 + CHK with 2-digit addon, CC-A 3 cols, 4 rows",
+ /*119*/ { BARCODE_EANX_CC, -1, 1, "1234567890128+65", "[91]1234567", 0, 7, 125, 1, -1, "Example of EAN-13 + CHK with 2-digit addon, CC-A 3 cols, 4 rows",
"11011011101111001101001110010111011100010000100111010010111011100100000110000110010100001101100010100000000000000000000000000"
"11011011001001100101111110011111011001000010100110010011111101110010100110101110001000001100100010100000000000000000000000000"
"11011010001101011111100100011011101000011100100110011010001001001111000101000011011111001110100010100000000000000000000000000"
@@ -1745,15 +2023,87 @@ static void test_examples(const testCtx *const p_ctx) {
"00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
"00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110101111010111001"
},
+ /*120*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[21]12", "[8006]123456789012310202", 0, 5, 102, 1, -1, "2 codeblocks",
+ "001101101110101100001110011001111011111011001010011101001001011001100000011000110001000010110110001010"
+ "001101101100111100010011011001100100000011101010011001001110000100110010011111101101011000110010001010"
+ "001101101000101101000000111001000011010011100010011001101111010001111010011001001111110010111010001010"
+ "000000101111110111010000000010100101110001100001011010000011010001110100001010101001010000011110100000"
+ "010011010000001000101111111100001010001110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /*121*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[21]1234567", "[8006]123456789012310202", 0, 5, 134, 1, -1, "3 codeblocks",
+ "00110110111010110000111001100111101111101100101001110100100101100110000001100011000100001011011000101000000000000000000000000000000000"
+ "00110110110011110001001101100110010000001110101001100100111000010011001001111110110101100011001000101000000000000000000000000000000000"
+ "00110110100010110100000011100100001101001110001001100110111101000111101001100100111111001011101000101000000000000000000000000000000000"
+ "00001010111111011001000000001010010011000100011101101100000111010001010000101010000111000010110011101100011001000001010100000010100000"
+ "01000101000000100110111111110000101100111011100010010011111000101110101111000000111000111101001100010011100110111110100011111100001010"
+ },
+ /*122*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[8006]123456789012310202", "[21]12", 0, 5, 200, 1, -1, "4 codeblocks",
+ "00110110111011010000100000110111011101110011101001110100110000101101110001010000100000100011011000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00110110110011110001011000110110000101110010001001100100111000010011000101111010010100000011001000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00110110100010000001010111100111011110010111001001100110110000111110100101111110001001101011101000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00000111001001111001000000001010010011001110001001101001100001100011010000001010000111110000110010101001000111011100010100000010100101000001011100111000111001001011110100000000100001101000001011100000"
+ "01001000110110000110111111110000101100110001110110010110011110011100101111110000111000001111001101010110111000100011100011111100001010111110100011000111000110110100001011111111001110010111110100011101"
+ },
+ /*123*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[10]12[8006]123456789012310202", "[21]12", 0, 5, 249, 1, -1, "5 codeblocks",
+ "001101101110110100001000001101110111011100111010011101001100001011011100010100001000001000110110001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "001101101100111100010110001101100001011100100010011001001110000100110001011110100101000000110010001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "001101101000100000010101111001110111100101110010011001101100001111101001011111100010011010111010001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "000011000111101001010000000010100100111000001101011011000001110010010100000101010001111100110001010011110001001100100101000000101001000100001100010110011101001101111101000000001000011001000100001110110001111010010001010000101010010100011110100110000"
+ "010000111000010110101111111100001011000111110010100100111110001101101011111000000110000011001110101100001110110011011000111111000010111011110011101001100010110010000010111111110011100110111011110001001110000101101110001111000000101011100001011000010"
+ },
+ /*124*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[21]12345578901234567890[10]12346", "[8006]123456789012310202", 0, 5, 281, 1, -1, "6 codeblocks",
+ "00110110111010110000111001100111101111101100101001110100100101100110000001100011000100001011011000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00110110110011110001001101100110010000001110101001100100111000010011001001111110110101100011001000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00110110100010110100000011100100001101001110001001100110111101000111101001100100111111001011101000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00000110001100011101000000001010010011000100011101101100000111010001010000010101000100001110111001101000011101001000010100000010100101011001110001111010110001111101110100000000100001111000101111011010100100011100000101001010101001001111000101101110011110101100001101000000000100000"
+ "01011001110011100010111111110000101100111011100010010011111000101110101111100000011011110001000110010111100010110111100011111100001010100110001110000101001110000010001011111111001110000111010000100101011011100011111000110000000010110000111010010001100001010011110010111111111001101"
+ },
+ /*125*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[21]12345578901234567890[10]123467890123", "[8006]123456789012310202", 0, 5, 330, 1, -1, "7 codeblocks",
+ "001101101110101100001110011001111011111011001010011101001001011001100000011000110001000010110110001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "001101101100111100010011011001100100000011101010011001001110000100110010011111101101011000110010001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "001101101000101101000000111001000011010011100010011001101111010001111010011001001111110010111010001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "000011110000010110010000000010100100110001000111011011000001110100010100000101010001000011101110011010000111010010000101000000101001010110011100011110101100011111011101000000001000011110001011110110101001000111000001000000010101010011110001011011100001011011100111010000000001000110110011110100001011001001100000010001010101010000"
+ "010100001111101001101111111100001011001110111000100100111110001011101011111000000110111100010001100101111000101101111000111111000010101001100011100001010011100000100010111111110011100001110100001001010110111000111110011111100000101100001110100100011110100100011000101111111110011001001100001011110100110110011111100110000000001010"
+ },
+ /*126*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[21]12345578901234567890[10]1234678901234567890", "[8006]123456789012310202", 0, 5, 379, 1, -1, "8 codeblocks",
+ "0011011011101011000011100110011110111110110010100111010010010110011000000110001100010000101101100010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "0011011011001111000100110110011001000000111010100110010011100001001100100111111011010110001100100010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "0011011010001011010000001110010000110100111000100110011011110100011110100110010011111100101110100010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "0000001111000100010100000000101001001000101111000110110000011101000101000010101010010000111011100110100001110100100001010000001010010101100111000111101011000111110111010000101010000111100010111101101010010001110000010100001010100100111100010110111000010110111001110100000010100001101100111101000011110011010100000101001010101001010000100111000010111101110000100101000000001000000"
+ "0100110000111011101011111111000010110111010000111001001111100010111010111100000000101111000100011001011110001011011110001111110000101010011000111000010100111000001000101111000000111000011101000010010101101110001111100011110000001011000011101001000111101001000110001011111100001110010011000010111100001100101011111000110000000010101111011000111101000010001111011010111111110011101"
+ },
+ /*127*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[21]12345578901234567890[10]12346789012345678901[8002]1", "[8006]123456789012310202", 0, 5, 428, 1, -1, "9 codeblocks",
+ "00110110111010110000111001100111101111101100101001110100100101100110000001100011000100001011011000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00110110110011110001001101100110010000001110101001100100111000010011001001111110110101100011001000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00110110100010110100000011100100001101001110001001100110111101000111101001100100111111001011101000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "00001100100100011001000000001010010010001011110001101100000111010001010000101010100100001110111001101000011101001000010100000010100101011001110001111010110001111101110100001010100001111000101111011010100100011100000101000010101001001111000101101110000101101110011101000000101000011011001111010000111100110101000001010010101010010100001001110000101001100011110011010000010101000100000100000110101101111101011000010000000101010000"
+ "01000011011011100110111111110000101101110100001110010011111000101110101111000000001011110001000110010111100010110111100011111100001010100110001110000101001110000010001011110000001110000111010000100101011011100011111000111100000010110000111010010001111010010001100010111111000011100100110000101111000011001010111110001100000000101011110110001111010110011100001100101111100000011011111011111001010010000010100111100111111000001010"
+ },
+ /*128*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[21]12345578901234567890[10]12346789012345678901[8002]1234567", "[8006]123456789012310202", 0, 5, 477, 1, -1, "10 codeblocks",
+ "001101101110101100001110011001111011111011001010011101001001011001100000011000110001000010110110001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "001101101100111100010011011001100100000011101010011001001110000100110010011111101101011000110010001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "001101101000101101000000111001000011010011100010011001101111010001111010011001001111110010111010001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "000000100111001000010000000010100100100010111100011011000001110100010100001010101001000011101110011010000111010010000101000000101001010110011100011110101100011111011101000010101000011110001011110110101001000111000001010000101010010011110001011011100001011011100111010000001010000110110011110100001111001101010000010100101010100101000010011100001010011000111100110100000101010001000001000001101010011111000101110100010101010101000111101001100010011100110111110101000000000100000"
+ "010111011000110111101111111100001011011101000011100100111110001011101011110000000010111100010001100101111000101101111000111111000010101001100011100001010011100000100010111100000011100001110100001001010110111000111110001111000000101100001110100100011110100100011000101111110000111001001100001011110000110010101111100011000000001010111101100011110101100111000011001011111000000110111110111110010101100000111010001001100000000010111000010110011101100011001000001010111111111001101"
+ },
+ /*129*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[21]12345578901234567890[10]12346789012345678901[8002]12345678901234", "[8006]123456789012310202", 0, 5, 526, 1, -1, "11 codeblocks (max)",
+ "0011011011101011000011100110011110111110110010100111010010010110011000000110001100010000101101100010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "0011011011001111000100110110011001000000111010100110010011100001001100100111111011010110001100100010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "0011011010001011010000001110010000110100111000100110011011110100011110100110010011111100101110100010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ "0000010110000001000100000000101001001000101111000110110000011101000101000010101010010000111011100110100001110100100001010000001010010101100111000111101011000111110111010000101010000111100010111101101010010001110000010100001010100100111100010110111000010110111001110100000000100001101100111101000011110011010100000101001010101001010000100111000010100110001111001101000001010100010000010000011010100111110001011101000000010101010001111010011000101111000101101111010000000001000101001100011100001101011001110000010001010101010000"
+ "0100101001111110111011111111000010110111010000111001001111100010111010111100000000101111000100011001011110001011011110001111110000101010011000111000010100111000001000101111000000111000011101000010010101101110001111100011110000001011000011101001000111101001000110001011111111001110010011000010111100001100101011111000110000000010101111011000111101011001110000110010111110000001101111101111100101011000001110100010011111100000101110000101100111010000111010010000101111111110011010110011100011110010100110001111100110000000001010"
+ },
};
const int data_size = ARRAY_SIZE(data);
int i, length, composite_length, ret;
struct zint_symbol *symbol = NULL;
+ struct zint_symbol *previous_symbol = NULL;
+
char escaped[1024];
char esc_composite[4096];
- char bwipp_buf[32768] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char bwipp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
@@ -1767,47 +2117,69 @@ static void test_examples(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/,
+ data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
- printf(" /*%3d*/ { %s, %s, %d, \"%s\", \"%s\", %s, %d, %d, %d, \"%s\",\n",
- i, testUtilBarcodeName(symbol->symbology), testUtilInputModeName(data[i].input_mode), data[i].option_1,
- testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), testUtilEscape(data[i].composite, composite_length, esc_composite, sizeof(esc_composite)),
- testUtilErrorName(ret), symbol->rows, symbol->width, data[i].bwipp_cmp, data[i].comment);
+ printf(" /*%3d*/ { %s, %s, %d, \"%s\", \"%s\", %s, %d, %d, %d, %d, \"%s\",\n",
+ i, testUtilBarcodeName(symbol->symbology), testUtilInputModeName(data[i].input_mode),
+ data[i].option_1, testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
+ testUtilEscape(data[i].composite, composite_length, esc_composite, sizeof(esc_composite)),
+ testUtilErrorName(ret), symbol->rows, symbol->width, data[i].bwipp_cmp, data[i].compare_previous,
+ data[i].comment);
testUtilModulesPrint(symbol, " ", "\n");
printf(" },\n");
} else {
int width, row;
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
- assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
- assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
+ assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
+ if (p_ctx->index == -1 && data[i].compare_previous != -1) {
+ ret = testUtilSymbolCmp(symbol, previous_symbol);
+ assert_equal(!ret, !data[i].compare_previous, "i:%d testUtilSymbolCmp !ret %d != %d\n",
+ i, ret, data[i].compare_previous);
+ }
+
+ if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1,
+ data[i].data[0] == '^'
+ || data[i].composite[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
if (!data[i].bwipp_cmp) {
- if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment);
+ if (debug & ZINT_DEBUG_TEST_PRINT) {
+ printf("i:%d %s not BWIPP compatible (%s)\n",
+ i, testUtilBarcodeName(symbol->symbology), data[ i].comment);
+ }
} else {
- ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
- assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+ ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length,
+ symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
+ assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
+ i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
- i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
+ i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
}
}
}
- ZBarcode_Delete(symbol);
+ ZBarcode_Delete(previous_symbol);
+ previous_symbol = symbol;
}
+ ZBarcode_Delete(previous_symbol);
testFinish();
}
@@ -1940,33 +2312,43 @@ static void test_odd_numbered_numeric(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/,
+ data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
- test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, -1 /*bwipp_cmp*/);
+ test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment,
+ -1 /*bwipp_cmp*/);
} else {
int width, row;
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
- assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
- assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
+ assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
- ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
- assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+ if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1,
+ data[i].data[0] == '^'
+ || data[i].composite[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
+ ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length,
+ symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
+ assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
+ i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
- i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
+ i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
}
}
@@ -2055,7 +2437,7 @@ static void test_ean128_cc_shift(const testCtx *const p_ctx) {
int i, length, composite_length, ret;
struct zint_symbol *symbol = NULL;
- char bwipp_buf[8192] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char bwipp_buf[8192] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
@@ -2069,36 +2451,49 @@ static void test_ean128_cc_shift(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/,
+ data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
- test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, data[i].bwipp_cmp);
+ test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment,
+ data[i].bwipp_cmp);
} else {
int width, row;
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
- assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
- assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
+ assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
+ if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1,
+ data[i].data[0] == '^'
+ || data[i].composite[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
if (!data[i].bwipp_cmp) {
- if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment);
+ if (debug & ZINT_DEBUG_TEST_PRINT) {
+ printf("i:%d %s not BWIPP compatible (%s)\n",
+ i, testUtilBarcodeName(symbol->symbology), data[i].comment);
+ }
} else {
- ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
- assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+ ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length,
+ symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
+ assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
+ i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
- i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
+ i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
}
}
}
@@ -2150,21 +2545,26 @@ static void test_ean128_cc_width(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, BARCODE_GS1_128_CC, -1 /*input_mode*/, -1 /*eci*/, 3, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, BARCODE_GS1_128_CC, -1 /*input_mode*/, -1 /*eci*/,
+ 3, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
printf(" /*%2d*/ { \"%s\", \"%s\", %s, %d, %d, \"%s\" },\n",
- i, data[i].data, data[i].composite, testUtilErrorName(ret), symbol->rows, symbol->width, data[i].comment);
+ i, data[i].data, data[i].composite,
+ testUtilErrorName(ret), symbol->rows, symbol->width, data[i].comment);
} else {
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data);
- assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n",
+ i, symbol->rows, data[i].expected_rows, data[i].data);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n",
+ i, symbol->width, data[i].expected_width, data[i].data);
}
ZBarcode_Delete(symbol);
@@ -2603,7 +3003,7 @@ static void test_encodation_0(const testCtx *const p_ctx) {
int i, length, composite_length, ret;
struct zint_symbol *symbol = NULL;
- char bwipp_buf[8192] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char bwipp_buf[8192] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
@@ -2617,33 +3017,43 @@ static void test_encodation_0(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/,
+ data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
- test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, -1 /*bwipp_cmp*/);
+ test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment,
+ -1 /*bwipp_cmp*/);
} else {
int width, row;
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
- assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
- assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
+ assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
- ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
- assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+ if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1,
+ data[i].data[0] == '^'
+ || data[i].composite[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
+ ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length,
+ symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
+ assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
+ i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
- i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
+ i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
}
}
@@ -2741,7 +3151,7 @@ static void test_encodation_10(const testCtx *const p_ctx) {
int i, length, composite_length, ret;
struct zint_symbol *symbol = NULL;
- char bwipp_buf[8192] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char bwipp_buf[8192] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
@@ -2755,33 +3165,44 @@ static void test_encodation_10(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/,
+ data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
- test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, -1 /*bwipp_cmp*/);
+ test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment,
+ -1 /*bwipp_cmp*/);
} else {
int width, row;
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
- assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
- assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
+ assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
- ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
- assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+ if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1,
+ data[i].data[0] == '^'
+ || data[i].composite[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
+ ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length,
+ symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
+ assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
+ i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
- i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
+ i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf,
+ data[i].expected);
}
}
@@ -3157,7 +3578,7 @@ static void test_encodation_11(const testCtx *const p_ctx) {
int i, length, composite_length, ret;
struct zint_symbol *symbol = NULL;
- char bwipp_buf[8192] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char bwipp_buf[8192] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
@@ -3171,33 +3592,43 @@ static void test_encodation_11(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/,
+ data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
- test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, -1 /*bwipp_cmp*/);
+ test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment,
+ -1 /*bwipp_cmp*/);
} else {
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
- assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
if (ret < ZINT_ERROR) {
int width, row;
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
- assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
+ assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
- ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
- assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+ if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1,
+ data[i].data[0] == '^'
+ || data[i].composite[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
+ ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length,
+ symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
+ assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
+ i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
- i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
+ i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
}
}
}
@@ -3346,7 +3777,7 @@ static void test_addongap(const testCtx *const p_ctx) {
int i, length, composite_length, ret;
struct zint_symbol *symbol = NULL;
- char bwipp_buf[8192] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char bwipp_buf[8192] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
const char *composite = "[91]12";
@@ -3362,37 +3793,47 @@ static void test_addongap(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/,
+ data[i].option_1, data[i].option_2, -1, -1 /*output_options*/,
+ data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(composite);
ret = ZBarcode_Encode(symbol, TCU(composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
printf(" /*%3d*/ { %s, %d, %d, \"%s\", %s, %d, %d, \"%s\",\n",
- i, testUtilBarcodeName(data[i].symbology), data[i].option_1, data[i].option_2, data[i].data,
- testUtilErrorName(data[i].ret), symbol->rows, symbol->width, data[i].comment);
+ i, testUtilBarcodeName(data[i].symbology), data[i].option_1, data[i].option_2,
+ data[i].data, testUtilErrorName(data[i].ret), symbol->rows, symbol->width,
+ data[i].comment);
testUtilModulesPrint(symbol, " ", "\n");
printf(" },\n");
} else {
int width, row;
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
- assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
- assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
+ assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
+ i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, debug)) {
- ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
- assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+ if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, data[i].option_2,
+ data[i].data[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
+ ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, composite, composite_length,
+ symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
+ assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
+ i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
- i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
+ i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
}
}
@@ -3481,17 +3922,21 @@ static void test_gs1parens(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/,
+ -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d\n", i, symbol->rows, data[i].expected_rows);
- assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n", i, symbol->width, data[i].expected_width);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d\n",
+ i, symbol->rows, data[i].expected_rows);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n",
+ i, symbol->width, data[i].expected_width);
ZBarcode_Delete(symbol);
}
@@ -3595,8 +4040,8 @@ static void test_hrt(const testCtx *const p_ctx) {
assert_nonnull(symbol, "Symbol not created\n");
length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/,
- -1 /*option_1*/, -1 /*option_2*/, -1 /*option_3*/, data[i].output_options,
- data[i].data, -1, debug);
+ -1 /*option_1*/, -1 /*option_2*/, -1 /*option_3*/, data[i].output_options,
+ data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
@@ -3606,7 +4051,8 @@ static void test_hrt(const testCtx *const p_ctx) {
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, data[i].ret, ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, data[i].ret, ret, symbol->errtxt);
assert_equal(symbol->text_length, expected_length, "i:%d text_length %d != expected_length %d\n",
i, symbol->text_length, expected_length);
@@ -3661,12 +4107,12 @@ static void test_input(const testCtx *const p_ctx) {
/* 3*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "123456A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 7 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 }, /* EAN-8 */
/* 4*/ { BARCODE_EAN8_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 7 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 }, /* Linear component still checked */
/* 5*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 7 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 }, /* Linear component still checked */
- /* 6*/ { BARCODE_EAN8_CC, -1, -1, -1, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 },
- /* 7*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 },
+ /* 6*/ { BARCODE_EAN8_CC, -1, -1, -1, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 },
+ /* 7*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 },
/* 8*/ { BARCODE_EAN8_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[20]1A", 0, 8, 72, "", 1, 0, 0 },
/* 9*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[20]1A", 0, 8, 72, "", 1, 0, 0 },
- /* 10*/ { BARCODE_EAN8_CC, -1, -1, -1, -1, "1234567", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
- /* 11*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /* 10*/ { BARCODE_EAN8_CC, -1, -1, -1, -1, "1234567", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /* 11*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
/* 12*/ { BARCODE_EAN8_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[02]12345678901234", 0, 8, 72, "", 1, 0, 0 },
/* 13*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[02]12345678901234", 0, 8, 72, "", 1, 0, 0 },
/* 14*/ { BARCODE_EAN8_CC, -1, -1, -1, -1, "12345670", "[20]12", 0, 8, 72, "", 1, 0, 0 },
@@ -3688,12 +4134,12 @@ static void test_input(const testCtx *const p_ctx) {
/* 30*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "123456789012A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 13 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 },
/* 31*/ { BARCODE_EAN13_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 13 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 },
/* 32*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 13 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 },
- /* 33*/ { BARCODE_EAN13_CC, -1, -1, -1, -1, "1234567890128", "[20]1A", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
- /* 34*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[20]1A", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
+ /* 33*/ { BARCODE_EAN13_CC, -1, -1, -1, -1, "1234567890128", "[20]1A", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
+ /* 34*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[20]1A", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
/* 35*/ { BARCODE_EAN13_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890128", "[20]1A", 0, 7, 99, "", 1, 0, 0 },
/* 36*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890128", "[20]1A", 0, 7, 99, "", 1, 0, 0 },
- /* 37*/ { BARCODE_EAN13_CC, -1, -1, -1, -1, "1234567890128", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
- /* 38*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /* 37*/ { BARCODE_EAN13_CC, -1, -1, -1, -1, "1234567890128", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /* 38*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
/* 39*/ { BARCODE_EAN13_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890128", "[02]12345678901234", 0, 7, 99, "", 1, 0, 0 },
/* 40*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890128", "[02]12345678901234", 0, 7, 99, "", 1, 0, 0 },
/* 41*/ { BARCODE_EAN13_CC, -1, -1, -1, -1, "1234567890128", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567", 0, 48, 99, "", 2, 0, 0 }, /* Max CC-B for EAN-13 */
@@ -3712,9 +4158,9 @@ static void test_input(const testCtx *const p_ctx) {
/* 54*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012312", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)", 1, 0, 0 },
/* 55*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)", 1, 0, 0 },
/* 56*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)", 1, 0, 0 },
- /* 57*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 5, 100, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
+ /* 57*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 5, 100, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
/* 58*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[20]1A", 0, 5, 100, "", 1, 0, 0 },
- /* 59*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 100, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /* 59*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 100, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
/* 60*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[02]12345678901234", 0, 5, 100, "", 1, 0, 0 },
/* 61*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "1234567890123", "[20]12", 0, 6, 79, "", 1, 0, 0 },
/* 62*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901231", "[20]12", 0, 6, 79, "", 1, 0, 0 },
@@ -3724,9 +4170,9 @@ static void test_input(const testCtx *const p_ctx) {
/* 66*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012345", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 15 too long (maximum 14) (linear component)", 1, 0, 0 },
/* 67*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "A1234567890123", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character at position 1 in input (digits only) (linear component)", 1, 0, 0 },
/* 68*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "A1234567890123", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character at position 1 in input (digits only) (linear component)", 1, 0, 0 },
- /* 69*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 6, 79, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
+ /* 69*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 6, 79, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
/* 70*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[20]1A", 0, 6, 79, "", 1, 0, 0 },
- /* 71*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 6, 79, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /* 71*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 6, 79, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
/* 72*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[02]12345678901234", 0, 6, 79, "", 1, 0, 0 },
/* 73*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "12345678901", "[20]12", 0, 7, 99, "", 1, 0, 0 },
/* 74*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789012", "[20]12", 0, 7, 99, "", 1, 0, 0 },
@@ -3736,9 +4182,9 @@ static void test_input(const testCtx *const p_ctx) {
/* 78*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 289: Input length 13 too long (maximum 12) (linear component)", 1, 0, 0 },
/* 79*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "12345678901A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 12 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 },
/* 80*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 12 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 },
- /* 81*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789012", "[20]1A", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
+ /* 81*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789012", "[20]1A", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
/* 82*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012", "[20]1A", 0, 7, 99, "", 1, 0, 0 },
- /* 83*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789012", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /* 83*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789012", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
/* 84*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012", "[02]12345678901234", 0, 7, 99, "", 1, 0, 0 },
/* 85*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "123456", "[20]12", 0, 9, 55, "", 1, 0, 0 },
/* 86*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567", "[20]12", 0, 9, 55, "", 1, 0, 0 },
@@ -3749,9 +4195,9 @@ static void test_input(const testCtx *const p_ctx) {
/* 91*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456712", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 291: Input length 9 too long (maximum 8) (linear component)", 1, 0, 0 },
/* 92*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 8 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 },
/* 93*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 8 in input (digits and \"+\" or space only) (linear component)", 1, 0, 0 },
- /* 94*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, 9, 55, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
+ /* 94*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, 9, 55, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
/* 95*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[20]1A", 0, 9, 55, "", 1, 0, 0 },
- /* 96*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 9, 55, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /* 96*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 9, 55, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
/* 97*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[02]12345678901234", 0, 9, 55, "", 1, 0, 0 },
/* 98*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "1234567890123", "[20]12", 0, 9, 56, "", 1, 0, 0 },
/* 99*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901231", "[20]12", 0, 9, 56, "", 1, 0, 0 },
@@ -3761,9 +4207,9 @@ static void test_input(const testCtx *const p_ctx) {
/*103*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012323", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)", 1, 0, 0 },
/*104*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)", 1, 0, 0 },
/*105*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)", 1, 0, 0 },
- /*106*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 9, 56, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
+ /*106*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 9, 56, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
/*107*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[20]1A", 0, 9, 56, "", 1, 0, 0 },
- /*108*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 9, 56, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /*108*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 9, 56, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
/*109*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[02]12345678901234", 0, 9, 56, "", 1, 0, 0 },
/*110*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "1234567890123", "[20]12", 0, 11, 56, "", 1, 0, 0 },
/*111*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901231", "[20]12", 0, 11, 56, "", 1, 0, 0 },
@@ -3773,9 +4219,9 @@ static void test_input(const testCtx *const p_ctx) {
/*115*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012312", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)", 1, 0, 0 },
/*116*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)", 1, 0, 0 },
/*117*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)", 1, 0, 0 },
- /*118*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 11, 56, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
+ /*118*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 11, 56, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)", 1, 0, 0 }, /* AI (20) should be 2 nos. */
/*119*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[20]1A", 0, 11, 56, "", 1, 0, 0 },
- /*120*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 11, 56, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
+ /*120*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 11, 56, "Warning 261: AI (02) data position 14: Bad checksum '4', expected '1' (2D component)", 1, 0, 0 },
/*121*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[02]12345678901234", 0, 11, 56, "", 1, 0, 0 },
/*122*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 445: No primary (linear component)", -1, 0, 0 },
/*123*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 31, 273, "", 3, 0, 0 }, /* Tries CC-A then CC-B then CC-C - ensure errtxt empty */
@@ -3813,16 +4259,20 @@ static void test_input(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/,
+ data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/,
+ data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, data[i].ret, ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, data[i].ret, ret, symbol->errtxt);
- assert_zero(strcmp(symbol->errtxt, data[i].expected_errtxt), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected_errtxt);
+ assert_zero(strcmp(symbol->errtxt, data[i].expected_errtxt), "i:%d strcmp(%s, %s) != 0\n",
+ i, symbol->errtxt, data[i].expected_errtxt);
assert_equal(symbol->option_1, data[i].expected_option_1, "i:%d symbol->option_1 %d != %d (option_2 %d)\n",
i, symbol->option_1, data[i].expected_option_1, symbol->option_2);
assert_equal(symbol->option_2, data[i].expected_option_2, "i:%d symbol->option_2 %d != %d\n",
@@ -3831,8 +4281,10 @@ static void test_input(const testCtx *const p_ctx) {
i, symbol->option_3, data[i].expected_option_3);
if (ret < ZINT_ERROR) {
- assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (symbol->width %d)\n", i, symbol->rows, data[i].expected_rows, symbol->width);
- assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n", i, symbol->width, data[i].expected_width);
+ assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (symbol->width %d)\n",
+ i, symbol->rows, data[i].expected_rows, symbol->width);
+ assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n",
+ i, symbol->width, data[i].expected_width);
}
ZBarcode_Delete(symbol);
@@ -3893,26 +4345,36 @@ static void test_fuzz(const testCtx *const p_ctx) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
- length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
+ length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/,
+ data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
strcpy(symbol->primary, data[i].data);
composite_length = (int) strlen(data[i].composite);
ret = ZBarcode_Encode(symbol, TCU(data[i].composite), composite_length);
- assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
+ assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt);
assert_zero(strcmp(symbol->errtxt, data[i].expected_errtxt), "i:%d strcmp(%s, %s) != 0\n",
- i, symbol->errtxt, data[i].expected_errtxt);
+ i, symbol->errtxt, data[i].expected_errtxt);
if (ret < ZINT_ERROR) {
- if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
+ if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1,
+ data[i].data[0] == '^'
+ || data[i].composite[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
if (!data[i].bwipp_cmp) {
- if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment);
+ if (debug & ZINT_DEBUG_TEST_PRINT) {
+ printf("i:%d %s not BWIPP compatible (%s)\n",
+ i, testUtilBarcodeName(symbol->symbology), data[i].comment);
+ }
} else {
char modules_dump[32768];
- assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i);
- ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
- assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+ assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1,
+ "i:%d testUtilModulesDump == -1\n", i);
+ ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length,
+ symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
+ assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
+ i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, modules_dump);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
diff --git a/backend/tests/test_dmatrix.c b/backend/tests/test_dmatrix.c
index 3ec3c850..b9ea10fc 100644
--- a/backend/tests/test_dmatrix.c
+++ b/backend/tests/test_dmatrix.c
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2019-2025 Robin Stuart
+ Copyright (C) 2019-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -360,7 +360,7 @@ static void test_large(const testCtx *const p_ctx) {
char data_buf[ZINT_MAX_DATA_LEN];
- char escaped[8192];
+ char escaped[8192] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_buf[32768];
char cmp_msg[1024];
@@ -1304,7 +1304,7 @@ static void test_input(const testCtx *const p_ctx) {
&& data[i].option_3 == data[i - 1].option_3
&& data[i].output_options == data[i - 1].output_options
&& strcmp(data[i].data, data[i - 1].data) == 0) {
- unsigned char binary[2][2200];
+ unsigned char binary[2][2200] ZINT_TESTUTIL_SANITIZEM_INIT_2D;
int gs1;
int binlen;
int binlens[2] = {0};
@@ -1319,7 +1319,7 @@ static void test_input(const testCtx *const p_ctx) {
i, expected_rows_width, prev_expected_rows_width);
if ((data[i].input_mode & 0x07) == GS1_MODE) {
- ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, reduced, &length);
+ ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, reduced, &length, 0 /*set_hrt*/);
assert_zero(ret, "i:%d zint_gs1_verify() ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
text = reduced;
} else {
@@ -6395,7 +6395,7 @@ static void test_encode_segs(const testCtx *const p_ctx) {
testFinish();
}
-static void test_rt(const testCtx *const p_ctx) {
+static void test_ct(const testCtx *const p_ctx) {
int debug = p_ctx->debug;
struct item {
@@ -6427,9 +6427,11 @@ static void test_rt(const testCtx *const p_ctx) {
/* 11*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 899, BARCODE_CONTENT_SEGS, "é", -1, 0, 899, "é", -1, 899 },
/* 12*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 0, "", -1, 0 },
/* 13*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, BARCODE_CONTENT_SEGS, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 0, "01049123451234591597033130128\03510ABC123", -1, 3 },
- /* 14*/ { BARCODE_DATAMATRIX, GS1_MODE, 28, BARCODE_CONTENT_SEGS, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 28, "01049123451234591597033130128\03510ABC123", -1, 3 }, /* Note: content seg ECI rremains at default 3 */
- /* 15*/ { BARCODE_HIBC_DM, UNICODE_MODE, -1, -1, "H123ABC01234567890", -1, 0, 0, "", -1, 0 },
- /* 16*/ { BARCODE_HIBC_DM, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "H123ABC01234567890", -1, 0, 0, "+H123ABC01234567890D", -1, 3 },
+ /* 14*/ { BARCODE_DATAMATRIX, GS1_MODE, 28, BARCODE_CONTENT_SEGS, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 28, "01049123451234591597033130128\03510ABC123", -1, 3 }, /* Note: content seg ECI remains at default 3 */
+ /* 15*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, "https://example.com/01/09506000134369", -1, 0, 0, "", -1, 0 },
+ /* 16*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, BARCODE_CONTENT_SEGS, "https://example.com/01/09506000134369", -1, 0, 0, "https://example.com/01/09506000134369", -1, 3 },
+ /* 17*/ { BARCODE_HIBC_DM, UNICODE_MODE, -1, -1, "H123ABC01234567890", -1, 0, 0, "", -1, 0 },
+ /* 18*/ { BARCODE_HIBC_DM, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "H123ABC01234567890", -1, 0, 0, "+H123ABC01234567890D", -1, 3 },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -6487,7 +6489,7 @@ static void test_rt(const testCtx *const p_ctx) {
testFinish();
}
-static void test_rt_segs(const testCtx *const p_ctx) {
+static void test_ct_segs(const testCtx *const p_ctx) {
int debug = p_ctx->debug;
struct item {
@@ -7686,8 +7688,8 @@ int main(int argc, char *argv[]) {
{ "test_input", test_input },
{ "test_encode", test_encode },
{ "test_encode_segs", test_encode_segs },
- { "test_rt", test_rt },
- { "test_rt_segs", test_rt_segs },
+ { "test_ct", test_ct },
+ { "test_ct_segs", test_ct_segs },
#ifdef ZINT_TEST_ENCODING
{ "test_minimalenc", test_minimalenc },
#endif
diff --git a/backend/tests/test_dotcode.c b/backend/tests/test_dotcode.c
index 30874121..66950f78 100644
--- a/backend/tests/test_dotcode.c
+++ b/backend/tests/test_dotcode.c
@@ -71,7 +71,7 @@ static void test_large(const testCtx *const p_ctx) {
char data_buf[4096];
char escaped[8192];
- char cmp_buf[50000];
+ char cmp_buf[50000] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/zxing-cpp tests if asked, too slow otherwise */
@@ -294,7 +294,7 @@ static void test_input(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[1024];
- char cmp_buf[32768];
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
diff --git a/backend/tests/test_gs1.c b/backend/tests/test_gs1.c
index db2ae002..08e91ef0 100644
--- a/backend/tests/test_gs1.c
+++ b/backend/tests/test_gs1.c
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2019-2025 Robin Stuart
+ Copyright (C) 2019-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -44,229 +44,379 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
const char *composite;
int ret;
+ int compare_previous;
const char *comment;
+ const char *expected_errtxt;
const char *expected;
};
+ /* s/\v(\/\*)[ 0-9]*(\*\/)/\=printf("%s%3d%s", submatch(1), (@z+setreg('z',@z+1)), submatch(2))/ | let @z=0: */
static const struct item data[] = {
- /* 0*/ { BARCODE_GS1_128, -1, "12345678901234", "", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
- /* 1*/ { BARCODE_GS1_128, -1, "[01]12345678901231", "", 0, "Input mode ignored; verified manually against TEC-IT",
+ /* 0*/ { BARCODE_GS1_128, -1, "12345678901234", "", ZINT_ERROR_INVALID_DATA, 0, "GS1 data required", "Error 252: Data does not start with an AI", "" },
+ /* 1*/ { BARCODE_GS1_128, -1, "https://example.com/01/12345678901231", "", ZINT_ERROR_INVALID_DATA, 0, "Digital Links require matrix symbologies", "Error 252: Data does not start with an AI", "" },
+ /* 2*/ { BARCODE_GS1_128, -1, "^12345678901234", "", ZINT_WARN_NONCOMPLIANT, 0, "", "Warning 261: AI (12) data position 3: Invalid month '56'",
+ "110100111001111010111010110011100100010110001110001011011000010100110111101101011001110010001011000101011110001100011101011"
+ },
+ /* 3*/ { BARCODE_GS1_128, GS1RAW_MODE, "12345678901234", "", ZINT_WARN_NONCOMPLIANT, 1, "", "Warning 261: AI (12) data position 3: Invalid month '56'",
+ "110100111001111010111010110011100100010110001110001011011000010100110111101101011001110010001011000101011110001100011101011"
+ },
+ /* 4*/ { BARCODE_GS1_128, -1, "[01]12345678901231", "", 0, 0, "Input mode ignored; verified manually against TEC-IT", "",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /* 2*/ { BARCODE_GS1_128, GS1_MODE, "[01]12345678901231", "", 0, "Input mode ignored",
+ },
+ /* 5*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(01)12345678901231", "", 0, 1, "", "",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /* 3*/ { BARCODE_GS1_128, UNICODE_MODE, "[01]12345678901231", "", 0, "Input mode ignored",
+ },
+ /* 6*/ { BARCODE_GS1_128, -1, "^0112345678901231", "", 0, 1, "", "",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /* 4*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(01)12345678901231", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 7*/ { BARCODE_GS1_128, GS1RAW_MODE, "0112345678901231", "", 0, 1, "", "",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /* 5*/ { BARCODE_GS1_128, GS1_MODE, "[01]12345678901231[21]()", "", 0, "Parentheses in AI data",
+ },
+ /* 8*/ { BARCODE_GS1_128, GS1_MODE, "[01]12345678901231", "", 0, 1, "Input mode ignored", "",
+ "11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
+ },
+ /* 9*/ { BARCODE_GS1_128, UNICODE_MODE, "[01]12345678901231", "", 0, 1, "Input mode ignored", "",
+ "11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
+ },
+ /* 10*/ { BARCODE_GS1_128, GS1_MODE, "[01]12345678901231[21]()", "", 0, 0, "Parentheses in AI data", "",
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011011100100101111011101000110010011001001000110111000101100011101011"
- },
- /* 6*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(21)\\(\\)", "", 0, "Parentheses in AI data",
+ },
+ /* 11*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(21)\\(\\)", "", 0, 1, "Parentheses in AI data", "",
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011011100100101111011101000110010011001001000110111000101100011101011"
- },
- /* 7*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[21]1234", 0, "Input mode ignored",
+ },
+ /* 12*/ { BARCODE_GS1_128, -1, "^011234567890123121()", "", 0, 1, "Parentheses in AI data", "",
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011011100100101111011101000110010011001001000110111000101100011101011"
+ },
+ /* 13*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123121()", "", 0, 1, "Parentheses in AI data", "",
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011011100100101111011101000110010011001001000110111000101100011101011"
+ },
+ /* 14*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[21]1234", 0, 0, "Input mode ignored", "",
"0000000000000000000001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010000000000000000000000000"
"0000000000000000000001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010000000000000000000000000"
"0000000000000000000001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
- },
- /* 8*/ { BARCODE_GS1_128_CC, GS1_MODE, "[01]12345678901231", "[21]1234", 0, "Input mode ignored",
+ },
+ /* 15*/ { BARCODE_GS1_128_CC, GS1PARENS_MODE, "(01)12345678901231", "(21)1234", 0, 1, "", "",
"0000000000000000000001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010000000000000000000000000"
"0000000000000000000001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010000000000000000000000000"
"0000000000000000000001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
- },
- /* 9*/ { BARCODE_GS1_128_CC, UNICODE_MODE, "[01]12345678901231", "[21]1234", 0, "Input mode ignored",
+ },
+ /* 16*/ { BARCODE_GS1_128_CC, -1, "^0112345678901231", "^211234", 0, 1, "", "",
"0000000000000000000001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010000000000000000000000000"
"0000000000000000000001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010000000000000000000000000"
"0000000000000000000001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
- },
- /*10*/ { BARCODE_GS1_128_CC, GS1PARENS_MODE, "(01)12345678901231", "(21)1234", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 17*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, "0112345678901231", "211234", 0, 1, "", "",
"0000000000000000000001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010000000000000000000000000"
"0000000000000000000001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010000000000000000000000000"
"0000000000000000000001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
- },
- /*11*/ { BARCODE_GS1_128_CC, GS1_MODE, "[01]12345678901231[10])", "[21](", 0, "Parentheses in AI data",
+ },
+ /* 18*/ { BARCODE_GS1_128_CC, GS1_MODE, "[01]12345678901231", "[21]1234", 0, 1, "Input mode ignored", "",
+ "0000000000000000000001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010000000000000000000000000"
+ "0000000000000000000001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010000000000000000000000000"
+ "0000000000000000000001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010000000000000000000000000"
+ "0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
+ },
+ /* 19*/ { BARCODE_GS1_128_CC, UNICODE_MODE, "[01]12345678901231", "[21]1234", 0, 1, "Input mode ignored", "",
+ "0000000000000000000001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010000000000000000000000000"
+ "0000000000000000000001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010000000000000000000000000"
+ "0000000000000000000001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010000000000000000000000000"
+ "0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
+ },
+ /* 20*/ { BARCODE_GS1_128_CC, GS1_MODE, "[01]12345678901231[10])", "[21](", 0, 0, "Parentheses in AI data", "",
"0000000000000000000000000000000000000000000110110111010100001000001000110000110001010001001110100111010100011100001110001100101100011011000101000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000110110110011100000101110110110000010011100101001100100100011110010111101101011100010000011001000101000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000110110100010001000100011110111100101111001001001100110111111010011010001111100100011101011101000101000000000000000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100110111011010000100010011011011101000100001011101000010011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011001000100101111011101100100100010111011110100010111101100011101011"
- },
- /*12*/ { BARCODE_GS1_128_CC, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(10)\\)", "(21)\\(", 0, "Parentheses in AI data",
+ },
+ /* 21*/ { BARCODE_GS1_128_CC, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(10)\\)", "(21)\\(", 0, 1, "Parentheses in AI data", "",
"0000000000000000000000000000000000000000000110110111010100001000001000110000110001010001001110100111010100011100001110001100101100011011000101000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000110110110011100000101110110110000010011100101001100100100011110010111101101011100010000011001000101000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000110110100010001000100011110111100101111001001001100110111111010011010001111100100011101011101000101000000000000000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100110111011010000100010011011011101000100001011101000010011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011001000100101111011101100100100010111011110100010111101100011101011"
- },
- /*13*/ { BARCODE_EAN14, -1, "1234567890123", "", 0, "Input mode ignored; verified manually against TEC-IT",
+ },
+ /* 22*/ { BARCODE_GS1_128_CC, -1, "^011234567890123110)", "^21(", 0, 1, "Parentheses in AI data", "",
+ "0000000000000000000000000000000000000000000110110111010100001000001000110000110001010001001110100111010100011100001110001100101100011011000101000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000110110110011100000101110110110000010011100101001100100100011110010111101101011100010000011001000101000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000110110100010001000100011110111100101111001001001100110111111010011010001111100100011101011101000101000000000000000000000000000000000000"
+ "0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100110111011010000100010011011011101000100001011101000010011100010100"
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011001000100101111011101100100100010111011110100010111101100011101011"
+ },
+ /* 23*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, "011234567890123110)", "21(", 0, 1, "Parentheses in AI data", "",
+ "0000000000000000000000000000000000000000000110110111010100001000001000110000110001010001001110100111010100011100001110001100101100011011000101000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000110110110011100000101110110110000010011100101001100100100011110010111101101011100010000011001000101000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000110110100010001000100011110111100101111001001001100110111111010011010001111100100011101011101000101000000000000000000000000000000000000"
+ "0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100110111011010000100010011011011101000100001011101000010011100010100"
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011001000100101111011101100100100010111011110100010111101100011101011"
+ },
+ /* 24*/ { BARCODE_EAN14, -1, "1234567890123", "", 0, 0, "Input mode ignored; verified manually against TEC-IT", "",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /*14*/ { BARCODE_EAN14, GS1_MODE, "1234567890123", "", 0, "Input mode ignored",
+ },
+ /* 25*/ { BARCODE_EAN14, GS1_MODE, "1234567890123", "", 0, 0, "Input mode ignored", "",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /*15*/ { BARCODE_EAN14, UNICODE_MODE, "1234567890123", "", 0, "Input mode ignored",
+ },
+ /* 26*/ { BARCODE_EAN14, UNICODE_MODE, "1234567890123", "", 0, 0, "Input mode ignored", "",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /*16*/ { BARCODE_EAN14, GS1PARENS_MODE, "1234567890123", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 27*/ { BARCODE_EAN14, GS1PARENS_MODE, "1234567890123", "", 0, 0, "Input mode ignored (parentheses instead of square brackets)", "",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /*17*/ { BARCODE_NVE18, -1, "12345678901234567", "", 0, "Input mode ignored; verified manually against TEC-IT",
+ },
+ /* 28*/ { BARCODE_EAN14, GS1RAW_MODE, "1234567890123", "", 0, 0, "Input mode ignored (raw same as non-raw so doesn't matter)", "",
+ "11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
+ },
+ /* 29*/ { BARCODE_EAN14, -1, "^1234567890123", "", ZINT_ERROR_INVALID_DATA, 0, "Caret mode not accepted", "Error 346: Invalid character at position 1 in input (digits only)", "" },
+ /* 30*/ { BARCODE_NVE18, -1, "12345678901234567", "", 0, 0, "Input mode ignored; verified manually against TEC-IT", "",
"110100111001111010111011011001100101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010010101101110001100011101011"
- },
- /*18*/ { BARCODE_NVE18, GS1_MODE, "12345678901234567", "", 0, "Input mode ignored",
+ },
+ /* 31*/ { BARCODE_NVE18, GS1_MODE, "12345678901234567", "", 0, 0, "Input mode ignored", "",
"110100111001111010111011011001100101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010010101101110001100011101011"
- },
- /*19*/ { BARCODE_NVE18, UNICODE_MODE, "12345678901234567", "", 0, "Input mode ignored",
+ },
+ /* 32*/ { BARCODE_NVE18, UNICODE_MODE, "12345678901234567", "", 0, 0, "Input mode ignored", "",
"110100111001111010111011011001100101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010010101101110001100011101011"
- },
- /*20*/ { BARCODE_NVE18, GS1PARENS_MODE, "12345678901234567", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 33*/ { BARCODE_NVE18, GS1PARENS_MODE, "12345678901234567", "", 0, 0, "Input mode ignored (parentheses instead of square brackets)", "",
"110100111001111010111011011001100101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010010101101110001100011101011"
- },
- /*21*/ { BARCODE_DBAR_EXP, -1, "2012", "", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
- /*22*/ { BARCODE_DBAR_EXP, -1, "[20]12", "", 0, "Input mode ignored",
+ },
+ /* 34*/ { BARCODE_NVE18, GS1RAW_MODE, "12345678901234567", "", 0, 0, "Input mode ignored (raw same as non-raw so doesn't matter)", "",
+ "110100111001111010111011011001100101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010010101101110001100011101011"
+ },
+ /* 35*/ { BARCODE_NVE18, -1, "^12345678901234567", "", ZINT_ERROR_INVALID_DATA, 0, "Caret mode not accepted", "Error 346: Invalid character at position 1 in input (digits only)", "" },
+ /* 36*/ { BARCODE_DBAR_EXP, -1, "2012", "", ZINT_ERROR_INVALID_DATA, 0, "GS1 data required", "Error 252: Data does not start with an AI", "" },
+ /* 37*/ { BARCODE_DBAR_EXP, -1, "https://example.com/01/12345678901231", "", ZINT_ERROR_INVALID_DATA, 0, "Digital Links require matrix symbologies", "Error 252: Data does not start with an AI", "" },
+ /* 38*/ { BARCODE_DBAR_EXP, -1, "[20]12", "", 0, 0, "Input mode ignored", "",
"010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
- },
- /*23*/ { BARCODE_DBAR_EXP, GS1PARENS_MODE, "(20)12", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 39*/ { BARCODE_DBAR_EXP, GS1PARENS_MODE, "(20)12", "", 0, 0, "Input mode ignored (parentheses instead of square brackets)", "",
"010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
- },
- /*24*/ { BARCODE_DBAR_EXP, GS1_MODE, "[20]12", "", 0, "Input mode ignored",
+ },
+ /* 40*/ { BARCODE_DBAR_EXP, GS1_MODE, "[20]12", "", 0, 0, "Input mode ignored", "",
"010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
- },
- /*25*/ { BARCODE_DBAR_EXP, GS1_MODE | GS1PARENS_MODE, "(20)12", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 41*/ { BARCODE_DBAR_EXP, GS1_MODE | GS1PARENS_MODE, "(20)12", "", 0, 0, "Input mode ignored (parentheses instead of square brackets)", "",
"010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
- },
- /*26*/ { BARCODE_DBAR_EXP, UNICODE_MODE, "[20]12", "", 0, "Input mode ignored",
+ },
+ /* 42*/ { BARCODE_DBAR_EXP, UNICODE_MODE, "[20]12", "", 0, 0, "Input mode ignored", "",
"010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
- },
- /*27*/ { BARCODE_DBAR_EXP, -1, "[21])", "", 0, "Parentheses in AI data",
+ },
+ /* 43*/ { BARCODE_DBAR_EXP, -1, "^2012", "", 0, 1, "", "",
+ "010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
+ },
+ /* 44*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, "2012", "", 0, 1, "", "",
+ "010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
+ },
+ /* 45*/ { BARCODE_DBAR_EXP, -1, "[21])", "", 0, 0, "Parentheses in AI data", "",
"010010000001010001101111111100001010000010000100110100110111111011101011110000000010000011011001110101"
- },
- /*28*/ { BARCODE_DBAR_EXP, ESCAPE_MODE | GS1PARENS_MODE, "(21)\\)", "", 0, "Parentheses in AI data",
+ },
+ /* 46*/ { BARCODE_DBAR_EXP, ESCAPE_MODE | GS1PARENS_MODE, "(21)\\)", "", 0, 0, "Parentheses in AI data", "",
"010010000001010001101111111100001010000010000100110100110111111011101011110000000010000011011001110101"
- },
- /*29*/ { BARCODE_DBAR_EXP_CC, -1, "[20]12", "[21]1234", 0, "Input mode ignored; verified manually against TEC-IT",
+ },
+ /* 47*/ { BARCODE_DBAR_EXP, -1, "^21)", "", 0, 1, "Parentheses in AI data", "",
+ "010010000001010001101111111100001010000010000100110100110111111011101011110000000010000011011001110101"
+ },
+ /* 48*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, "21)", "", 0, 1, "Parentheses in AI data", "",
+ "010010000001010001101111111100001010000010000100110100110111111011101011110000000010000011011001110101"
+ },
+ /* 49*/ { BARCODE_DBAR_EXP_CC, -1, "[20]12", "[21]1234", 0, 0, "Input mode ignored; verified manually against TEC-IT", "",
"001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
"001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
"001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*30*/ { BARCODE_DBAR_EXP_CC, GS1_MODE, "[20]12", "[21]1234", 0, "Input mode ignored",
+ },
+ /* 50*/ { BARCODE_DBAR_EXP_CC, GS1_MODE, "[20]12", "[21]1234", 0, 0, "Input mode ignored", "",
"001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
"001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
"001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*31*/ { BARCODE_DBAR_EXP_CC, UNICODE_MODE, "[20]12", "[21]1234", 0, "Input mode ignored",
+ },
+ /* 51*/ { BARCODE_DBAR_EXP_CC, UNICODE_MODE, "[20]12", "[21]1234", 0, 0, "Input mode ignored", "",
"001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
"001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
"001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*32*/ { BARCODE_DBAR_EXP_CC, -1, "[10]()", "[21]()", 0, "Parentheses in AI data",
+ },
+ /* 52*/ { BARCODE_DBAR_EXP_CC, -1, "^2012", "^211234", 0, 1, "", "",
+ "001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
+ "001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
+ "001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
+ "000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
+ "010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /* 53*/ { BARCODE_DBAR_EXP_CC, GS1RAW_MODE, "2012", "211234", 0, 1, "", "",
+ "001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
+ "001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
+ "001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
+ "000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
+ "010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /* 54*/ { BARCODE_DBAR_EXP_CC, -1, "[10]()", "[21]()", 0, 0, "Parentheses in AI data", "",
"00110110111010100001000001000110000110001010001001110100111010111001111101100111011001000011011000101000000000000000000000000000000000"
"00110110110010001000111110110111101100001101001001100100111110111101110101111101000110111011001000101000000000000000000000000000000000"
"00110110100010111110110100000100001111011011001001100110100111001100111001000001001001111011101000101000000000000000000000000000000000"
"00000010011111011101000000001010010101110011000001101100100000010001010000101010000100011011110001101110111101111010010100000010100000"
"01011101100000100010111111110000101010001100111110010011011111101110101111000000111011100100001110010001000010000101100011111100001010"
- },
- /*33*/ { BARCODE_DBAR_EXP_CC, ESCAPE_MODE | GS1PARENS_MODE, "(10)\\(\\)", "(21)\\(\\)", 0, "Parentheses in AI data",
+ },
+ /* 55*/ { BARCODE_DBAR_EXP_CC, ESCAPE_MODE | GS1PARENS_MODE, "(10)\\(\\)", "(21)\\(\\)", 0, 0, "Parentheses in AI data", "",
"00110110111010100001000001000110000110001010001001110100111010111001111101100111011001000011011000101000000000000000000000000000000000"
"00110110110010001000111110110111101100001101001001100100111110111101110101111101000110111011001000101000000000000000000000000000000000"
"00110110100010111110110100000100001111011011001001100110100111001100111001000001001001111011101000101000000000000000000000000000000000"
"00000010011111011101000000001010010101110011000001101100100000010001010000101010000100011011110001101110111101111010010100000010100000"
"01011101100000100010111111110000101010001100111110010011011111101110101111000000111011100100001110010001000010000101100011111100001010"
- },
- /*34*/ { BARCODE_DBAR_EXPSTK, -1, "12", "", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
- /*35*/ { BARCODE_DBAR_EXPSTK, -1, "[20]12", "", 0, "Input mode ignored",
+ },
+ /* 56*/ { BARCODE_DBAR_EXP_CC, -1, "^10()", "^21()", 0, 1, "Parentheses in AI data", "",
+ "00110110111010100001000001000110000110001010001001110100111010111001111101100111011001000011011000101000000000000000000000000000000000"
+ "00110110110010001000111110110111101100001101001001100100111110111101110101111101000110111011001000101000000000000000000000000000000000"
+ "00110110100010111110110100000100001111011011001001100110100111001100111001000001001001111011101000101000000000000000000000000000000000"
+ "00000010011111011101000000001010010101110011000001101100100000010001010000101010000100011011110001101110111101111010010100000010100000"
+ "01011101100000100010111111110000101010001100111110010011011111101110101111000000111011100100001110010001000010000101100011111100001010"
+ },
+ /* 57*/ { BARCODE_DBAR_EXP_CC, GS1RAW_MODE, "10()", "21()", 0, 1, "Parentheses in AI data", "",
+ "00110110111010100001000001000110000110001010001001110100111010111001111101100111011001000011011000101000000000000000000000000000000000"
+ "00110110110010001000111110110111101100001101001001100100111110111101110101111101000110111011001000101000000000000000000000000000000000"
+ "00110110100010111110110100000100001111011011001001100110100111001100111001000001001001111011101000101000000000000000000000000000000000"
+ "00000010011111011101000000001010010101110011000001101100100000010001010000101010000100011011110001101110111101111010010100000010100000"
+ "01011101100000100010111111110000101010001100111110010011011111101110101111000000111011100100001110010001000010000101100011111100001010"
+ },
+ /* 58*/ { BARCODE_DBAR_EXPSTK, -1, "12", "", ZINT_ERROR_INVALID_DATA, 0, "GS1 data required", "Error 252: Data does not start with an AI", "" },
+ /* 59*/ { BARCODE_DBAR_EXPSTK, -1, "https://example.com/01/12345678901231", "", ZINT_ERROR_INVALID_DATA, 0, "Digital Links require matrix symbologies", "Error 252: Data does not start with an AI", "" },
+ /* 60*/ { BARCODE_DBAR_EXPSTK, -1, "[20]12", "", 0, 0, "Input mode ignored", "",
"010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
- },
- /*36*/ { BARCODE_DBAR_EXPSTK, GS1_MODE, "[20]12", "", 0, "Input mode ignored",
+ },
+ /* 61*/ { BARCODE_DBAR_EXPSTK, GS1_MODE, "[20]12", "", 0, 0, "Input mode ignored", "",
"010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
- },
- /*37*/ { BARCODE_DBAR_EXPSTK, UNICODE_MODE, "[20]12", "", 0, "Input mode ignored",
+ },
+ /* 62*/ { BARCODE_DBAR_EXPSTK, UNICODE_MODE, "[20]12", "", 0, 0, "Input mode ignored", "",
"010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
- },
- /*38*/ { BARCODE_DBAR_EXPSTK, -1, "[21](21)", "", 0, "Parentheses in AI data",
+ },
+ /* 63*/ { BARCODE_DBAR_EXPSTK, -1, "^2012", "", 0, 1, "", "",
+ "010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
+ },
+ /* 64*/ { BARCODE_DBAR_EXPSTK, GS1RAW_MODE, "2012", "", 0, 1, "", "",
+ "010010000010000101101111111100001010000010000110010101111100101110001011110000000010101111100001011101"
+ },
+ /* 65*/ { BARCODE_DBAR_EXPSTK, -1, "[21](21)", "", 0, 0, "Parentheses in AI data", "",
"010100111100010000101111111100001010000010000100110100110111111011101011110000001110011001110110000101"
"000011000011101111010000000010100101111101111011001011001000000100010100001010100001100110001001110000"
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
"000000001110010001001010000001010010101111100001010000000000000000000000000000000000000000000000000000"
"001011110001101110110001111110000101010000011110100010000000000000000000000000000000000000000000000000"
- },
- /*39*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, "(21)\\(21\\)", "", 0, "Parentheses in AI data",
+ },
+ /* 66*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, "(21)\\(21\\)", "", 0, 0, "Parentheses in AI data", "",
"010100111100010000101111111100001010000010000100110100110111111011101011110000001110011001110110000101"
"000011000011101111010000000010100101111101111011001011001000000100010100001010100001100110001001110000"
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
"000000001110010001001010000001010010101111100001010000000000000000000000000000000000000000000000000000"
"001011110001101110110001111110000101010000011110100010000000000000000000000000000000000000000000000000"
- },
- /*40*/ { BARCODE_DBAR_EXPSTK_CC, -1, "12", "[21]1234", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
- /*41*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[20]12", "[21]1234", 0, "Input mode ignored; verified manually against TEC-IT (same as BARCODE_DBAR_EXP_CC above)",
+ },
+ /* 67*/ { BARCODE_DBAR_EXPSTK, -1, "^21(21)", "", 0, 1, "Parentheses in AI data", "",
+ "010100111100010000101111111100001010000010000100110100110111111011101011110000001110011001110110000101"
+ "000011000011101111010000000010100101111101111011001011001000000100010100001010100001100110001001110000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000001110010001001010000001010010101111100001010000000000000000000000000000000000000000000000000000"
+ "001011110001101110110001111110000101010000011110100010000000000000000000000000000000000000000000000000"
+ },
+ /* 68*/ { BARCODE_DBAR_EXPSTK, GS1RAW_MODE, "21(21)", "", 0, 1, "Parentheses in AI data", "",
+ "010100111100010000101111111100001010000010000100110100110111111011101011110000001110011001110110000101"
+ "000011000011101111010000000010100101111101111011001011001000000100010100001010100001100110001001110000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000001110010001001010000001010010101111100001010000000000000000000000000000000000000000000000000000"
+ "001011110001101110110001111110000101010000011110100010000000000000000000000000000000000000000000000000"
+ },
+ /* 69*/ { BARCODE_DBAR_EXPSTK_CC, -1, "12", "[21]1234", ZINT_ERROR_INVALID_DATA, 0, "GS1 data required", "Error 252: Data does not start with an AI (linear component)", "" },
+ /* 70*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[20]12", "[21]1234", 0, 0, "Input mode ignored; verified manually against TEC-IT (same as BARCODE_DBAR_EXP_CC above)", "",
"001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
"001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
"001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*42*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, "(20)12", "(21)1234", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 71*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, "(20)12", "(21)1234", 0, 0, "Input mode ignored (parentheses instead of square brackets)", "",
"001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
"001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
"001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*43*/ { BARCODE_DBAR_EXPSTK_CC, GS1_MODE, "[20]12", "[21]1234", 0, "Input mode ignored",
+ },
+ /* 72*/ { BARCODE_DBAR_EXPSTK_CC, GS1_MODE, "[20]12", "[21]1234", 0, 0, "Input mode ignored", "",
"001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
"001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
"001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*44*/ { BARCODE_DBAR_EXPSTK_CC, UNICODE_MODE, "[20]12", "[21]1234", 0, "Input mode ignored",
+ },
+ /* 73*/ { BARCODE_DBAR_EXPSTK_CC, UNICODE_MODE, "[20]12", "[21]1234", 0, 0, "Input mode ignored", "",
"001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
"001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
"001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*45*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[10]1)", "[21]12)(", 0, "Parentheses in AI data",
+ },
+ /* 74*/ { BARCODE_DBAR_EXPSTK_CC, -1, "^2012", "^211234", 0, 1, "", "",
+ "001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
+ "001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
+ "001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
+ "000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
+ "010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /* 75*/ { BARCODE_DBAR_EXPSTK_CC, GS1RAW_MODE, "2012", "211234", 0, 1, "", "",
+ "001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010"
+ "001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010"
+ "001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010"
+ "000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
+ "010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /* 76*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[10]1)", "[21]12)(", 0, 0, "Parentheses in AI data", "",
"001101101110110100001000001101110111011100111010011101001000010010000001010010001000010000110110001010"
"001101101100111101000010001001110000110111010010011001001101100011110001011010111000100000110010001010"
"001101101000111001111101011001011100100000011010011001101001111001000001010000011110010100111010001010"
"000011111001011111010000000010100100111000001101011010001001100000010100001010101001110100110000010000"
"010100000110100000101111111100001011000111110010100101110110011111101011110000000010001011001111101101"
- },
- /*46*/ { BARCODE_DBAR_EXPSTK_CC, ESCAPE_MODE | GS1PARENS_MODE, "(10)1\\)", "(21)12\\)\\(", 0, "Parentheses in AI data",
+ },
+ /* 77*/ { BARCODE_DBAR_EXPSTK_CC, ESCAPE_MODE | GS1PARENS_MODE, "(10)1\\)", "(21)12\\)\\(", 0, 0, "Parentheses in AI data", "",
"001101101110110100001000001101110111011100111010011101001000010010000001010010001000010000110110001010"
"001101101100111101000010001001110000110111010010011001001101100011110001011010111000100000110010001010"
"001101101000111001111101011001011100100000011010011001101001111001000001010000011110010100111010001010"
"000011111001011111010000000010100100111000001101011010001001100000010100001010101001110100110000010000"
"010100000110100000101111111100001011000111110010100101110110011111101011110000000010001011001111101101"
- },
+ },
+ /* 78*/ { BARCODE_DBAR_EXPSTK_CC, -1, "^101)", "^2112)(", 0, 1, "Parentheses in AI data", "",
+ "001101101110110100001000001101110111011100111010011101001000010010000001010010001000010000110110001010"
+ "001101101100111101000010001001110000110111010010011001001101100011110001011010111000100000110010001010"
+ "001101101000111001111101011001011100100000011010011001101001111001000001010000011110010100111010001010"
+ "000011111001011111010000000010100100111000001101011010001001100000010100001010101001110100110000010000"
+ "010100000110100000101111111100001011000111110010100101110110011111101011110000000010001011001111101101"
+ },
+ /* 79*/ { BARCODE_DBAR_EXPSTK_CC, GS1RAW_MODE, "101)", "2112)(", 0, 1, "Parentheses in AI data", "",
+ "001101101110110100001000001101110111011100111010011101001000010010000001010010001000010000110110001010"
+ "001101101100111101000010001001110000110111010010011001001101100011110001011010111000100000110010001010"
+ "001101101000111001111101011001011100100000011010011001101001111001000001010000011110010100111010001010"
+ "000011111001011111010000000010100100111000001101011010001001100000010100001010101001110100110000010000"
+ "010100000110100000101111111100001011000111110010100101110110011111101011110000000010001011001111101101"
+ },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
struct zint_symbol *symbol = NULL;
+ struct zint_symbol *previous_symbol = NULL;
+
const char *text;
char escaped[1024];
char escaped2[1024];
- char bwipp_buf[8196];
+ char bwipp_buf[8196] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
/* Only do BWIPP test if asked, too slow otherwise */
@@ -296,32 +446,39 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
if (p_ctx->generate) {
const int data_len = (int) strlen(data[i].data);
const int composite_len = (int) strlen(data[i].composite);
- if (data[i].ret == 0) {
- printf(" /*%2d*/ { %s, %s, \"%s\", \"%s\", %d, \"%s\",\n",
+ if (data[i].ret < ZINT_ERROR) {
+ printf(" /*%3d*/ { %s, %s, \"%s\", \"%s\", %s, \"%s\", %d, \"%s\",\n",
i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode),
testUtilEscape(data[i].data, data_len, escaped, sizeof(escaped)),
testUtilEscape(data[i].composite, composite_len, escaped2, sizeof(escaped2)),
- data[i].ret, data[i].comment);
+ testUtilErrorName(ret), symbol->errtxt, data[i].compare_previous, data[i].comment);
testUtilModulesPrint(symbol, " ", "\n");
- printf(" },\n");
+ printf(" },\n");
} else {
- printf(" /*%2d*/ { %s, %s, \"%s\", \"%s\", %s, \"%s\", \"\" },\n",
+ printf(" /*%3d*/ { %s, %s, \"%s\", \"%s\", %s, \"%s\", %d, \"%s\", \"\" },\n",
i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode),
testUtilEscape(data[i].data, data_len, escaped, sizeof(escaped)),
testUtilEscape(data[i].composite, composite_len, escaped2, sizeof(escaped2)),
- testUtilErrorName(data[i].ret), data[i].comment);
+ testUtilErrorName(data[i].ret), symbol->errtxt, data[i].compare_previous, data[i].comment);
}
} else {
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
+ if (p_ctx->index == -1 && data[i].compare_previous) {
+ int cmp_ret = testUtilSymbolCmp(symbol, previous_symbol);
+ assert_zero(cmp_ret, "i:%d testUtilSymbolCmp cmp_ret %d != 0\n", i, cmp_ret);
+ }
+ assert_zero(strcmp(symbol->errtxt, data[i].expected_errtxt), "i:%d strcmp(%s, %s) != 0\n",
+ i, symbol->errtxt, data[i].expected_errtxt);
if (ret < ZINT_ERROR) {
int width, row;
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, -1, -1, -1, debug)) {
+ if (do_bwipp && testUtilCanBwipp(i, symbol, -1, -1,
+ text[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
ret = testUtilBwipp(i, symbol, -1, -1, -1, text, length, symbol->primary, bwipp_buf,
sizeof(bwipp_buf), NULL);
assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
@@ -335,8 +492,10 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
}
}
- ZBarcode_Delete(symbol);
+ ZBarcode_Delete(previous_symbol);
+ previous_symbol = symbol;
}
+ ZBarcode_Delete(previous_symbol);
testFinish();
}
@@ -356,133 +515,197 @@ static void test_hrt(const testCtx *const p_ctx) {
const char *composite;
int ret;
+ int compare_previous;
const char *expected;
const char *expected_content;
};
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
- /* 0*/ { BARCODE_GS1_128, -1, -1, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
- /* 1*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "", 0, "(01)12345678901234(20)12", "" },
- /* 2*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, "(01)12345678901234(20)12", "01123456789012342012" },
- /* 3*/ { BARCODE_GS1_128, -1, -1, "[01]12345678901231[20]12", "", 0, "(01)12345678901231(20)12", "" },
- /* 4*/ { BARCODE_GS1_128, -1, -1, "[01]12345678901231[10]12[20]AB", "", ZINT_WARN_NONCOMPLIANT, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
- /* 5*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, -1, "[01]12345678901231[10]10[20]AB", "", 0, "(01)12345678901231(10)10(20)AB", "" },
- /* 6*/ { BARCODE_GS1_128, -1, -1, "[01]12345678901231[10]AB[20]12", "", 0, "(01)12345678901231(10)AB(20)12", "" },
- /* 7*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF]GH", "", ZINT_WARN_NONCOMPLIANT, "(91)ABCDEF]GH", "" }, /* Invalid CSET 82 character */
- /* 8*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, -1, "[91]ABCDEF]GH", "", 0, "(91)ABCDEF]GH", "" },
- /* 9*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF]GH", "", ZINT_WARN_NONCOMPLIANT, "(91)ABCDEF]GH", "91ABCDEF]GH" },
- /* 10*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF)GH", "", 0, "(91)ABCDEF)GH", "" },
- /* 11*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF)GH", "", 0, "(91)ABCDEF)GH", "91ABCDEF)GH" },
- /* 12*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF(GH", "", 0, "(91)ABCDEF(GH", "" },
- /* 13*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF(GH", "", 0, "(91)ABCDEF(GH", "91ABCDEF(GH" },
- /* 14*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDE(20)12", "", 0, "(91)ABCDE(20)12", "" },
- /* 15*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDE(20)12", "", 0, "(91)ABCDE(20)12", "91ABCDE(20)12" },
- /* 16*/ { BARCODE_GS1_128, -1, -1, "[90]1234[91]ABCDE(20)12", "", 0, "(90)1234(91)ABCDE(20)12", "" },
- /* 17*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[90]1234[91]ABCDE(20)12", "", 0, "(90)1234(91)ABCDE(20)12", "901234\03591ABCDE(20)12" },
- /* 18*/ { BARCODE_GS1_128, -1, -1, "[90]1234[91]ABCDE(20)12[20]12", "", 0, "(90)1234(91)ABCDE(20)12(20)12", "" },
- /* 19*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[90]1234[91]ABCDE(20)12[20]12", "", 0, "(90)1234(91)ABCDE(20)12(20)12", "901234\03591ABCDE(20)12\0352012" },
- /* 20*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDEF]GH", "", ZINT_WARN_NONCOMPLIANT, "(91)ABCDEF]GH", "" }, /* Invalid CSET 82 character */
- /* 21*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(91)ABCDEF]GH", "", 0, "(91)ABCDEF]GH", "" },
- /* 22*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF]GH", "", ZINT_WARN_NONCOMPLIANT, "(91)ABCDEF]GH", "91ABCDEF]GH" },
- /* 23*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDEF)GH", "", 0, "(91)ABCDEF)GH", "" },
- /* 24*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF)GH", "", 0, "(91)ABCDEF)GH", "91ABCDEF)GH" },
- /* 25*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDE[FGH", "", ZINT_WARN_NONCOMPLIANT, "(91)ABCDE[FGH", "" }, /* Invalid CSET 82 character */
- /* 26*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(91)ABCDE[FGH", "", 0, "(91)ABCDE[FGH", "" },
- /* 27*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDE[FGH", "", ZINT_WARN_NONCOMPLIANT, "(91)ABCDE[FGH", "91ABCDE[FGH" },
- /* 28*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDE[92]GH", "", ZINT_WARN_NONCOMPLIANT, "(91)ABCDE[92]GH", "" }, /* Invalid CSET 82 character */
- /* 29*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(91)ABCDE[92]GH", "", 0, "(91)ABCDE[92]GH", "" },
- /* 30*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDE[92]GH", "", ZINT_WARN_NONCOMPLIANT, "(91)ABCDE[92]GH", "91ABCDE[92]GH" },
- /* 31*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901234[20]12", "[21]12345", ZINT_WARN_NONCOMPLIANT, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
- /* 32*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF)GH", "", 0, "(91)ABCDEF)GH", "" },
- /* 33*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF)GH", "", 0, "(91)ABCDEF)GH", "91ABCDEF)GH" },
- /* 34*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDEF\\)GH", "", 0, "(91)ABCDEF\\)GH", "" }, /* Escaped parens now work without ESCAPE_MODE & now kept in HRT */
- /* 35*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, -1, "(91)ABCDEF\\)GH", "", 0, "(91)ABCDEF\\)GH", "" }, /* Escaped parens now kept in HRT */
- /* 36*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF\\)GH", "", 0, "(91)ABCDEF\\)GH", "91ABCDEF)GH" },
- /* 37*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF\\)GH", "", 0, "(91)ABCDEF\\)GH", "91ABCDEF)GH" },
- /* 38*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF(GH", "", 0, "(91)ABCDEF(GH", "" },
- /* 39*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF(GH", "", 0, "(91)ABCDEF(GH", "91ABCDEF(GH" },
- /* 40*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDEF\\(GH", "", 0, "(91)ABCDEF\\(GH", "" },
- /* 41*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, -1, "(91)ABCDEF\\(GH", "", 0, "(91)ABCDEF\\(GH", "" },
- /* 42*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF\\(GH", "", 0, "(91)ABCDEF\\(GH", "91ABCDEF(GH" },
- /* 43*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF\\(GH", "", 0, "(91)ABCDEF\\(GH", "91ABCDEF(GH" },
- /* 44*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "[21]12345", 0, "(01)12345678901234(20)12", "" },
- /* 45*/ { BARCODE_GS1_128_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "[21]12345", ZINT_WARN_NONCOMPLIANT, "(01)12345678901234(20)12", "01123456789012342012|2112345" },
- /* 46*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901231[20]12", "[21]12345", 0, "(01)12345678901231(20)12", "" },
- /* 47*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901231[10]12[20]AB", "[21]12345", ZINT_WARN_NONCOMPLIANT, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
- /* 48*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, -1, "[01]12345678901231[10]12[20]AB", "[21]12345", 0, "(01)12345678901231(10)12(20)AB", "" },
- /* 49*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901231[10]AB[20]12", "[21]12345", 0, "(01)12345678901231(10)AB(20)12", "" },
- /* 50*/ { BARCODE_GS1_128_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12", "[21]12345", 0, "(01)12345678901231(10)AB(20)12", "011234567890123110AB\0352012|2112345" },
- /* 51*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901231[10]AB[20]12", "[30]1234567A", ZINT_WARN_NONCOMPLIANT, "(01)12345678901231(10)AB(20)12", "" },
- /* 52*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, -1, "[01]12345678901231[10]AB[20]12", "[30]1234567A", 0, "(01)12345678901231(10)AB(20)12", "" },
- /* 53*/ { BARCODE_EAN14, -1, -1, "1234567890123", "", 0, "(01)12345678901231", "" },
- /* 54*/ { BARCODE_EAN14, -1, BARCODE_CONTENT_SEGS, "1234567890123", "", 0, "(01)12345678901231", "0112345678901231" },
- /* 55*/ { BARCODE_EAN14, -1, -1, "1234", "", 0, "(01)00000000012348", "" },
- /* 56*/ { BARCODE_EAN14, -1, BARCODE_CONTENT_SEGS, "1234", "", 0, "(01)00000000012348", "0100000000012348" },
- /* 57*/ { BARCODE_EAN14, -1, -1, "12345", "", 0, "(01)00000000123457", "" },
- /* 58*/ { BARCODE_EAN14, -1, -1, "12340", "", 0, "(01)00000000123402", "" },
- /* 59*/ { BARCODE_NVE18, -1, -1, "12345678901234567", "", 0, "(00)123456789012345675", "" },
- /* 60*/ { BARCODE_NVE18, -1, BARCODE_CONTENT_SEGS, "12345678901234567", "", 0, "(00)123456789012345675", "00123456789012345675" },
- /* 61*/ { BARCODE_NVE18, -1, -1, "1234", "", 0, "(00)000000000000012348", "" },
- /* 62*/ { BARCODE_NVE18, -1, BARCODE_CONTENT_SEGS, "1234", "", 0, "(00)000000000000012348", "00000000000000012348" },
- /* 63*/ { BARCODE_NVE18, -1, -1, "12345", "", 0, "(00)000000000000123457", "" },
- /* 64*/ { BARCODE_NVE18, -1, -1, "12340", "", 0, "(00)000000000000123402", "" },
- /* 65*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
- /* 66*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "", 0, "(01)12345678901234(20)12", "" },
- /* 67*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, "(01)12345678901234(20)12", "01123456789012342012" },
- /* 68*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[20]12", "", 0, "(01)12345678901231(20)12", "" },
- /* 69*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[20]12", "", 0, "(01)12345678901231(20)12", "01123456789012312012" },
- /* 70*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]12[20]AB", "", ZINT_WARN_NONCOMPLIANT, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
- /* 71*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, "[01]12345678901231[10]12[20]AB", "", 0, "(01)12345678901231(10)12(20)AB", "" },
- /* 72*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]12[20]AB", "", ZINT_WARN_NONCOMPLIANT, "(01)12345678901231(10)12(20)AB", "01123456789012311012\03520AB" },
- /* 73*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12", "", 0, "(01)12345678901231(10)AB(20)12", "" },
- /* 74*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12", "", 0, "(01)12345678901231(10)AB(20)12", "011234567890123110AB\0352012" },
- /* 75*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC(2012", "", 0, "(01)12345678901231(10)AB(20)12(90)ABC(2012", "" },
- /* 76*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC(2012", "", 0, "(01)12345678901231(10)AB(20)12(90)ABC(2012", "011234567890123110AB\035201290ABC(2012" },
- /* 77*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "", 0, "(01)12345678901231(10)AB(20)12(90)ABC20)12", "" },
- /* 78*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "", 0, "(01)12345678901231(10)AB(20)12(90)ABC20)12", "011234567890123110AB\035201290ABC20)12" },
- /* 79*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC(20)12", "", 0, "(01)12345678901231(10)AB(20)12(90)ABC(20)12", "" },
- /* 80*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC(20)12", "", 0, "(01)12345678901231(10)AB(20)12(90)ABC(20)12", "011234567890123110AB\035201290ABC(20)12" },
- /* 81*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC(20)12[91]12(", "", 0, "(01)12345678901231(10)AB(20)12(90)ABC(20)12(91)12(" , ""},
- /* 82*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC(20)12[91]12(", "", 0, "(01)12345678901231(10)AB(20)12(90)ABC(20)12(91)12(" , "011234567890123110AB\035201290ABC(20)12\0359112(" },
- /* 83*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[01]12345678901234", "[21]12345", ZINT_WARN_NONCOMPLIANT, "(01)12345678901234", "" },
- /* 84*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, -1, "[01]12345678901234", "[21]12345", 0, "(01)12345678901234", "" },
- /* 85*/ { BARCODE_DBAR_EXP_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234", "[21]12345", ZINT_WARN_NONCOMPLIANT, "(01)12345678901234", "0112345678901234|2112345" },
- /* 86*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[01]12345678901231", "[21]12345", 0, "(01)12345678901231", "" },
- /* 87*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[01]12345678901231[20]12[21]12345", "[21]12345", 0, "(01)12345678901231(20)12(21)12345", "" },
- /* 88*/ { BARCODE_DBAR_EXP_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[20]12[21]12345", "[21]12345", 0, "(01)12345678901231(20)12(21)12345", "011234567890123120122112345|2112345" },
- /* 89*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[01]12345678901231[10](", "[21]123()", 0, "(01)12345678901231(10)(", "" },
- /* 90*/ { BARCODE_DBAR_EXP_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10](", "[21]123()", 0, "(01)12345678901231(10)(", "011234567890123110(|21123()" },
- /* 91*/ { BARCODE_DBAR_EXP_CC, GS1PARENS_MODE, -1, "(01)12345678901231(10)\\(", "(21)123\\(\\)", 0, "(01)12345678901231(10)\\(", "" }, /* Escaped parens now work without ESCAPE_MODE & now kept in HRT */
- /* 92*/ { BARCODE_DBAR_EXP_CC, ESCAPE_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)\\(", "(21)123\\(\\)", 0, "(01)12345678901231(10)\\(", "" },
- /* 93*/ { BARCODE_DBAR_EXP_CC, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)\\(", "(21)123\\(\\)", 0, "(01)12345678901231(10)\\(", "011234567890123110(|21123()" },
- /* 94*/ { BARCODE_DBAR_EXP_CC, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)\\(", "(21)123\\(\\)", 0, "(01)12345678901231(10)\\(", "011234567890123110(|21123()" },
- /* 95*/ { BARCODE_DBAR_EXPSTK, -1, -1, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, "", "" },
- /* 96*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "", 0, "", "" },
- /* 97*/ { BARCODE_DBAR_EXPSTK, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, "", "01123456789012342012" },
- /* 98*/ { BARCODE_DBAR_EXPSTK, -1, -1, "[01]12345678901231[20]12", "", 0, "", "" },
- /* 99*/ { BARCODE_DBAR_EXPSTK, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "", 0, "", "" },
- /*100*/ { BARCODE_DBAR_EXPSTK, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "", 0, "", "011234567890123110AB\035201290ABC20)12" },
- /*101*/ { BARCODE_DBAR_EXPSTK, GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "", 0, "", "" },
- /*102*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "", 0, "", "" },
- /*103*/ { BARCODE_DBAR_EXPSTK, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "", 0, "", "011234567890123110AB\035201290ABC20)12" },
- /*104*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "", 0, "", "011234567890123110AB\035201290ABC20)12" },
- /*105*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, "[01]12345678901234[20]12", "[21]12345", ZINT_WARN_NONCOMPLIANT, "" , ""},
- /*106*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "[21]12345", 0, "", "" },
- /*107*/ { BARCODE_DBAR_EXPSTK_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "[21]12345", ZINT_WARN_NONCOMPLIANT, "", "01123456789012342012|2112345" },
- /*108*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, "[01]12345678901231[20]12", "[21]12345", 0, "", "" },
- /*109*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "[21]12345", 0, "", "" },
- /*110*/ { BARCODE_DBAR_EXPSTK_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "[21]12345", 0, "", "011234567890123110AB\035201290ABC20)12|2112345" },
- /*111*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, "", "" },
- /*112*/ { BARCODE_DBAR_EXPSTK_CC, ESCAPE_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, "", "" },
- /*113*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, "", "" },
- /*114*/ { BARCODE_DBAR_EXPSTK_CC, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, "", "011234567890123110AB\035201290ABC20)12|2112345" },
- /*115*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, "", "011234567890123110AB\035201290ABC20)12|2112345" },
+ /* 0*/ { BARCODE_GS1_128, -1, -1, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /* 1*/ { BARCODE_GS1_128, -1, -1, "^01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /* 2*/ { BARCODE_GS1_128, -1, -1, "^0112345678901234^2012", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /* 3*/ { BARCODE_GS1_128, GS1RAW_MODE, -1, "01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /* 4*/ { BARCODE_GS1_128, GS1RAW_MODE, -1, "\03501123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /* 5*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "", 0, 0, "(01)12345678901234(20)12", "" },
+ /* 6*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, -1, "^01123456789012342012", "", 0, 1, "(01)12345678901234(20)12", "" },
+ /* 7*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, -1, "01123456789012342012", "", 0, 1, "(01)12345678901234(20)12", "" },
+ /* 8*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901234(20)12", "01123456789012342012" },
+ /* 9*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "^01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234(20)12", "01123456789012342012" },
+ /* 10*/ { BARCODE_GS1_128, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234(20)12", "01123456789012342012" },
+ /* 11*/ { BARCODE_GS1_128, -1, -1, "[01]12345678901231[20]12", "", 0, 0, "(01)12345678901231(20)12", "" },
+ /* 12*/ { BARCODE_GS1_128, -1, -1, "[01]12345678901231[10]12[20]AB", "", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
+ /* 13*/ { BARCODE_GS1_128, -1, -1, "^01123456789012311012^20AB", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
+ /* 14*/ { BARCODE_GS1_128, GS1RAW_MODE, -1, "01123456789012311012\03520AB", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
+ /* 15*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, -1, "[01]12345678901231[10]12[20]AB", "", 0, 0, "(01)12345678901231(10)12(20)AB", "" },
+ /* 16*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, -1, "^01123456789012311012^20AB", "", 0, 1, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
+ /* 17*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, -1, "^01123456789012311012^20AB", "", 0, 1, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
+ /* 18*/ { BARCODE_GS1_128, -1, -1, "[01]12345678901231[10]AB[20]12", "", 0, 0, "(01)12345678901231(10)AB(20)12", "" },
+ /* 19*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF]GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDEF]GH", "" }, /* Invalid CSET 82 character */
+ /* 20*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, -1, "[91]ABCDEF]GH", "", 0, 0, "(91)ABCDEF]GH", "" },
+ /* 21*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF]GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDEF]GH", "91ABCDEF]GH" },
+ /* 22*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF)GH", "", 0, 0, "(91)ABCDEF)GH", "" },
+ /* 23*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF)GH", "", 0, 0, "(91)ABCDEF)GH", "91ABCDEF)GH" },
+ /* 24*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF(GH", "", 0, 0, "(91)ABCDEF(GH", "" },
+ /* 25*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF(GH", "", 0, 0, "(91)ABCDEF(GH", "91ABCDEF(GH" },
+ /* 26*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDE(20)12", "", 0, 0, "(91)ABCDE(20)12", "" },
+ /* 27*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDE(20)12", "", 0, 0, "(91)ABCDE(20)12", "91ABCDE(20)12" },
+ /* 28*/ { BARCODE_GS1_128, -1, -1, "[90]1234[91]ABCDE(20)12", "", 0, 0, "(90)1234(91)ABCDE(20)12", "" },
+ /* 29*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[90]1234[91]ABCDE(20)12", "", 0, 0, "(90)1234(91)ABCDE(20)12", "901234\03591ABCDE(20)12" },
+ /* 30*/ { BARCODE_GS1_128, -1, -1, "[90]1234[91]ABCDE(20)12[20]12", "", 0, 0, "(90)1234(91)ABCDE(20)12(20)12", "" },
+ /* 31*/ { BARCODE_GS1_128, -1, -1, "^901234^91ABCDE(20)12^2012", "", 0, 1, "(90)1234(91)ABCDE(20)12(20)12", "" },
+ /* 32*/ { BARCODE_GS1_128, GS1RAW_MODE, -1, "901234\03591ABCDE(20)12\0352012", "", 0, 1, "(90)1234(91)ABCDE(20)12(20)12", "" },
+ /* 33*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[90]1234[91]ABCDE(20)12[20]12", "", 0, 0, "(90)1234(91)ABCDE(20)12(20)12", "901234\03591ABCDE(20)12\0352012" },
+ /* 34*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "^901234^91ABCDE(20)12^2012", "", 0, 1, "(90)1234(91)ABCDE(20)12(20)12", "901234\03591ABCDE(20)12\0352012" },
+ /* 35*/ { BARCODE_GS1_128, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "901234\03591ABCDE(20)12\0352012", "", 0, 1, "(90)1234(91)ABCDE(20)12(20)12", "901234\03591ABCDE(20)12\0352012" },
+ /* 36*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDEF]GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDEF]GH", "" }, /* Invalid CSET 82 character */
+ /* 37*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(91)ABCDEF]GH", "", 0, 0, "(91)ABCDEF]GH", "" },
+ /* 38*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF]GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDEF]GH", "91ABCDEF]GH" },
+ /* 39*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDEF)GH", "", 0, 0, "(91)ABCDEF)GH", "" },
+ /* 40*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF)GH", "", 0, 0, "(91)ABCDEF)GH", "91ABCDEF)GH" },
+ /* 41*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDE[FGH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDE[FGH", "" }, /* Invalid CSET 82 character */
+ /* 42*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(91)ABCDE[FGH", "", 0, 0, "(91)ABCDE[FGH", "" },
+ /* 43*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDE[FGH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDE[FGH", "91ABCDE[FGH" },
+ /* 44*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDE[92]GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDE[92]GH", "" }, /* Invalid CSET 82 character */
+ /* 45*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(91)ABCDE[92]GH", "", 0, 0, "(91)ABCDE[92]GH", "" },
+ /* 46*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDE[92]GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDE[92]GH", "91ABCDE[92]GH" },
+ /* 47*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901234[20]12", "[21]12345", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /* 48*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF)GH", "", 0, 0, "(91)ABCDEF)GH", "" },
+ /* 49*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF)GH", "", 0, 0, "(91)ABCDEF)GH", "91ABCDEF)GH" },
+ /* 50*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDEF\\)GH", "", 0, 0, "(91)ABCDEF\\)GH", "" }, /* Escaped parens now work without ESCAPE_MODE & now kept in HRT */
+ /* 51*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, -1, "(91)ABCDEF\\)GH", "", 0, 0, "(91)ABCDEF\\)GH", "" }, /* Escaped parens now kept in HRT */
+ /* 52*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF\\)GH", "", 0, 0, "(91)ABCDEF\\)GH", "91ABCDEF)GH" },
+ /* 53*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF\\)GH", "", 0, 0, "(91)ABCDEF\\)GH", "91ABCDEF)GH" },
+ /* 54*/ { BARCODE_GS1_128, -1, -1, "[91]ABCDEF(GH", "", 0, 0, "(91)ABCDEF(GH", "" },
+ /* 55*/ { BARCODE_GS1_128, -1, -1, "^91ABCDEF(GH", "", 0, 1, "(91)ABCDEF(GH", "" },
+ /* 56*/ { BARCODE_GS1_128, GS1RAW_MODE, -1, "91ABCDEF(GH", "", 0, 1, "(91)ABCDEF(GH", "" },
+ /* 57*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "[91]ABCDEF(GH", "", 0, 0, "(91)ABCDEF(GH", "91ABCDEF(GH" },
+ /* 58*/ { BARCODE_GS1_128, -1, BARCODE_CONTENT_SEGS, "^91ABCDEF(GH", "", 0, 1, "(91)ABCDEF(GH", "91ABCDEF(GH" },
+ /* 59*/ { BARCODE_GS1_128, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "91ABCDEF(GH", "", 0, 1, "(91)ABCDEF(GH", "91ABCDEF(GH" },
+ /* 60*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "(91)ABCDEF\\(GH", "", 0, 0, "(91)ABCDEF\\(GH", "" }, /* Escaped parens now work without ESCAPE_MODE & now kept in HRT */
+ /* 61*/ { BARCODE_GS1_128, GS1PARENS_MODE, -1, "^91ABCDEF\\(GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDEF\\(GH", "" }, /* Escaped parens in caret mode are encoded as "\(", & "\" invalid CSET 82 character */
+ /* 62*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1RAW_MODE, -1, "91ABCDEF\\(GH", "", ZINT_WARN_NONCOMPLIANT, 1, "(91)ABCDEF\\(GH", "" }, /* Escaped parens in raw mode are encoded as "\(", & "\" invalid CSET 82 character */
+ /* 63*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, -1, "(91)ABCDEF\\(GH", "", 0, 0, "(91)ABCDEF\\(GH", "" },
+ /* 64*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, -1, "^91ABCDEF\\(GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDEF\\(GH", "" }, /* Invalid CSET 82 character */
+ /* 65*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, "91ABCDEF\\(GH", "", ZINT_WARN_NONCOMPLIANT, 1, "(91)ABCDEF\\(GH", "" }, /* Invalid CSET 82 character */
+ /* 66*/ { BARCODE_GS1_128, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF\\(GH", "", 0, 0, "(91)ABCDEF\\(GH", "91ABCDEF(GH" },
+ /* 67*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(91)ABCDEF\\(GH", "", 0, 0, "(91)ABCDEF\\(GH", "91ABCDEF(GH" }, /* "(" encoded */
+ /* 68*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "^91ABCDEF\\(GH", "", ZINT_WARN_NONCOMPLIANT, 0, "(91)ABCDEF\\(GH", "91ABCDEF\\(GH" }, /* Invalid CSET 82 character */
+ /* 69*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, BARCODE_CONTENT_SEGS, "91ABCDEF\\(GH", "", ZINT_WARN_NONCOMPLIANT, 1, "(91)ABCDEF\\(GH", "91ABCDEF\\(GH" }, /* "\(" encoded */
+ /* 70*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "[21]12345", 0, 0, "(01)12345678901234(20)12", "" },
+ /* 71*/ { BARCODE_GS1_128_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "[21]12345", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901234(20)12", "01123456789012342012|2112345" }, /* Incorrect check digit */
+ /* 72*/ { BARCODE_GS1_128_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[20]12", "[21]12345", 0, 0, "(01)12345678901231(20)12", "01123456789012312012|2112345" },
+ /* 73*/ { BARCODE_GS1_128_CC, -1, BARCODE_CONTENT_SEGS, "^01123456789012312012", "^2112345", 0, 1, "(01)12345678901231(20)12", "01123456789012312012|2112345" },
+ /* 74*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "01123456789012312012", "2112345", 0, 1, "(01)12345678901231(20)12", "01123456789012312012|2112345" },
+ /* 75*/ { BARCODE_GS1_128_CC, -1, BARCODE_CONTENT_SEGS, "^01123456789012312012", "[21]12345", 0, 1, "(01)12345678901231(20)12", "01123456789012312012|2112345" }, /* Can have caret linear, bracket CC */
+ /* 76*/ { BARCODE_GS1_128_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[20]12", "^2112345", 0, 1, "(01)12345678901231(20)12", "01123456789012312012|2112345" }, /* Can have bracket linear, caret CC */
+ /* 77*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "01123456789012312012", "[21]12345", 0, 1, "(01)12345678901231(20)12", "01123456789012312012|2112345" }, /* Can have raw linear, bracket CC */
+ /* 78*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "[01]12345678901231[20]12", "2112345", 0, 1, "(01)12345678901231(20)12", "01123456789012312012|2112345" }, /* Can have bracket linear, raw CC */
+ /* 79*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "01123456789012312012", "^2112345", 0, 1, "(01)12345678901231(20)12", "01123456789012312012|2112345" }, /* Can have raw linear, caret CC */
+ /* 80*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "^01123456789012312012", "2112345", 0, 1, "(01)12345678901231(20)12", "01123456789012312012|2112345" }, /* Can have caret linear, raw CC */
+ /* 81*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901231[20]12", "[21]12345", 0, 0, "(01)12345678901231(20)12", "" },
+ /* 82*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901231[10]12[20]AB", "[21]12345", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
+ /* 83*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, -1, "[01]12345678901231[10]12[20]AB", "[21]12345", 0, 0, "(01)12345678901231(10)12(20)AB", "" },
+ /* 84*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901231[10]AB[20]12", "[21]12345", 0, 0, "(01)12345678901231(10)AB(20)12", "" },
+ /* 85*/ { BARCODE_GS1_128_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12", "[21]12345", 0, 0, "(01)12345678901231(10)AB(20)12", "011234567890123110AB\0352012|2112345" },
+ /* 86*/ { BARCODE_GS1_128_CC, -1, -1, "[01]12345678901231[10]AB[20]12", "[30]1234567A", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901231(10)AB(20)12", "" },
+ /* 87*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, -1, "[01]12345678901231[10]AB[20]12", "[30]1234567A", 0, 0, "(01)12345678901231(10)AB(20)12", "" },
+ /* 88*/ { BARCODE_EAN14, -1, -1, "1234567890123", "", 0, 0, "(01)12345678901231", "" },
+ /* 89*/ { BARCODE_EAN14, -1, BARCODE_CONTENT_SEGS, "1234567890123", "", 0, 0, "(01)12345678901231", "0112345678901231" },
+ /* 90*/ { BARCODE_EAN14, -1, -1, "1234", "", 0, 0, "(01)00000000012348", "" },
+ /* 91*/ { BARCODE_EAN14, -1, BARCODE_CONTENT_SEGS, "1234", "", 0, 0, "(01)00000000012348", "0100000000012348" },
+ /* 92*/ { BARCODE_EAN14, -1, -1, "12345", "", 0, 0, "(01)00000000123457", "" },
+ /* 93*/ { BARCODE_EAN14, -1, -1, "12340", "", 0, 0, "(01)00000000123402", "" },
+ /* 94*/ { BARCODE_NVE18, -1, -1, "12345678901234567", "", 0, 0, "(00)123456789012345675", "" },
+ /* 95*/ { BARCODE_NVE18, -1, BARCODE_CONTENT_SEGS, "12345678901234567", "", 0, 0, "(00)123456789012345675", "00123456789012345675" },
+ /* 96*/ { BARCODE_NVE18, -1, -1, "1234", "", 0, 0, "(00)000000000000012348", "" },
+ /* 97*/ { BARCODE_NVE18, -1, BARCODE_CONTENT_SEGS, "1234", "", 0, 0, "(00)000000000000012348", "00000000000000012348" },
+ /* 98*/ { BARCODE_NVE18, -1, -1, "12345", "", 0, 0, "(00)000000000000123457", "" },
+ /* 99*/ { BARCODE_NVE18, -1, -1, "12340", "", 0, 0, "(00)000000000000123402", "" },
+ /*100*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /*101*/ { BARCODE_DBAR_EXP, -1, -1, "^01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /*102*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, -1, "01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234(20)12", "" }, /* Incorrect check digit */
+ /*103*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "", 0, 0, "(01)12345678901234(20)12", "" },
+ /*104*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, "^01123456789012342012", "", 0, 1, "(01)12345678901234(20)12", "" },
+ /*105*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE | GS1RAW_MODE, -1, "01123456789012342012", "", 0, 1, "(01)12345678901234(20)12", "" },
+ /*106*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901234(20)12", "01123456789012342012" },
+ /*107*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[20]12", "", 0, 0, "(01)12345678901231(20)12", "" },
+ /*108*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[20]12", "", 0, 0, "(01)12345678901231(20)12", "01123456789012312012" },
+ /*109*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]12[20]AB", "", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901231(10)12(20)AB", "" }, /* AI (20) should be 2 nos. */
+ /*110*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, "[01]12345678901231[10]12[20]AB", "", 0, 0, "(01)12345678901231(10)12(20)AB", "" },
+ /*111*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]12[20]AB", "", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901231(10)12(20)AB", "01123456789012311012\03520AB" },
+ /*112*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12", "", 0, 0, "(01)12345678901231(10)AB(20)12", "" },
+ /*113*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12", "", 0, 0, "(01)12345678901231(10)AB(20)12", "011234567890123110AB\0352012" },
+ /*114*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC(2012", "", 0, 0, "(01)12345678901231(10)AB(20)12(90)ABC(2012", "" },
+ /*115*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC(2012", "", 0, 0, "(01)12345678901231(10)AB(20)12(90)ABC(2012", "011234567890123110AB\035201290ABC(2012" },
+ /*116*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "", 0, 0, "(01)12345678901231(10)AB(20)12(90)ABC20)12", "" },
+ /*117*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "", 0, 0, "(01)12345678901231(10)AB(20)12(90)ABC20)12", "011234567890123110AB\035201290ABC20)12" },
+ /*118*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC(20)12", "", 0, 0, "(01)12345678901231(10)AB(20)12(90)ABC(20)12", "" },
+ /*119*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC(20)12", "", 0, 0, "(01)12345678901231(10)AB(20)12(90)ABC(20)12", "011234567890123110AB\035201290ABC(20)12" },
+ /*120*/ { BARCODE_DBAR_EXP, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC(20)12[91]12(", "", 0, 0, "(01)12345678901231(10)AB(20)12(90)ABC(20)12(91)12(" , ""},
+ /*121*/ { BARCODE_DBAR_EXP, -1, -1, "^011234567890123110AB^201290ABC(20)12^9112(", "", 0, 1, "(01)12345678901231(10)AB(20)12(90)ABC(20)12(91)12(" , ""},
+ /*122*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, -1, "011234567890123110AB\035201290ABC(20)12\0359112(", "", 0, 1, "(01)12345678901231(10)AB(20)12(90)ABC(20)12(91)12(" , ""},
+ /*123*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC(20)12[91]12(", "", 0, 0, "(01)12345678901231(10)AB(20)12(90)ABC(20)12(91)12(" , "011234567890123110AB\035201290ABC(20)12\0359112(" },
+ /*124*/ { BARCODE_DBAR_EXP, -1, BARCODE_CONTENT_SEGS, "^011234567890123110AB^201290ABC(20)12^9112(", "", 0, 1, "(01)12345678901231(10)AB(20)12(90)ABC(20)12(91)12(" , "011234567890123110AB\035201290ABC(20)12\0359112(" },
+ /*125*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "011234567890123110AB\035201290ABC(20)12\0359112(", "", 0, 1, "(01)12345678901231(10)AB(20)12(90)ABC(20)12(91)12(" , "011234567890123110AB\035201290ABC(20)12\0359112(" },
+ /*126*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[01]12345678901234", "[21]12345", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901234", "" },
+ /*127*/ { BARCODE_DBAR_EXP_CC, -1, -1, "^0112345678901234", "^2112345", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234", "" },
+ /*128*/ { BARCODE_DBAR_EXP_CC, GS1RAW_MODE, -1, "0112345678901234", "2112345", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234", "" },
+ /*129*/ { BARCODE_DBAR_EXP_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234", "[21]12345", ZINT_WARN_NONCOMPLIANT, 0, "(01)12345678901234", "0112345678901234|2112345" },
+ /*130*/ { BARCODE_DBAR_EXP_CC, -1, BARCODE_CONTENT_SEGS, "^0112345678901234", "^2112345", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234", "0112345678901234|2112345" },
+ /*131*/ { BARCODE_DBAR_EXP_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "0112345678901234", "2112345", ZINT_WARN_NONCOMPLIANT, 1, "(01)12345678901234", "0112345678901234|2112345" },
+ /*132*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, -1, "[01]12345678901234", "[21]12345", 0, 0, "(01)12345678901234", "" },
+ /*133*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, -1, "^0112345678901234", "^2112345", 0, 1, "(01)12345678901234", "" },
+ /*134*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE | GS1RAW_MODE, -1, "0112345678901234", "2112345", 0, 1, "(01)12345678901234", "" },
+ /*135*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[01]12345678901231", "[21]12345", 0, 0, "(01)12345678901231", "" },
+ /*136*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[01]12345678901231[20]12[21]12345", "[21]12345", 0, 0, "(01)12345678901231(20)12(21)12345", "" },
+ /*137*/ { BARCODE_DBAR_EXP_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[20]12[21]12345", "[21]12345", 0, 0, "(01)12345678901231(20)12(21)12345", "011234567890123120122112345|2112345" },
+ /*138*/ { BARCODE_DBAR_EXP_CC, -1, -1, "[01]12345678901231[10](", "[21]123()", 0, 0, "(01)12345678901231(10)(", "" },
+ /*139*/ { BARCODE_DBAR_EXP_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10](", "[21]123()", 0, 0, "(01)12345678901231(10)(", "011234567890123110(|21123()" },
+ /*140*/ { BARCODE_DBAR_EXP_CC, GS1PARENS_MODE, -1, "(01)12345678901231(10)\\(", "(21)123\\(\\)", 0, 0, "(01)12345678901231(10)\\(", "" }, /* Escaped parens now work without ESCAPE_MODE & now kept in HRT */
+ /*141*/ { BARCODE_DBAR_EXP_CC, ESCAPE_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)\\(", "(21)123\\(\\)", 0, 0, "(01)12345678901231(10)\\(", "" },
+ /*142*/ { BARCODE_DBAR_EXP_CC, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)\\(", "(21)123\\(\\)", 0, 0, "(01)12345678901231(10)\\(", "011234567890123110(|21123()" },
+ /*143*/ { BARCODE_DBAR_EXP_CC, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)\\(", "(21)123\\(\\)", 0, 0, "(01)12345678901231(10)\\(", "011234567890123110(|21123()" },
+ /*144*/ { BARCODE_DBAR_EXPSTK, -1, -1, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, 0, "", "" },
+ /*145*/ { BARCODE_DBAR_EXPSTK, -1, -1, "^01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "", "" },
+ /*146*/ { BARCODE_DBAR_EXPSTK, GS1RAW_MODE, -1, "01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "", "" },
+ /*147*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "", 0, 0, "", "" },
+ /*148*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, "^01123456789012342012", "", 0, 1, "", "" },
+ /*149*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE | GS1RAW_MODE, -1, "01123456789012342012", "", 0, 1, "", "" },
+ /*150*/ { BARCODE_DBAR_EXPSTK, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "", ZINT_WARN_NONCOMPLIANT, 0, "", "01123456789012342012" },
+ /*151*/ { BARCODE_DBAR_EXPSTK, -1, BARCODE_CONTENT_SEGS, "^01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "", "01123456789012342012" },
+ /*152*/ { BARCODE_DBAR_EXPSTK, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "01123456789012342012", "", ZINT_WARN_NONCOMPLIANT, 1, "", "01123456789012342012" },
+ /*153*/ { BARCODE_DBAR_EXPSTK, -1, -1, "[01]12345678901231[20]12", "", 0, 0, "", "" },
+ /*154*/ { BARCODE_DBAR_EXPSTK, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "", 0, 0, "", "" },
+ /*155*/ { BARCODE_DBAR_EXPSTK, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "", 0, 0, "", "011234567890123110AB\035201290ABC20)12" },
+ /*156*/ { BARCODE_DBAR_EXPSTK, GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "", 0, 0, "", "" },
+ /*157*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "", 0, 0, "", "" },
+ /*158*/ { BARCODE_DBAR_EXPSTK, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "", 0, 0, "", "011234567890123110AB\035201290ABC20)12" },
+ /*159*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "", 0, 0, "", "011234567890123110AB\035201290ABC20)12" },
+ /*160*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, "[01]12345678901234[20]12", "[21]12345", ZINT_WARN_NONCOMPLIANT, 0, "" , ""},
+ /*161*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, "^01123456789012342012", "^2112345", ZINT_WARN_NONCOMPLIANT, 1, "" , ""},
+ /*162*/ { BARCODE_DBAR_EXPSTK_CC, GS1RAW_MODE, -1, "01123456789012342012", "2112345", ZINT_WARN_NONCOMPLIANT, 1, "" , ""},
+ /*163*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, -1, "[01]12345678901234[20]12", "[21]12345", 0, 0, "", "" },
+ /*164*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, -1, "^01123456789012342012", "^2112345", 0, 1, "", "" },
+ /*165*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE | GS1RAW_MODE, -1, "01123456789012342012", "2112345", 0, 1, "", "" },
+ /*166*/ { BARCODE_DBAR_EXPSTK_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901234[20]12", "[21]12345", ZINT_WARN_NONCOMPLIANT, 0, "", "01123456789012342012|2112345" },
+ /*167*/ { BARCODE_DBAR_EXPSTK_CC, -1, BARCODE_CONTENT_SEGS, "^01123456789012342012", "^2112345", ZINT_WARN_NONCOMPLIANT, 1, "", "01123456789012342012|2112345" },
+ /*168*/ { BARCODE_DBAR_EXPSTK_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "01123456789012342012", "2112345", ZINT_WARN_NONCOMPLIANT, 1, "", "01123456789012342012|2112345" },
+ /*169*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, "[01]12345678901231[20]12", "[21]12345", 0, 0, "", "" },
+ /*170*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "[21]12345", 0, 0, "", "" },
+ /*171*/ { BARCODE_DBAR_EXPSTK_CC, -1, BARCODE_CONTENT_SEGS, "[01]12345678901231[10]AB[20]12[90]ABC20)12", "[21]12345", 0, 0, "", "011234567890123110AB\035201290ABC20)12|2112345" },
+ /*172*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, 0, "", "" },
+ /*173*/ { BARCODE_DBAR_EXPSTK_CC, ESCAPE_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, 0, "", "" },
+ /*174*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, -1, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, 0, "", "" },
+ /*175*/ { BARCODE_DBAR_EXPSTK_CC, ESCAPE_MODE | GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, 0, "", "011234567890123110AB\035201290ABC20)12|2112345" },
+ /*176*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, BARCODE_CONTENT_SEGS, "(01)12345678901231(10)AB(20)12(90)ABC20\\)12", "(21)12345", 0, 0, "", "011234567890123110AB\035201290ABC20)12|2112345" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
struct zint_symbol *symbol = NULL;
int expected_length, expected_content_length;
+ struct zint_symbol *previous_symbol = NULL;
+
const char *text;
testStartSymbol(p_ctx->func_name, &symbol);
@@ -509,9 +732,13 @@ static void test_hrt(const testCtx *const p_ctx) {
ret = ZBarcode_Encode(symbol, TCU(text), length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
+ if (p_ctx->index == -1 && data[i].compare_previous) {
+ int cmp_ret = testUtilSymbolCmp(symbol, previous_symbol);
+ assert_zero(cmp_ret, "i:%d testUtilSymbolCmp cmp_ret %d != 0\n", i, cmp_ret);
+ }
- assert_equal(symbol->text_length, expected_length, "i:%d text_length %d != expected_length %d\n",
- i, symbol->text_length, expected_length);
+ assert_equal(symbol->text_length, expected_length, "i:%d text_length %d != expected_length %d (%s)\n",
+ i, symbol->text_length, expected_length, symbol->text);
assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n",
i, symbol->text, data[i].expected);
if (symbol->output_options & BARCODE_CONTENT_SEGS) {
@@ -528,8 +755,10 @@ static void test_hrt(const testCtx *const p_ctx) {
assert_null(symbol->content_segs, "i:%d content_segs not NULL\n", i);
}
- ZBarcode_Delete(symbol);
+ ZBarcode_Delete(previous_symbol);
+ previous_symbol = symbol;
}
+ ZBarcode_Delete(previous_symbol);
testFinish();
}
@@ -539,1062 +768,1101 @@ static void test_hrt(const testCtx *const p_ctx) {
static void test_gs1_verify(const testCtx *const p_ctx) {
struct item {
+ int input_mode;
const char *data;
int ret;
const char *expected;
const char *expected_errtxt;
+ const char *comment;
};
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
- /* 0*/ { "", ZINT_ERROR_INVALID_DATA, "", "252: Data does not start with an AI" },
- /* 1*/ { "[", ZINT_ERROR_INVALID_DATA, "", "253: Malformed AI in input (brackets don't match)" },
- /* 2*/ { "[]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 1 in input (AI too short)" },
- /* 3*/ { "[1]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 1 in input (AI too short)" },
- /* 4*/ { "[242]123456[1]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 12 in input (AI too short)" },
- /* 5*/ { "[12345]12", ZINT_ERROR_INVALID_DATA, "", "255: Invalid AI at position 1 in input (AI too long)" },
- /* 6*/ { "[20]12[12345]12", ZINT_ERROR_INVALID_DATA, "", "255: Invalid AI at position 7 in input (AI too long)" },
- /* 7*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9999)" },
- /* 8*/ { "[[01]]1234", ZINT_ERROR_INVALID_DATA, "", "254: Found nested brackets in input" },
- /* 9*/ { "[1A]12", ZINT_ERROR_INVALID_DATA, "", "257: Invalid AI at position 1 in input (non-numeric characters in AI)" },
- /* 10*/ { "[10]", ZINT_ERROR_INVALID_DATA, "", "258: Empty data field in input" },
- /* 11*/ { "[90]\012", ZINT_ERROR_INVALID_DATA, "", "251: Control characters are not supported by GS1" },
- /* 12*/ { "[90]\177", ZINT_ERROR_INVALID_DATA, "", "263: DEL characters are not supported by GS1" },
- /* 13*/ { "[90]\200", ZINT_ERROR_INVALID_DATA, "", "250: Extended ASCII characters are not supported by GS1" },
- /* 14*/ { "[00]123456789012345678", ZINT_WARN_NONCOMPLIANT, "00123456789012345678", "261: AI (00) position 18: Bad checksum '8', expected '5'" },
- /* 15*/ { "[00]123456789012345675", 0, "00123456789012345675", "" },
- /* 16*/ { "[00]12345678901234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (00)" },
- /* 17*/ { "[00]1234567890123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (00)" },
- /* 18*/ { "[00]376104250021234569", 0, "00376104250021234569", "" },
- /* 19*/ { "[00]376104250021234568", ZINT_WARN_NONCOMPLIANT, "00376104250021234568", "261: AI (00) position 18: Bad checksum '8', expected '9'" },
- /* 20*/ { "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "0112345678901234", "261: AI (01) position 14: Bad checksum '4', expected '1'" },
- /* 21*/ { "[01]12345678901231", 0, "0112345678901231", "" },
- /* 22*/ { "[01]123456789012345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (01)" },
- /* 23*/ { "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, "0212345678901234", "261: AI (02) position 14: Bad checksum '4', expected '1'" },
- /* 24*/ { "[02]12345678901231", 0, "0212345678901231", "" },
- /* 25*/ { "[02]1234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (02)" },
- /* 26*/ { "[03]12345678901234", ZINT_WARN_NONCOMPLIANT, "0312345678901234", "261: AI (03) position 14: Bad checksum '4', expected '1'" },
- /* 27*/ { "[03]12345678901231", 0, "0312345678901231", "" },
- /* 28*/ { "[03]1234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (03)" },
- /* 29*/ { "[04]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (04)" },
- /* 30*/ { "[05]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (05)" },
- /* 31*/ { "[06]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (06)" },
- /* 32*/ { "[07]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (07)" },
- /* 33*/ { "[08]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (08)" },
- /* 34*/ { "[09]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (09)" },
- /* 35*/ { "[10]ABCD123456", 0, "10ABCD123456", "" },
- /* 36*/ { "[10]123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (10)" },
- /* 37*/ { "[100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (100)" },
- /* 38*/ { "[1000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1000)" },
- /* 39*/ { "[11]990102", 0, "11990102", "" },
- /* 40*/ { "[11]9901023", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (11)" },
- /* 41*/ { "[110]990102", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (110)" },
- /* 42*/ { "[1100]990102", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1100)" },
- /* 43*/ { "[12]000100", 0, "12000100", "" },
- /* 44*/ { "[12]00010", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (12)" },
- /* 45*/ { "[120]000100", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (120)" },
- /* 46*/ { "[1200]000100", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1200)" },
- /* 47*/ { "[13]991301", ZINT_WARN_NONCOMPLIANT, "13991301", "261: AI (13) position 3: Invalid month '13'" },
- /* 48*/ { "[13]991201", 0, "13991201", "" },
- /* 49*/ { "[13]9913011", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (13)" },
- /* 50*/ { "[130]991301", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (130)" },
- /* 51*/ { "[1300]991301", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1300)" },
- /* 52*/ { "[14]991201", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (14)" },
- /* 53*/ { "[140]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (140)" },
- /* 54*/ { "[1400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1400)" },
- /* 55*/ { "[15]021231", 0, "15021231", "" },
- /* 56*/ { "[15]02123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (15)" },
- /* 57*/ { "[150]021231", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (150)" },
- /* 58*/ { "[1500]021231", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1500)" },
- /* 59*/ { "[16]000000", ZINT_WARN_NONCOMPLIANT, "16000000", "261: AI (16) position 3: Invalid month '00'" },
- /* 60*/ { "[16]000100", 0, "16000100", "" },
- /* 61*/ { "[16]00000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (16)" },
- /* 62*/ { "[160]000000", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (160)" },
- /* 63*/ { "[1600]000000", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1600)" },
- /* 64*/ { "[17]010200", 0, "17010200", "" },
- /* 65*/ { "[17]0102000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (17)" },
- /* 66*/ { "[170]010200", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (170)" },
- /* 67*/ { "[1700]010200", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1700)" },
- /* 68*/ { "[18]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (18)" },
- /* 69*/ { "[180]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (180)" },
- /* 70*/ { "[1800]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1800)" },
- /* 71*/ { "[19]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (19)" },
- /* 72*/ { "[190]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (190)" },
- /* 73*/ { "[1900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1900)" },
- /* 74*/ { "[20]12", 0, "2012", "" },
- /* 75*/ { "[20]1", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (20)" },
- /* 76*/ { "[200]12", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (200)" },
- /* 77*/ { "[2000]12", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2000)" },
- /* 78*/ { "[21]A12345678", 0, "21A12345678", "" },
- /* 79*/ { "[21]123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (21)" },
- /* 80*/ { "[210]A12345678", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (210)" },
- /* 81*/ { "[2100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2100)" },
- /* 82*/ { "[22]abcdefghijklmnopqrst", 0, "22abcdefghijklmnopqrst", "" },
- /* 83*/ { "[22]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (22)" },
- /* 84*/ { "[220]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (220)" },
- /* 85*/ { "[2200]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2200)" },
- /* 86*/ { "[23]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (23)" },
- /* 87*/ { "[230]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (230)" },
- /* 88*/ { "[2300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2300)" },
- /* 89*/ { "[235]1abcdefghijklmnopqrstuvwxyz0", 0, "2351abcdefghijklmnopqrstuvwxyz0", "" },
- /* 90*/ { "[235]1abcdefghijklmnopqrstuvwxyz01", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (235)" },
- /* 91*/ { "[24]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (24)" },
- /* 92*/ { "[240]abcdefghijklmnopqrstuvwxyz1234", 0, "240abcdefghijklmnopqrstuvwxyz1234", "" },
- /* 93*/ { "[240]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (240)" },
- /* 94*/ { "[2400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2400)" },
- /* 95*/ { "[241]abcdefghijklmnopqrstuvwxyz1234", 0, "241abcdefghijklmnopqrstuvwxyz1234", "" },
- /* 96*/ { "[241]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (241)" },
- /* 97*/ { "[2410]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2410)" },
- /* 98*/ { "[242]12345", 0, "24212345", "" },
- /* 99*/ { "[242]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (242)" },
- /*100*/ { "[2420]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2420)" },
- /*101*/ { "[243]abcdefghijklmnopqrst", 0, "243abcdefghijklmnopqrst", "" },
- /*102*/ { "[243]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (243)" },
- /*103*/ { "[2430]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2430)" },
- /*104*/ { "[244]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (244)" },
- /*105*/ { "[2440]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2440)" },
- /*106*/ { "[249]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (249)" },
- /*107*/ { "[2490]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2490)" },
- /*108*/ { "[25]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (25)" },
- /*109*/ { "[250]abcdefghijklmnopqrstuvwxyz1234", 0, "250abcdefghijklmnopqrstuvwxyz1234", "" },
- /*110*/ { "[250]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (250)" },
- /*111*/ { "[2500]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2500)" },
- /*112*/ { "[251]abcdefghijklmnopqrstuvwxyz1234", 0, "251abcdefghijklmnopqrstuvwxyz1234", "" },
- /*113*/ { "[251]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (251)" },
- /*114*/ { "[2510]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2510)" },
- /*115*/ { "[252]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (252)" },
- /*116*/ { "[2520]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2520)" },
- /*117*/ { "[253]131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (253)" },
- /*118*/ { "[253]1313131313134", ZINT_WARN_NONCOMPLIANT, "2531313131313134", "261: AI (253) position 13: Bad checksum '4', expected '0'" },
- /*119*/ { "[253]1313131313130", 0, "2531313131313130", "" },
- /*120*/ { "[253]131313131313412345678901234567", ZINT_WARN_NONCOMPLIANT, "253131313131313412345678901234567", "261: AI (253) position 13: Bad checksum '4', expected '0'" },
- /*121*/ { "[253]131313131313012345678901234567", 0, "253131313131313012345678901234567", "" },
- /*122*/ { "[253]1313131313134123456789012345678", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (253)" },
- /*123*/ { "[2530]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2530)" },
- /*124*/ { "[254]abcdefghijklmnopqrst", 0, "254abcdefghijklmnopqrst", "" },
- /*125*/ { "[254]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (254)" },
- /*126*/ { "[2540]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2540)" },
- /*127*/ { "[255]131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (255)" },
- /*128*/ { "[255]1313131313134", ZINT_WARN_NONCOMPLIANT, "2551313131313134", "261: AI (255) position 13: Bad checksum '4', expected '0'" },
- /*129*/ { "[255]1313131313130", 0, "2551313131313130", "" },
- /*130*/ { "[255]1313131313134123456789012", ZINT_WARN_NONCOMPLIANT, "2551313131313134123456789012", "261: AI (255) position 13: Bad checksum '4', expected '0'" },
- /*131*/ { "[255]1313131313130123456789012", 0, "2551313131313130123456789012", "" },
- /*132*/ { "[255]13131313131341234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (255)" },
- /*133*/ { "[2550]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2550)" },
- /*134*/ { "[256]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (256)" },
- /*135*/ { "[2560]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2560)" },
- /*136*/ { "[259]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (259)" },
- /*137*/ { "[2590]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2590)" },
- /*138*/ { "[26]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (26)" },
- /*139*/ { "[260]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (260)" },
- /*140*/ { "[2600]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2600)" },
- /*141*/ { "[27]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (27)" },
- /*142*/ { "[270]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (270)" },
- /*143*/ { "[2700]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2700)" },
- /*144*/ { "[28]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (28)" },
- /*145*/ { "[280]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (280)" },
- /*146*/ { "[2800]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2800)" },
- /*147*/ { "[29]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (29)" },
- /*148*/ { "[290]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (290)" },
- /*149*/ { "[2900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2900)" },
- /*150*/ { "[30]12345678", 0, "3012345678", "" },
- /*151*/ { "[30]123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (30)" },
- /*152*/ { "[300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (300)" },
- /*153*/ { "[3000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3000)" },
- /*154*/ { "[31]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (31)" },
- /*155*/ { "[310]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (310)" },
- /*156*/ { "[3100]123456", 0, "3100123456", "" },
- /*157*/ { "[3100]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3100)" },
- /*158*/ { "[3101]123456", 0, "3101123456", "" },
- /*159*/ { "[3101]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3101)" },
- /*160*/ { "[3105]123456", 0, "3105123456", "" },
- /*161*/ { "[3105]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3105)" },
- /*162*/ { "[3106]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3106)" },
- /*163*/ { "[3109]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3109)" },
- /*164*/ { "[3110]123456", 0, "3110123456", "" },
- /*165*/ { "[3110]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3110)" },
- /*166*/ { "[3115]123456", 0, "3115123456", "" },
- /*167*/ { "[3115]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3115)" },
- /*168*/ { "[3116]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3116)" },
- /*169*/ { "[3119]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3119)" },
- /*170*/ { "[3120]123456", 0, "3120123456", "" },
- /*171*/ { "[3120]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3120)" },
- /*172*/ { "[3125]123456", 0, "3125123456", "" },
- /*173*/ { "[3125]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3125)" },
- /*174*/ { "[3126]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3126)" },
- /*175*/ { "[3129]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3129)" },
- /*176*/ { "[3130]123456", 0, "3130123456", "" },
- /*177*/ { "[3130]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3130)" },
- /*178*/ { "[3135]123456", 0, "3135123456", "" },
- /*179*/ { "[3135]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3135)" },
- /*180*/ { "[3136]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3136)" },
- /*181*/ { "[3139]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3139)" },
- /*182*/ { "[3140]123456", 0, "3140123456", "" },
- /*183*/ { "[3140]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3140)" },
- /*184*/ { "[3145]123456", 0, "3145123456", "" },
- /*185*/ { "[3145]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3145)" },
- /*186*/ { "[3146]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3146)" },
- /*187*/ { "[3149]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3149)" },
- /*188*/ { "[3150]123456", 0, "3150123456", "" },
- /*189*/ { "[3150]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3150)" },
- /*190*/ { "[3155]123456", 0, "3155123456", "" },
- /*191*/ { "[3155]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3155)" },
- /*192*/ { "[3156]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3156)" },
- /*193*/ { "[3159]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3159)" },
- /*194*/ { "[3160]123456", 0, "3160123456", "" },
- /*195*/ { "[3160]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3160)" },
- /*196*/ { "[3165]123456", 0, "3165123456", "" },
- /*197*/ { "[3165]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3165)" },
- /*198*/ { "[3166]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3166)" },
- /*199*/ { "[3169]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3169)" },
- /*200*/ { "[3170]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3170)" },
- /*201*/ { "[3179]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3179)" },
- /*202*/ { "[3180]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3180)" },
- /*203*/ { "[3189]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3189)" },
- /*204*/ { "[3190]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3190)" },
- /*205*/ { "[3199]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3199)" },
- /*206*/ { "[32]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (32)" },
- /*207*/ { "[320]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (320)" },
- /*208*/ { "[3200]123456", 0, "3200123456", "" },
- /*209*/ { "[3200]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3200)" },
- /*210*/ { "[3205]123456", 0, "3205123456", "" },
- /*211*/ { "[3205]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3205)" },
- /*212*/ { "[3206]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3206)" },
- /*213*/ { "[3209]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3209)" },
- /*214*/ { "[3210]123456", 0, "3210123456", "" },
- /*215*/ { "[3210]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3210)" },
- /*216*/ { "[3215]123456", 0, "3215123456", "" },
- /*217*/ { "[3215]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3215)" },
- /*218*/ { "[3216]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3216)" },
- /*219*/ { "[3219]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3219)" },
- /*220*/ { "[3220]123456", 0, "3220123456", "" },
- /*221*/ { "[3220]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3220)" },
- /*222*/ { "[3225]123456", 0, "3225123456", "" },
- /*223*/ { "[3225]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3225)" },
- /*224*/ { "[3229]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3229)" },
- /*225*/ { "[3230]123456", 0, "3230123456", "" },
- /*226*/ { "[3230]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3230)" },
- /*227*/ { "[3235]123456", 0, "3235123456", "" },
- /*228*/ { "[3235]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3235)" },
- /*229*/ { "[3239]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3239)" },
- /*230*/ { "[3240]123456", 0, "3240123456", "" },
- /*231*/ { "[3240]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3240)" },
- /*232*/ { "[3245]123456", 0, "3245123456", "" },
- /*233*/ { "[3245]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3245)" },
- /*234*/ { "[3249]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3249)" },
- /*235*/ { "[3250]123456", 0, "3250123456", "" },
- /*236*/ { "[3250]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3250)" },
- /*237*/ { "[3255]123456", 0, "3255123456", "" },
- /*238*/ { "[3255]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3255)" },
- /*239*/ { "[3259]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3259)" },
- /*240*/ { "[3260]123456", 0, "3260123456", "" },
- /*241*/ { "[3260]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3260)" },
- /*242*/ { "[3265]123456", 0, "3265123456", "" },
- /*243*/ { "[3265]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3265)" },
- /*244*/ { "[3269]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3269)" },
- /*245*/ { "[3270]123456", 0, "3270123456", "" },
- /*246*/ { "[3270]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3270)" },
- /*247*/ { "[3275]123456", 0, "3275123456", "" },
- /*248*/ { "[3275]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3275)" },
- /*249*/ { "[3279]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3279)" },
- /*250*/ { "[3280]123456", 0, "3280123456", "" },
- /*251*/ { "[3280]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3280)" },
- /*252*/ { "[3285]123456", 0, "3285123456", "" },
- /*253*/ { "[3285]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3285)" },
- /*254*/ { "[3289]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3289)" },
- /*255*/ { "[3290]123456", 0, "3290123456", "" },
- /*256*/ { "[3290]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3290)" },
- /*257*/ { "[3295]123456", 0, "3295123456", "" },
- /*258*/ { "[3295]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3295)" },
- /*259*/ { "[3296]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3296)" },
- /*260*/ { "[3299]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3299)" },
- /*261*/ { "[33]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (33)" },
- /*262*/ { "[330]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (330)" },
- /*263*/ { "[3300]123456", 0, "3300123456", "" },
- /*264*/ { "[3300]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3300)" },
- /*265*/ { "[3305]123456", 0, "3305123456", "" },
- /*266*/ { "[3305]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3305)" },
- /*267*/ { "[3306]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3306)" },
- /*268*/ { "[3309]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3309)" },
- /*269*/ { "[3310]123456", 0, "3310123456", "" },
- /*270*/ { "[3310]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3310)" },
- /*271*/ { "[3319]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3319)" },
- /*272*/ { "[3320]123456", 0, "3320123456", "" },
- /*273*/ { "[3320]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3320)" },
- /*274*/ { "[3329]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3329)" },
- /*275*/ { "[3330]123456", 0, "3330123456", "" },
- /*276*/ { "[3330]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3330)" },
- /*277*/ { "[3339]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3339)" },
- /*278*/ { "[3340]123456", 0, "3340123456", "" },
- /*279*/ { "[3340]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3340)" },
- /*280*/ { "[3349]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3349)" },
- /*281*/ { "[3350]123456", 0, "3350123456", "" },
- /*282*/ { "[3350]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3350)" },
- /*283*/ { "[3359]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3359)" },
- /*284*/ { "[3360]123456", 0, "3360123456", "" },
- /*285*/ { "[3360]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3360)" },
- /*286*/ { "[3369]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3369)" },
- /*287*/ { "[3370]123456", 0, "3370123456", "" },
- /*288*/ { "[3370]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3370)" },
- /*289*/ { "[3375]123456", 0, "3375123456", "" },
- /*290*/ { "[3375]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3375)" },
- /*291*/ { "[3376]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3376)" },
- /*292*/ { "[3379]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3379)" },
- /*293*/ { "[3380]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3380)" },
- /*294*/ { "[3390]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3390)" },
- /*295*/ { "[3399]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3399)" },
- /*296*/ { "[34]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (34)" },
- /*297*/ { "[340]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (340)" },
- /*298*/ { "[3400]123456", 0, "3400123456", "" },
- /*299*/ { "[3400]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3400)" },
- /*300*/ { "[3405]123456", 0, "3405123456", "" },
- /*301*/ { "[3405]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3405)" },
- /*302*/ { "[3406]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3406)" },
- /*303*/ { "[3409]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3409)" },
- /*304*/ { "[3410]123456", 0, "3410123456", "" },
- /*305*/ { "[3410]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3410)" },
- /*306*/ { "[3419]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3419)" },
- /*307*/ { "[3420]123456", 0, "3420123456", "" },
- /*308*/ { "[3420]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3420)" },
- /*309*/ { "[3429]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3429)" },
- /*310*/ { "[3430]123456", 0, "3430123456", "" },
- /*311*/ { "[3430]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3430)" },
- /*312*/ { "[3439]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3439)" },
- /*313*/ { "[3440]123456", 0, "3440123456", "" },
- /*314*/ { "[3440]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3440)" },
- /*315*/ { "[3449]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3449)" },
- /*316*/ { "[3450]123456", 0, "3450123456", "" },
- /*317*/ { "[3450]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3450)" },
- /*318*/ { "[3459]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3459)" },
- /*319*/ { "[3460]123456", 0, "3460123456", "" },
- /*320*/ { "[3460]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3460)" },
- /*321*/ { "[3469]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3469)" },
- /*322*/ { "[3470]123456", 0, "3470123456", "" },
- /*323*/ { "[3470]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3470)" },
- /*324*/ { "[3479]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3479)" },
- /*325*/ { "[3480]123456", 0, "3480123456", "" },
- /*326*/ { "[3480]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3480)" },
- /*327*/ { "[3489]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3489)" },
- /*328*/ { "[3490]123456", 0, "3490123456", "" },
- /*329*/ { "[3490]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3490)" },
- /*330*/ { "[3495]123456", 0, "3495123456", "" },
- /*331*/ { "[3495]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3495)" },
- /*332*/ { "[3496]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3496)" },
- /*333*/ { "[3499]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3499)" },
- /*334*/ { "[35]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (35)" },
- /*335*/ { "[350]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (350)" },
- /*336*/ { "[3500]123456", 0, "3500123456", "" },
- /*337*/ { "[3500]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3500)" },
- /*338*/ { "[3505]123456", 0, "3505123456", "" },
- /*339*/ { "[3505]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3505)" },
- /*340*/ { "[3506]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3506)" },
- /*341*/ { "[3509]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3509)" },
- /*342*/ { "[3510]123456", 0, "3510123456", "" },
- /*343*/ { "[3510]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3510)" },
- /*344*/ { "[3519]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3519)" },
- /*345*/ { "[3520]123456", 0, "3520123456", "" },
- /*346*/ { "[3520]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3520)" },
- /*347*/ { "[3529]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3529)" },
- /*348*/ { "[3530]123456", 0, "3530123456", "" },
- /*349*/ { "[3530]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3530)" },
- /*350*/ { "[3539]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3539)" },
- /*351*/ { "[3540]123456", 0, "3540123456", "" },
- /*352*/ { "[3540]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3540)" },
- /*353*/ { "[3549]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3549)" },
- /*354*/ { "[3550]123456", 0, "3550123456", "" },
- /*355*/ { "[3550]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3550)" },
- /*356*/ { "[3559]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3559)" },
- /*357*/ { "[3560]123456", 0, "3560123456", "" },
- /*358*/ { "[3560]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3560)" },
- /*359*/ { "[3569]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3569)" },
- /*360*/ { "[3570]123456", 0, "3570123456", "" },
- /*361*/ { "[3570]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3570)" },
- /*362*/ { "[3575]123456", 0, "3575123456", "" },
- /*363*/ { "[3376]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3376)" },
- /*364*/ { "[3579]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3579)" },
- /*365*/ { "[3580]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3580)" },
- /*366*/ { "[3590]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3590)" },
- /*367*/ { "[3599]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3599)" },
- /*368*/ { "[36]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (36)" },
- /*369*/ { "[360]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (360)" },
- /*370*/ { "[3600]123456", 0, "3600123456", "" },
- /*371*/ { "[3600]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3600)" },
- /*372*/ { "[3605]123456", 0, "3605123456", "" },
- /*373*/ { "[3605]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3605)" },
- /*374*/ { "[3606]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3606)" },
- /*375*/ { "[3609]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3609)" },
- /*376*/ { "[3610]123456", 0, "3610123456", "" },
- /*377*/ { "[3610]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3610)" },
- /*378*/ { "[3619]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3619)" },
- /*379*/ { "[3620]123456", 0, "3620123456", "" },
- /*380*/ { "[3620]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3620)" },
- /*381*/ { "[3629]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3629)" },
- /*382*/ { "[3630]123456", 0, "3630123456", "" },
- /*383*/ { "[3630]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3630)" },
- /*384*/ { "[3639]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3639)" },
- /*385*/ { "[3640]123456", 0, "3640123456", "" },
- /*386*/ { "[3640]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3640)" },
- /*387*/ { "[3649]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3649)" },
- /*388*/ { "[3650]123456", 0, "3650123456", "" },
- /*389*/ { "[3650]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3650)" },
- /*390*/ { "[3659]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3659)" },
- /*391*/ { "[3660]123456", 0, "3660123456", "" },
- /*392*/ { "[3660]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3660)" },
- /*393*/ { "[3669]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3669)" },
- /*394*/ { "[3670]123456", 0, "3670123456", "" },
- /*395*/ { "[3670]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3670)" },
- /*396*/ { "[3679]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3679)" },
- /*397*/ { "[3680]123456", 0, "3680123456", "" },
- /*398*/ { "[3680]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3680)" },
- /*399*/ { "[3689]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3689)" },
- /*400*/ { "[3690]123456", 0, "3690123456", "" },
- /*401*/ { "[3690]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3690)" },
- /*402*/ { "[3695]123456", 0, "3695123456", "" },
- /*403*/ { "[3695]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3695)" },
- /*404*/ { "[3696]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3696)" },
- /*405*/ { "[3699]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3699)" },
- /*406*/ { "[37]12345678", 0, "3712345678", "" },
- /*407*/ { "[37]123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (37)" },
- /*408*/ { "[370]12345678", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (370)" },
- /*409*/ { "[3700]12345678", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3700)" },
- /*410*/ { "[38]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (38)" },
- /*411*/ { "[380]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (380)" },
- /*412*/ { "[3800]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3800)" },
- /*413*/ { "[39]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (39)" },
- /*414*/ { "[390]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (390)" },
- /*415*/ { "[3900]123456789012345", 0, "3900123456789012345", "" },
- /*416*/ { "[3900]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3900)" },
- /*417*/ { "[3900]12345678901234", 0, "390012345678901234", "" },
- /*418*/ { "[3901]123456789012345", 0, "3901123456789012345", "" },
- /*419*/ { "[3901]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3901)" },
- /*420*/ { "[3905]123456789012345", 0, "3905123456789012345", "" },
- /*421*/ { "[3909]123456789012345", 0, "3909123456789012345", "" },
- /*422*/ { "[3909]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3909)" },
- /*423*/ { "[3910]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3910123123456789012345", "261: AI (3910) position 1: Unknown currency code '123'" },
- /*424*/ { "[3910]997123456789012345", 0, "3910997123456789012345", "" },
- /*425*/ { "[3910]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910)" },
- /*426*/ { "[3910]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910)" },
- /*427*/ { "[3915]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3915123123456789012345", "261: AI (3915) position 1: Unknown currency code '123'" },
- /*428*/ { "[3915]997123456789012345", 0, "3915997123456789012345", "" },
- /*429*/ { "[3915]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3915)" },
- /*430*/ { "[3919]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3919123123456789012345", "261: AI (3919) position 1: Unknown currency code '123'" },
- /*431*/ { "[3919]997123456789012345", 0, "3919997123456789012345", "" },
- /*432*/ { "[3919]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3919)" },
- /*433*/ { "[3920]123456789012345", 0, "3920123456789012345", "" },
- /*434*/ { "[3920]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3920)" },
- /*435*/ { "[3925]123456789012345", 0, "3925123456789012345", "" },
- /*436*/ { "[3925]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3925)" },
- /*437*/ { "[3929]123456789012345", 0, "3929123456789012345", "" },
- /*438*/ { "[3929]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3929)" },
- /*439*/ { "[3930]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3930123123456789012345", "261: AI (3930) position 1: Unknown currency code '123'" },
- /*440*/ { "[3930]997123456789012345", 0, "3930997123456789012345", "" },
- /*441*/ { "[3930]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3930)" },
- /*442*/ { "[3930]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3930)" },
- /*443*/ { "[3935]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3935123123456789012345", "261: AI (3935) position 1: Unknown currency code '123'" },
- /*444*/ { "[3935]997123456789012345", 0, "3935997123456789012345", "" },
- /*445*/ { "[3935]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3935)" },
- /*446*/ { "[3939]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3939123123456789012345", "261: AI (3939) position 1: Unknown currency code '123'" },
- /*447*/ { "[3939]997123456789012345", 0, "3939997123456789012345", "" },
- /*448*/ { "[3939]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3939)" },
- /*449*/ { "[3940]1234", 0, "39401234", "" },
- /*450*/ { "[3940]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3940)" },
- /*451*/ { "[3940]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3940)" },
- /*452*/ { "[3941]1234", 0, "39411234", "" },
- /*453*/ { "[3941]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3941)" },
- /*454*/ { "[3941]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3941)" },
- /*455*/ { "[3942]1234", 0, "39421234", "" },
- /*456*/ { "[3942]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3942)" },
- /*457*/ { "[3943]1234", 0, "39431234", "" },
- /*458*/ { "[3943]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3943)" },
- /*459*/ { "[3944]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3944)" },
- /*460*/ { "[3945]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3945)" },
- /*461*/ { "[3949]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3949)" },
- /*462*/ { "[3950]123456", 0, "3950123456", "" },
- /*463*/ { "[3950]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3950)" },
- /*464*/ { "[3950]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3950)" },
- /*465*/ { "[3951]123456", 0, "3951123456", "" },
- /*466*/ { "[3951]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3951)" },
- /*467*/ { "[3952]123456", 0, "3952123456", "" },
- /*468*/ { "[3952]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3952)" },
- /*469*/ { "[3953]123456", 0, "3953123456", "" },
- /*470*/ { "[3953]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3953)" },
- /*471*/ { "[3954]123456", 0, "3954123456", "" },
- /*472*/ { "[3954]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3954)" },
- /*473*/ { "[3955]123456", 0, "3955123456", "" },
- /*474*/ { "[3955]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3955)" },
- /*475*/ { "[3956]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3956)" },
- /*476*/ { "[3959]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3959)" },
- /*477*/ { "[3960]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3960)" },
- /*478*/ { "[3970]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3970)" },
- /*479*/ { "[3980]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3980)" },
- /*480*/ { "[3999]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3999)" },
- /*481*/ { "[40]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (40)" },
- /*482*/ { "[400]123456789012345678901234567890", 0, "400123456789012345678901234567890", "" },
- /*483*/ { "[400]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (400)" },
- /*484*/ { "[4000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4000)" },
- /*485*/ { "[401]1234abcdefghijklmnopqrstuvwxyz", 0, "4011234abcdefghijklmnopqrstuvwxyz", "" },
- /*486*/ { "[401]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (401)" },
- /*487*/ { "[4010]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4010)" },
- /*488*/ { "[402]13131313131313132", ZINT_WARN_NONCOMPLIANT, "40213131313131313132", "261: AI (402) position 17: Bad checksum '2', expected '0'" },
- /*489*/ { "[402]13131313131313130", 0, "40213131313131313130", "" },
- /*490*/ { "[402]1313131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (402)" },
- /*491*/ { "[4020]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4020)" },
- /*492*/ { "[403]abcdefghijklmnopqrstuvwxyz1234", 0, "403abcdefghijklmnopqrstuvwxyz1234", "" },
- /*493*/ { "[403]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (403)" },
- /*494*/ { "[4030]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4030)" },
- /*495*/ { "[404]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (404)" },
- /*496*/ { "[4040]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4040)" },
- /*497*/ { "[409]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (409)" },
- /*498*/ { "[4090]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4090)" },
- /*499*/ { "[41]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (41)" },
- /*500*/ { "[410]3898765432108", 0, "4103898765432108", "" },
- /*501*/ { "[410]12345678901234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (410)" },
- /*502*/ { "[4100]12345678901234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4100)" },
- /*503*/ { "[411]1313131313134", ZINT_WARN_NONCOMPLIANT, "4111313131313134", "261: AI (411) position 13: Bad checksum '4', expected '0'" },
- /*504*/ { "[411]1313131313130", 0, "4111313131313130", "" },
- /*505*/ { "[411]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (411)" },
- /*506*/ { "[4110]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4110)" },
- /*507*/ { "[412]1313131313130", 0, "4121313131313130", "" },
- /*508*/ { "[412]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (412)" },
- /*509*/ { "[4120]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4120)" },
- /*510*/ { "[413]1313131313130", 0, "4131313131313130", "" },
- /*511*/ { "[413]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (413)" },
- /*512*/ { "[4130]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4130)" },
- /*513*/ { "[414]1313131313130", 0, "4141313131313130", "" },
- /*514*/ { "[414]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (414)" },
- /*515*/ { "[4140]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4140)" },
- /*516*/ { "[415]1313131313130", 0, "4151313131313130", "" },
- /*517*/ { "[415]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (415)" },
- /*518*/ { "[4150]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4150)" },
- /*519*/ { "[416]1313131313130", 0, "4161313131313130", "" },
- /*520*/ { "[416]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (416)" },
- /*521*/ { "[4160]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4160)" },
- /*522*/ { "[417]1313131313130", 0, "4171313131313130", "" },
- /*523*/ { "[417]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (417)" },
- /*524*/ { "[4170]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4170)" },
- /*525*/ { "[418]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (418)" },
- /*526*/ { "[4180]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4180)" },
- /*527*/ { "[419]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (419)" },
- /*528*/ { "[4190]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4190)" },
- /*529*/ { "[42]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (42)" },
- /*530*/ { "[420]abcdefghijklmnopqrst", 0, "420abcdefghijklmnopqrst", "" },
- /*531*/ { "[420]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (420)" },
- /*532*/ { "[4200]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4200)" },
- /*533*/ { "[421]123abcdefghi", ZINT_WARN_NONCOMPLIANT, "421123abcdefghi", "261: AI (421) position 1: Unknown country code '123'" },
- /*534*/ { "[421]434abcdefghi", 0, "421434abcdefghi", "" },
- /*535*/ { "[421]123abcdefghij", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (421)" },
- /*536*/ { "[421]1231", ZINT_WARN_NONCOMPLIANT, "4211231", "261: AI (421) position 1: Unknown country code '123'" },
- /*537*/ { "[421]4341", 0, "4214341", "" },
- /*538*/ { "[421]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (421)" },
- /*539*/ { "[4210]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4210)" },
- /*540*/ { "[422]123", ZINT_WARN_NONCOMPLIANT, "422123", "261: AI (422) position 1: Unknown country code '123'" },
- /*541*/ { "[422]004", 0, "422004", "" },
- /*542*/ { "[422]1234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (422)" },
- /*543*/ { "[422]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (422)" },
- /*544*/ { "[4220]123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4220)" },
- /*545*/ { "[423]123123123123123", ZINT_WARN_NONCOMPLIANT, "423123123123123123", "261: AI (423) position 1: Unknown country code '123'" },
- /*546*/ { "[423]470004012887123", ZINT_WARN_NONCOMPLIANT, "423470004012887123", "261: AI (423) position 13: Unknown country code '123'" },
- /*547*/ { "[423]470004012887438", 0, "423470004012887438", "" },
- /*548*/ { "[423]1231231231231231", ZINT_ERROR_INVALID_DATA, "4231231231231231231", "259: Invalid data length for AI (423)" },
- /*549*/ { "[423]12312312312312", ZINT_WARN_NONCOMPLIANT, "42312312312312312", "259: Invalid data length for AI (423)" },
- /*550*/ { "[423]1231231231231", ZINT_WARN_NONCOMPLIANT, "4231231231231231", "259: Invalid data length for AI (423)" },
- /*551*/ { "[423]12312312312", ZINT_WARN_NONCOMPLIANT, "42312312312312", "259: Invalid data length for AI (423)" },
- /*552*/ { "[423]1231231231", ZINT_WARN_NONCOMPLIANT, "4231231231231", "259: Invalid data length for AI (423)" },
- /*553*/ { "[423]123", ZINT_WARN_NONCOMPLIANT, "423123", "261: AI (423) position 1: Unknown country code '123'" },
- /*554*/ { "[423]004", 0, "423004", "" },
- /*555*/ { "[423]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423)" },
- /*556*/ { "[4230]123123123123123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4230)" },
- /*557*/ { "[424]123", ZINT_WARN_NONCOMPLIANT, "424123", "261: AI (424) position 1: Unknown country code '123'" },
- /*558*/ { "[424]004", 0, "424004", "" },
- /*559*/ { "[424]1234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (424)" },
- /*560*/ { "[424]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (424)" },
- /*561*/ { "[4240]123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4240)" },
- /*562*/ { "[425]123123123123123", ZINT_WARN_NONCOMPLIANT, "425123123123123123", "261: AI (425) position 1: Unknown country code '123'" },
- /*563*/ { "[425]010500276634894", 0, "425010500276634894", "" },
- /*564*/ { "[425]010500276123894", ZINT_WARN_NONCOMPLIANT, "425010500276123894", "261: AI (425) position 10: Unknown country code '123'" },
- /*565*/ { "[425]1231231231231231", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (425)" },
- /*566*/ { "[425]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (425)" },
- /*567*/ { "[4250]123123123123123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4250)" },
- /*568*/ { "[426]123", ZINT_WARN_NONCOMPLIANT, "426123", "261: AI (426) position 1: Unknown country code '123'" },
- /*569*/ { "[426]426", 0, "426426", "" },
- /*570*/ { "[426]1234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (426)" },
- /*571*/ { "[426]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (426)" },
- /*572*/ { "[4260]123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4260)" },
- /*573*/ { "[427]abc", 0, "427abc", "" },
- /*574*/ { "[427]abcd", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (427)" },
- /*575*/ { "[4270]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4270)" },
- /*576*/ { "[428]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (428)" },
- /*577*/ { "[4280]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4280)" },
- /*578*/ { "[429]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (429)" },
- /*579*/ { "[4290]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4290)" },
- /*580*/ { "[43]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (43)" },
- /*581*/ { "[430]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (430)" },
- /*582*/ { "[4300]1", 0, "43001", "" },
- /*583*/ { "[4300]12345678901234567890123456789012345", 0, "430012345678901234567890123456789012345", "" },
- /*584*/ { "[4300]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4300)" },
- /*585*/ { "[4301]1", 0, "43011", "" },
- /*586*/ { "[4301]12345678901234567890123456789012345", 0, "430112345678901234567890123456789012345", "" },
- /*587*/ { "[4301]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4301)" },
- /*588*/ { "[4302]1", 0, "43021", "" },
- /*589*/ { "[4302]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43021234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*590*/ { "[4302]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4302)" },
- /*591*/ { "[4303]1", 0, "43031", "" },
- /*592*/ { "[4303]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43031234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*593*/ { "[4303]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4303)" },
- /*594*/ { "[4304]1", 0, "43041", "" },
- /*595*/ { "[4304]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43041234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*596*/ { "[4304]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4304)" },
- /*597*/ { "[4305]1", 0, "43051", "" },
- /*598*/ { "[4305]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43051234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*599*/ { "[4305]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4305)" },
- /*600*/ { "[4306]1", 0, "43061", "" },
- /*601*/ { "[4306]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43061234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*602*/ { "[4306]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4306)" },
- /*603*/ { "[4307]FR", 0, "4307FR", "" },
- /*604*/ { "[4307]F", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4307)" },
- /*605*/ { "[4307]FRR", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4307)" },
- /*606*/ { "[4308]1", 0, "43081", "" },
- /*607*/ { "[4308]123456789012345678901234567890", 0, "4308123456789012345678901234567890", "" },
- /*608*/ { "[4308]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4308)" },
- /*609*/ { "[4309]12345678901234567890", 0, "430912345678901234567890", "" },
- /*610*/ { "[4309]1234567890123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4309)" },
- /*611*/ { "[4309]1234567890123456789A", ZINT_WARN_NONCOMPLIANT, "43091234567890123456789A", "261: AI (4309) position 20: Non-numeric character 'A'" },
- /*612*/ { "[431]1", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (431)" },
- /*613*/ { "[4310]1", 0, "43101", "" },
- /*614*/ { "[4310]12345678901234567890123456789012345", 0, "431012345678901234567890123456789012345", "" },
- /*615*/ { "[4310]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4310)" },
- /*616*/ { "[4311]1", 0, "43111", "" },
- /*617*/ { "[4311]12345678901234567890123456789012345", 0, "431112345678901234567890123456789012345", "" },
- /*618*/ { "[4311]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4311)" },
- /*619*/ { "[4312]1", 0, "43121", "" },
- /*620*/ { "[4312]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43121234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*621*/ { "[4312]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4312)" },
- /*622*/ { "[4313]1", 0, "43131", "" },
- /*623*/ { "[4313]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43131234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*624*/ { "[4313]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4313)" },
- /*625*/ { "[4314]1", 0, "43141", "" },
- /*626*/ { "[4314]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43141234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*627*/ { "[4314]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4314)" },
- /*628*/ { "[4315]1", 0, "43151", "" },
- /*629*/ { "[4315]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43151234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*630*/ { "[4315]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4315)" },
- /*631*/ { "[4316]1", 0, "43161", "" },
- /*632*/ { "[4316]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43161234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*633*/ { "[4316]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4316)" },
- /*634*/ { "[4317]FR", 0, "4317FR", "" },
- /*635*/ { "[4317]F", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4317)" },
- /*636*/ { "[4317]FRF", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4317)" },
- /*637*/ { "[4318]1", 0, "43181", "" },
- /*638*/ { "[4318]12345678901234567890", 0, "431812345678901234567890", "" },
- /*639*/ { "[4318]123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4318)" },
- /*640*/ { "[4319]1", 0, "43191", "" },
- /*641*/ { "[4319]123456789012345678901234567890", 0, "4319123456789012345678901234567890", "" },
- /*642*/ { "[4319]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4319)" },
- /*643*/ { "[432]1", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (432)" },
- /*644*/ { "[4320]1", 0, "43201", "" },
- /*645*/ { "[4320]12345678901234567890123456789012345", 0, "432012345678901234567890123456789012345", "" },
- /*646*/ { "[4320]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4320)" },
- /*647*/ { "[4321]1", 0, "43211", "" },
- /*648*/ { "[4321]10", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4321)" },
- /*649*/ { "[4322]1", 0, "43221", "" },
- /*650*/ { "[4322]10", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4322)" },
- /*651*/ { "[4323]1", 0, "43231", "" },
- /*652*/ { "[4323]10", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4323)" },
- /*653*/ { "[4324]1212120000", 0, "43241212120000", "" },
- /*654*/ { "[4324]121212000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4324)" },
- /*655*/ { "[4324]12121200000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4324)" },
- /*656*/ { "[4325]1212120000", 0, "43251212120000", "" },
- /*657*/ { "[4325]121212000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4325)" },
- /*658*/ { "[4325]12121200000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4325)" },
- /*659*/ { "[4326]121212", 0, "4326121212", "" },
- /*660*/ { "[4326]12121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4326)" },
- /*661*/ { "[4326]1212120", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4326)" },
- /*662*/ { "[4327]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4327)" },
- /*663*/ { "[4328]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4328)" },
- /*664*/ { "[4329]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4329)" },
- /*665*/ { "[433]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (433)" },
- /*666*/ { "[4330]121212", 0, "4330121212", "" },
- /*667*/ { "[4331]121212-", 0, "4331121212-", "" },
- /*668*/ { "[4332]121212", 0, "4332121212", "" },
- /*669*/ { "[4333]121212-", 0, "4333121212-", "" },
- /*670*/ { "[4334]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4334)" },
- /*671*/ { "[44]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (44)" },
- /*672*/ { "[440]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (440)" },
- /*673*/ { "[4400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4400)" },
- /*674*/ { "[49]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (49)" },
- /*675*/ { "[490]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (490)" },
- /*676*/ { "[4900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4900)" },
- /*677*/ { "[499]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (499)" },
- /*678*/ { "[4990]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4990)" },
- /*679*/ { "[50]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (50)" },
- /*680*/ { "[500]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (500)" },
- /*681*/ { "[5000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (5000)" },
- /*682*/ { "[51]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (51)" },
- /*683*/ { "[510]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (510)" },
- /*684*/ { "[5100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (5100)" },
- /*685*/ { "[59]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (59)" },
- /*686*/ { "[590]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (590)" },
- /*687*/ { "[5900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (5900)" },
- /*688*/ { "[60]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (60)" },
- /*689*/ { "[600]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (600)" },
- /*690*/ { "[6000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (6000)" },
- /*691*/ { "[61]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (61)" },
- /*692*/ { "[610]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (610)" },
- /*693*/ { "[6100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (6100)" },
- /*694*/ { "[69]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (69)" },
- /*695*/ { "[690]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (690)" },
- /*696*/ { "[6900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (6900)" },
- /*697*/ { "[70]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (70)" },
- /*698*/ { "[700]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (700)" },
- /*699*/ { "[7000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7000)" },
- /*700*/ { "[7001]1234567890123", 0, "70011234567890123", "" },
- /*701*/ { "[7001]123456789012", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7001)" },
- /*702*/ { "[7002]abcdefghijklmnopqrstuvwxyz1234", 0, "7002abcdefghijklmnopqrstuvwxyz1234", "" },
- /*703*/ { "[7002]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7002)" },
- /*704*/ { "[7003]1212121212", 0, "70031212121212", "" },
- /*705*/ { "[7003]121212121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7003)" },
- /*706*/ { "[7004]1234", 0, "70041234", "" },
- /*707*/ { "[7004]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7004)" },
- /*708*/ { "[7005]abcdefghijkl", 0, "7005abcdefghijkl", "" },
- /*709*/ { "[7005]abcdefghijklm", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7005)" },
- /*710*/ { "[7006]200132", ZINT_WARN_NONCOMPLIANT, "7006200132", "261: AI (7006) position 5: Invalid day '32'" },
- /*711*/ { "[7006]200100", ZINT_WARN_NONCOMPLIANT, "7006200100", "261: AI (7006) position 5: Invalid day '00'" },
- /*712*/ { "[7006]200120", 0, "7006200120", "" },
- /*713*/ { "[7006]2001320", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7006)" },
- /*714*/ { "[7007]010101121212", 0, "7007010101121212", "" },
- /*715*/ { "[7007]01010112121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7007)" },
- /*716*/ { "[7007]A1010112121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7007)" },
- /*717*/ { "[7007]121212", 0, "7007121212", "" },
- /*718*/ { "[7007]12121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7007)" },
- /*719*/ { "[7007]1212121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7007)" },
- /*720*/ { "[7008]abc", 0, "7008abc", "" },
- /*721*/ { "[7008]abcd", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7008)" },
- /*722*/ { "[7009]abcdefghij", 0, "7009abcdefghij", "" },
- /*723*/ { "[7009]abcdefghijk", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7009)" },
- /*724*/ { "[7010]01", 0, "701001", "" },
- /*725*/ { "[7010]1", 0, "70101", "" },
- /*726*/ { "[7010]012", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7010)" },
- /*727*/ { "[7011]121212", 0, "7011121212", "" },
- /*728*/ { "[7011]1212121212", 0, "70111212121212", "" },
- /*729*/ { "[7011]12121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7011)" },
- /*730*/ { "[7011]121212121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7011)" },
- /*731*/ { "[7012]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7012)" },
- /*732*/ { "[7019]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7019)" },
- /*733*/ { "[7020]abcdefghijklmnopqrst", 0, "7020abcdefghijklmnopqrst", "" },
- /*734*/ { "[7020]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7020)" },
- /*735*/ { "[7021]abcdefghijklmnopqrst", 0, "7021abcdefghijklmnopqrst", "" },
- /*736*/ { "[7021]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7021)" },
- /*737*/ { "[7022]abcdefghijklmnopqrst", 0, "7022abcdefghijklmnopqrst", "" },
- /*738*/ { "[7022]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7022)" },
- /*739*/ { "[7023]1234abcdefghijklmnopqrstuvwxyz", 0, "70231234abcdefghijklmnopqrstuvwxyz", "" },
- /*740*/ { "[7023]1234abcdefghijklmnopqrstuvwxyza", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7023)" },
- /*741*/ { "[7024]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7024)" },
- /*742*/ { "[7025]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7025)" },
- /*743*/ { "[7029]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7029)" },
- /*744*/ { "[7030]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7030123abcdefghijklmnopqrstuvwxyza", "261: AI (7030) position 1: Unknown country code '123'" },
- /*745*/ { "[7030]004abcdefghijklmnopqrstuvwxyza", 0, "7030004abcdefghijklmnopqrstuvwxyza", "" },
- /*746*/ { "[7030]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7030)" },
- /*747*/ { "[7031]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7031123abcdefghijklmnopqrstuvwxyza", "261: AI (7031) position 1: Unknown country code '123'" },
- /*748*/ { "[7031]004abcdefghijklmnopqrstuvwxyza", 0, "7031004abcdefghijklmnopqrstuvwxyza", "" },
- /*749*/ { "[7031]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7031)" },
- /*750*/ { "[7032]004abcdefghijklmnopqrstuvwxyza", 0, "7032004abcdefghijklmnopqrstuvwxyza", "" },
- /*751*/ { "[7032]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7032)" },
- /*752*/ { "[7033]004abcdefghijklmnopqrstuvwxyza", 0, "7033004abcdefghijklmnopqrstuvwxyza", "" },
- /*753*/ { "[7033]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7033)" },
- /*754*/ { "[7034]004abcdefghijklmnopqrstuvwxyza", 0, "7034004abcdefghijklmnopqrstuvwxyza", "" },
- /*755*/ { "[7034]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7034)" },
- /*756*/ { "[7035]004abcdefghijklmnopqrstuvwxyza", 0, "7035004abcdefghijklmnopqrstuvwxyza", "" },
- /*757*/ { "[7035]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7035)" },
- /*758*/ { "[7036]004abcdefghijklmnopqrstuvwxyza", 0, "7036004abcdefghijklmnopqrstuvwxyza", "" },
- /*759*/ { "[7036]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7036)" },
- /*760*/ { "[7037]004abcdefghijklmnopqrstuvwxyza", 0, "7037004abcdefghijklmnopqrstuvwxyza", "" },
- /*761*/ { "[7037]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7037)" },
- /*762*/ { "[7038]004abcdefghijklmnopqrstuvwxyza", 0, "7038004abcdefghijklmnopqrstuvwxyza", "" },
- /*763*/ { "[7038]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7038)" },
- /*764*/ { "[7039]004abcdefghijklmnopqrstuvwxyza", 0, "7039004abcdefghijklmnopqrstuvwxyza", "" },
- /*765*/ { "[7039]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7039)" },
- /*766*/ { "[7040]1abc", 0, "70401abc", "" },
- /*767*/ { "[7040]1ab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7040)" },
- /*768*/ { "[7040]1abcd", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7040)" },
- /*769*/ { "[7041]BGE", 0, "7041BGE", "" },
- /*770*/ { "[7041]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7041)" },
- /*771*/ { "[7042]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7042)" },
- /*772*/ { "[7050]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7050)" },
- /*773*/ { "[7090]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7090)" },
- /*774*/ { "[7099]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7099)" },
- /*775*/ { "[71]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (71)" },
- /*776*/ { "[710]abcdefghijklmnopqrst", 0, "710abcdefghijklmnopqrst", "" },
- /*777*/ { "[710]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (710)" },
- /*778*/ { "[7100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7100)" },
- /*779*/ { "[711]abcdefghijklmnopqrst", 0, "711abcdefghijklmnopqrst", "" },
- /*780*/ { "[711]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (711)" },
- /*781*/ { "[712]abcdefghijklmnopqrst", 0, "712abcdefghijklmnopqrst", "" },
- /*782*/ { "[712]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (712)" },
- /*783*/ { "[713]abcdefghijklmnopqrst", 0, "713abcdefghijklmnopqrst", "" },
- /*784*/ { "[713]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (713)" },
- /*785*/ { "[714]abcdefghijklmnopqrst", 0, "714abcdefghijklmnopqrst", "" },
- /*786*/ { "[714]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (714)" },
- /*787*/ { "[715]abcdefghijklmnopqrst", 0, "715abcdefghijklmnopqrst", "" },
- /*788*/ { "[715]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (715)" },
- /*789*/ { "[716]abcdefghijklmnopqrst", 0, "716abcdefghijklmnopqrst", "" },
- /*790*/ { "[716]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (716)" },
- /*791*/ { "[717]abcdefghijklmnopqrst", 0, "717abcdefghijklmnopqrst", "" },
- /*792*/ { "[717]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (717)" },
- /*793*/ { "[718]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (718)" },
- /*794*/ { "[719]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (719)" },
- /*795*/ { "[72]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (72)" },
- /*796*/ { "[720]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (720)" },
- /*797*/ { "[7200]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7200)" },
- /*798*/ { "[721]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (721)" },
- /*799*/ { "[7210]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7210)" },
- /*800*/ { "[7220]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7220)" },
- /*801*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzab", 0, "7230EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*802*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7230)" },
- /*803*/ { "[7230]EM", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7230)" },
- /*804*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzab", 0, "7231EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*805*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7231)" },
- /*806*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzab", 0, "7232EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*807*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7232)" },
- /*808*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzab", 0, "7233EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*809*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7233)" },
- /*810*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzab", 0, "7234EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*811*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7234)" },
- /*812*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzab", 0, "7235EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*813*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7235)" },
- /*814*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzab", 0, "7236EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*815*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7236)" },
- /*816*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzab", 0, "7237EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*817*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7237)" },
- /*818*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzab", 0, "7238EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*819*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7238)" },
- /*820*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzab", 0, "7239EMabcdefghijklmnopqrstuvwxyzab", "" },
- /*821*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7239)" },
- /*822*/ { "[7239]E", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7239)" },
- /*823*/ { "[7240]abcdefghijklmnopqrst", 0, "7240abcdefghijklmnopqrst", "" },
- /*824*/ { "[7240]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7240)" },
- /*825*/ { "[7241]99", 0, "724199", "" },
- /*826*/ { "[7241]100", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7241)" },
- /*827*/ { "[7242]abcdefghijklmnopqrstuvwxy", 0, "7242abcdefghijklmnopqrstuvwxy", "" },
- /*828*/ { "[7242]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7242)" },
- /*829*/ { "[7243]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7243)" },
- /*830*/ { "[7249]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7249)" },
- /*831*/ { "[7250]12341201", 0, "725012341201", "" },
- /*832*/ { "[7250]123412012", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7250)" },
- /*833*/ { "[7251]123412011359", 0, "7251123412011359", "" },
- /*834*/ { "[7251]1234120113591", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7251)" },
- /*835*/ { "[7252]2", 0, "72522", "" },
- /*836*/ { "[7252]20", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7252)" },
- /*837*/ { "[7253]abcdefghijklmnopqrstuvwxyzabcdefghijklmn", 0, "7253abcdefghijklmnopqrstuvwxyzabcdefghijklmn", "" },
- /*838*/ { "[7253]abcdefghijklmnopqrstuvwxyzabcdefghijklmno", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7253)" },
- /*839*/ { "[7254]abcdefghijklmnopqrstuvwxyzabcdefghijklmn", 0, "7254abcdefghijklmnopqrstuvwxyzabcdefghijklmn", "" },
- /*840*/ { "[7254]abcdefghijklmnopqrstuvwxyzabcdefghijklmno", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7254)" },
- /*841*/ { "[7255]abcdefghij", 0, "7255abcdefghij", "" },
- /*842*/ { "[7255]abcdefghijk", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7255)" },
- /*843*/ { "[7256]abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl", 0, "7256abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl", "" },
- /*844*/ { "[7256]abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7256)" },
- /*845*/ { "[7257]abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr", 0, "7257abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr", "" },
- /*846*/ { "[7257]abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7257)" },
- /*847*/ { "[7258]1/1", 0, "72581/1", "" },
- /*848*/ { "[7258]1/01", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7258)" },
- /*849*/ { "[7259]abcdefghijklmnopqrstuvwxyzabcdefghijklmn", 0, "7259abcdefghijklmnopqrstuvwxyzabcdefghijklmn", "" },
- /*850*/ { "[7259]abcdefghijklmnopqrstuvwxyzabcdefghijklmno", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7259)" },
- /*851*/ { "[7260]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7260)" },
- /*852*/ { "[7299]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7299)" },
- /*853*/ { "[73]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (73)" },
- /*854*/ { "[7300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7300)" },
- /*855*/ { "[74]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (74)" },
- /*856*/ { "[7400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7400)" },
- /*857*/ { "[79]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (79)" },
- /*858*/ { "[7900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7900)" },
- /*859*/ { "[7999]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7999)" },
- /*860*/ { "[80]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (80)" },
- /*861*/ { "[800]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (800)" },
- /*862*/ { "[8000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8000)" },
- /*863*/ { "[8001]12345678901234", ZINT_WARN_NONCOMPLIANT, "800112345678901234", "261: AI (8001) position 13: Invalid winding direction '3'" },
- /*864*/ { "[8001]12345678901204", 0, "800112345678901204", "" },
- /*865*/ { "[8001]1234123456789012345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8001)" },
- /*866*/ { "[8002]abcdefghijklmnopqrst", 0, "8002abcdefghijklmnopqrst", "" },
- /*867*/ { "[8002]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8002)" },
- /*868*/ { "[8003]01234567890123abcdefghijklmnop", ZINT_WARN_NONCOMPLIANT, "800301234567890123abcdefghijklmnop", "261: AI (8003) position 14: Bad checksum '3', expected '8'" },
- /*869*/ { "[8003]01234567890128abcdefghijklmnop", 0, "800301234567890128abcdefghijklmnop", "" },
- /*870*/ { "[8003]01234567890128abcdefghijklmnopq", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8003)" },
- /*871*/ { "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_WARN_NONCOMPLIANT, "8004abcdefghijklmnopqrstuvwxyz1234", "261: AI (8004) position 1: Non-numeric company prefix 'a'" },
- /*872*/ { "[8004]1234efghijklmnopqrstuvwxyz1234", 0, "80041234efghijklmnopqrstuvwxyz1234", "" },
- /*873*/ { "[8004]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8004)" },
- /*874*/ { "[8004]123", ZINT_WARN_NONCOMPLIANT, "8004123", "261: AI (8004) position 1: GS1 Company Prefix length 3 too short (minimum 4)" },
- /*875*/ { "[8005]123456", 0, "8005123456", "" },
- /*876*/ { "[8005]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8005)" },
- /*877*/ { "[8005]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8005)" },
- /*878*/ { "[8006]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8006123456789012341212", "261: AI (8006) position 14: Bad checksum '4', expected '1'" },
- /*879*/ { "[8006]123456789012311212", 0, "8006123456789012311212", "" },
- /*880*/ { "[8006]12345678901234121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8006)" },
- /*881*/ { "[8006]1234567890123412123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8006)" },
- /*882*/ { "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_WARN_NONCOMPLIANT, "8007abcdefghijklmnopqrstuvwxyz12345678", "261: AI (8007) position 1: Non-alphabetic IBAN country code 'ab'" },
- /*883*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", "" },
- /*884*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8007)" },
- /*885*/ { "[8008]123456121212", ZINT_WARN_NONCOMPLIANT, "8008123456121212", "261: AI (8008) position 3: Invalid month '34'" },
- /*886*/ { "[8008]121256121212", ZINT_WARN_NONCOMPLIANT, "8008121256121212", "261: AI (8008) position 5: Invalid day '56'" },
- /*887*/ { "[8008]121231121212", 0, "8008121231121212", "" },
- /*888*/ { "[8008]1234561212", ZINT_WARN_NONCOMPLIANT, "80081234561212", "261: AI (8008) position 3: Invalid month '34'" },
- /*889*/ { "[8008]1212311212", 0, "80081212311212", "" },
- /*890*/ { "[8008]12345612", ZINT_WARN_NONCOMPLIANT, "800812345612", "261: AI (8008) position 3: Invalid month '34'" },
- /*891*/ { "[8008]12010112", 0, "800812010112", "" },
- /*892*/ { "[8008]1234561", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8008)" },
- /*893*/ { "[8008]123456121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8008)" },
- /*894*/ { "[8008]12345612121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8008)" },
- /*895*/ { "[8008]1234561212123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8008)" },
- /*896*/ { "[8009]12345678901234567890123456789012345678901234567890", 0, "800912345678901234567890123456789012345678901234567890", "" },
- /*897*/ { "[8009]123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8009)" },
- /*898*/ { "[8010]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8010)" },
- /*899*/ { "[8011]123456789012", 0, "8011123456789012", "" },
- /*900*/ { "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8011)" },
- /*901*/ { "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst", "" },
- /*902*/ { "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8012)" },
- /*903*/ { "[8013]1234abcdefghijklmnopqrsQP", 0, "80131234abcdefghijklmnopqrsQP", "" },
- /*904*/ { "[8013]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8013)" },
- /*905*/ { "[8014]1234abcdefghijklmnopqrsQP", 0, "80141234abcdefghijklmnopqrsQP", "" },
- /*906*/ { "[8014]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8014)" },
- /*907*/ { "[8015]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8015)" },
- /*908*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8016)" },
- /*909*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139", "261: AI (8017) position 18: Bad checksum '9', expected '1'" },
- /*910*/ { "[8017]313131313131313131", 0, "8017313131313131313131", "" },
- /*911*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8017)" },
- /*912*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8017)" },
- /*913*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139", "261: AI (8018) position 18: Bad checksum '9', expected '1'" },
- /*914*/ { "[8018]313131313131313131", 0, "8018313131313131313131", "" },
- /*915*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8018)" },
- /*916*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8018)" },
- /*917*/ { "[8019]1234567890", 0, "80191234567890", "" },
- /*918*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8019)" },
- /*919*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy", "" },
- /*920*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8020)" },
- /*921*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8021)" },
- /*922*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8025)" },
- /*923*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212", "261: AI (8026) position 14: Bad checksum '4', expected '1'" },
- /*924*/ { "[8026]123456789012311212", 0, "8026123456789012311212", "" },
- /*925*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8026)" },
- /*926*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8026)" },
- /*927*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8027)" },
- /*928*/ { "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", "" },
- /*929*/ { "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ1", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8030)" },
- /*930*/ { "[8031]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8031)" },
- /*931*/ { "[8040]123456789012345", 0, "8040123456789012345", "" },
- /*932*/ { "[8040]12345678901234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8040)" },
- /*933*/ { "[8041]123456789012345", 0, "8041123456789012345", "" },
- /*934*/ { "[8041]12345678901234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8041)" },
- /*935*/ { "[8042]12345678901234567890123456789012", 0, "804212345678901234567890123456789012", "" },
- /*936*/ { "[8042]123456789012345678901234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8042)" },
- /*937*/ { "[8043]123456789012345678", 0, "8043123456789012345678", "" },
- /*938*/ { "[8043]1234567890123456781", 0, "80431234567890123456781", "" },
- /*939*/ { "[8043]12345678901234567812", 0, "804312345678901234567812", "" },
- /*940*/ { "[8043]123456789012345678123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8043)" },
- /*941*/ { "[8044]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8044)" },
- /*942*/ { "[8049]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8049)" },
- /*943*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8050)" },
- /*944*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8060)" },
- /*945*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8070)" },
- /*946*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8080)" },
- /*947*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8090)" },
- /*948*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8099)" },
- /*949*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (81)" },
- /*950*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8100)" },
- /*951*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8109)" },
- /*952*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000", "" },
- /*953*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8110)" },
- /*954*/ { "[8111]1234", 0, "81111234", "" },
- /*955*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8111)" },
- /*956*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8111)" },
- /*957*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890", "259: Invalid data length for AI (8112)" },
- /*958*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8112)" },
- /*959*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345", "" },
- /*960*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8113)" },
- /*961*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8120)" },
- /*962*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8130)" },
- /*963*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8140)" },
- /*964*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8150)" },
- /*965*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8190)" },
- /*966*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8199)" },
- /*967*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (82)" },
- /*968*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*969*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8201)" },
- /*970*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8210)" },
- /*971*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8220)" },
- /*972*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8230)" },
- /*973*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8240)" },
- /*974*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8250)" },
- /*975*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8290)" },
- /*976*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8299)" },
- /*977*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (83)" },
- /*978*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (830)" },
- /*979*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8300)" },
- /*980*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (84)" },
- /*981*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (840)" },
- /*982*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8400)" },
- /*983*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (85)" },
- /*984*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (850)" },
- /*985*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8500)" },
- /*986*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (89)" },
- /*987*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (890)" },
- /*988*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8900)" },
- /*989*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234", "" },
- /*990*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (90)" },
- /*991*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (900)" },
- /*992*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9000)" },
- /*993*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*994*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (91)" },
- /*995*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (910)" },
- /*996*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9100)" },
- /*997*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*998*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (92)" },
- /*999*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (920)" },
- /*1000*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9200)" },
- /*1001*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*1002*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (93)" },
- /*1003*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (930)" },
- /*1004*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9300)" },
- /*1005*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*1006*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (94)" },
- /*1007*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (940)" },
- /*1008*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9400)" },
- /*1009*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*1010*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (95)" },
- /*1011*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (950)" },
- /*1012*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9500)" },
- /*1013*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*1014*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (96)" },
- /*1015*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (960)" },
- /*1016*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9600)" },
- /*1017*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*1018*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (97)" },
- /*1019*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (970)" },
- /*1020*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9700)" },
- /*1021*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*1022*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (98)" },
- /*1023*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (980)" },
- /*1024*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9800)" },
- /*1025*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "" },
- /*1026*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (99)" },
- /*1027*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (990)" },
- /*1028*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9900)" },
- /*1029*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9999)" },
- /*1030*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101", "261: AI (01) position 14: Bad checksum '4', expected '1'" },
- /*1031*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101", "" },
- /*1032*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890\0350112345678901234", "261: AI (01) position 14: Bad checksum '4', expected '1'" },
- /*1033*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890\0350112345678901231", "" },
- /*1034*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234\035390112345678901234\0352012", "261: AI (253) position 13: Bad checksum '3', expected '8'" },
- /*1035*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284\035390112345678901234\0352012", "" },
- /*1036*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234\0350112345678901234390112345678901234\0352012", "261: AI (01) position 14: Bad checksum '4', expected '1'" },
- /*1037*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284\0350112345678901231390112345678901234\0352012", "" },
- /*1038*/ { "[01]12345678901231[0A]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "", "257: Invalid AI at position 19 in input (non-numeric characters in AI)" },
- /*1039*/ { "[01]12345678901231[0]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 19 in input (AI too short)" },
- /*1040*/ { "[01]12345678901231[]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 19 in input (AI too short)" },
+ /* 0*/ { -1, "", ZINT_ERROR_INVALID_DATA, "", "252: Data does not start with an AI", "" },
+ /* 1*/ { -1, "[", ZINT_ERROR_INVALID_DATA, "", "253: Malformed AI in input (brackets don't match)", "" },
+ /* 2*/ { -1, "[]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 1 in input (AI too short)", "" },
+ /* 3*/ { -1, "[1]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 1 in input (AI too short)", "" },
+ /* 4*/ { -1, "[242]123456[1]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 12 in input (AI too short)", "" },
+ /* 5*/ { -1, "[12345]12", ZINT_ERROR_INVALID_DATA, "", "255: Invalid AI at position 1 in input (AI too long)", "" },
+ /* 6*/ { -1, "[20]12[12345]12", ZINT_ERROR_INVALID_DATA, "", "255: Invalid AI at position 7 in input (AI too long)", "" },
+ /* 7*/ { -1, "[9999]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9999) at position 1", "" },
+ /* 8*/ { -1, "[[01]]1234", ZINT_ERROR_INVALID_DATA, "", "254: Found nested brackets in input", "" },
+ /* 9*/ { -1, "[1A]12", ZINT_ERROR_INVALID_DATA, "", "257: Invalid AI at position 1 in input (non-numeric characters in AI)", "" },
+ /* 10*/ { -1, "^1A12", ZINT_ERROR_INVALID_DATA, "", "857: Invalid AI at position 2", "" },
+ /* 11*/ { GS1RAW_MODE, "1A12", ZINT_ERROR_INVALID_DATA, "", "857: Invalid AI at position 1", "" },
+ /* 12*/ { -1, "[10]", ZINT_ERROR_INVALID_DATA, "", "258: Empty data field for AI (10) at position 1", "" },
+ /* 13*/ { -1, "[90]\012", ZINT_ERROR_INVALID_DATA, "", "251: Control characters are not supported by GS1", "" },
+ /* 14*/ { -1, "^90\012", ZINT_ERROR_INVALID_DATA, "", "251: Control characters are not supported by GS1", "" },
+ /* 15*/ { GS1RAW_MODE, "90\012", ZINT_ERROR_INVALID_DATA, "", "251: Control characters are not supported by GS1", "" },
+ /* 16*/ { -1, "[90]\035", ZINT_ERROR_INVALID_DATA, "", "251: Control characters are not supported by GS1", "" },
+ /* 17*/ { -1, "^90\035", ZINT_ERROR_INVALID_DATA, "", "251: Control characters are not supported by GS1", "" },
+ /* 18*/ { GS1RAW_MODE, "90\035", ZINT_ERROR_INVALID_DATA, "", "858: Empty data field for AI (90) at position 1", "Treats as separator (& allowing redundant one at end)" },
+ /* 19*/ { GS1RAW_MODE, "901\035", 0, "901", "", "" },
+ /* 20*/ { -1, "[90]\177", ZINT_ERROR_INVALID_DATA, "", "263: DEL characters are not supported by GS1", "" },
+ /* 21*/ { -1, "^90\177", ZINT_ERROR_INVALID_DATA, "", "263: DEL characters are not supported by GS1", "" },
+ /* 22*/ { GS1RAW_MODE, "90\177", ZINT_ERROR_INVALID_DATA, "", "263: DEL characters are not supported by GS1", "" },
+ /* 23*/ { -1, "[90]\200", ZINT_ERROR_INVALID_DATA, "", "250: Extended ASCII characters are not supported by GS1", "" },
+ /* 24*/ { -1, "^90\200", ZINT_ERROR_INVALID_DATA, "", "250: Extended ASCII characters are not supported by GS1", "" },
+ /* 25*/ { GS1RAW_MODE, "90\200", ZINT_ERROR_INVALID_DATA, "", "250: Extended ASCII characters are not supported by GS1", "" },
+ /* 26*/ { -1, "[00]123456789012345678", ZINT_WARN_NONCOMPLIANT, "00123456789012345678", "261: AI (00) data position 18: Bad checksum '8', expected '5'", "" },
+ /* 27*/ { -1, "[00]123456789012345675", 0, "00123456789012345675", "", "" },
+ /* 28*/ { -1, "[00]12345678901234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (00) at position 1", "" },
+ /* 29*/ { -1, "[00]1234567890123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (00) at position 1", "" },
+ /* 30*/ { -1, "[00]376104250021234569", 0, "00376104250021234569", "", "" },
+ /* 31*/ { -1, "[00]376104250021234568", ZINT_WARN_NONCOMPLIANT, "00376104250021234568", "261: AI (00) data position 18: Bad checksum '8', expected '9'", "" },
+ /* 32*/ { -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "0112345678901234", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /* 33*/ { -1, "[01]12345678901231", 0, "0112345678901231", "", "" },
+ /* 34*/ { -1, "[01]123456789012345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (01) at position 1", "" },
+ /* 35*/ { -1, "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, "0212345678901234", "261: AI (02) data position 14: Bad checksum '4', expected '1'", "" },
+ /* 36*/ { -1, "[02]12345678901231", 0, "0212345678901231", "", "" },
+ /* 37*/ { -1, "[02]1234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (02) at position 1", "" },
+ /* 38*/ { -1, "[03]12345678901234", ZINT_WARN_NONCOMPLIANT, "0312345678901234", "261: AI (03) data position 14: Bad checksum '4', expected '1'", "" },
+ /* 39*/ { -1, "[03]12345678901231", 0, "0312345678901231", "", "" },
+ /* 40*/ { -1, "[03]1234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (03) at position 1", "" },
+ /* 41*/ { -1, "[04]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (04) at position 1", "" },
+ /* 42*/ { -1, "[05]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (05) at position 1", "" },
+ /* 43*/ { -1, "[06]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (06) at position 1", "" },
+ /* 44*/ { -1, "[07]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (07) at position 1", "" },
+ /* 45*/ { -1, "[08]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (08) at position 1", "" },
+ /* 46*/ { -1, "[09]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (09) at position 1", "" },
+ /* 47*/ { -1, "[10]ABCD123456", 0, "10ABCD123456", "", "" },
+ /* 48*/ { -1, "[10]123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (10) at position 1", "" },
+ /* 49*/ { -1, "[100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (100) at position 1", "" },
+ /* 50*/ { -1, "[1000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1000) at position 1", "" },
+ /* 51*/ { -1, "[11]990102", 0, "11990102", "", "" },
+ /* 52*/ { -1, "[11]9901023", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (11) at position 1", "" },
+ /* 53*/ { -1, "[110]990102", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (110) at position 1", "" },
+ /* 54*/ { -1, "[1100]990102", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1100) at position 1", "" },
+ /* 55*/ { -1, "[12]000100", 0, "12000100", "", "" },
+ /* 56*/ { -1, "[12]00010", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (12) at position 1", "" },
+ /* 57*/ { -1, "[120]000100", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (120) at position 1", "" },
+ /* 58*/ { -1, "[1200]000100", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1200) at position 1", "" },
+ /* 59*/ { -1, "[13]991301", ZINT_WARN_NONCOMPLIANT, "13991301", "261: AI (13) data position 3: Invalid month '13'", "" },
+ /* 60*/ { -1, "[13]991201", 0, "13991201", "", "" },
+ /* 61*/ { -1, "[13]9913011", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (13) at position 1", "" },
+ /* 62*/ { -1, "[130]991301", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (130) at position 1", "" },
+ /* 63*/ { -1, "[1300]991301", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1300) at position 1", "" },
+ /* 64*/ { -1, "[14]991201", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (14) at position 1", "" },
+ /* 65*/ { -1, "[140]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (140) at position 1", "" },
+ /* 66*/ { -1, "[1400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1400) at position 1", "" },
+ /* 67*/ { -1, "[15]021231", 0, "15021231", "", "" },
+ /* 68*/ { -1, "[15]02123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (15) at position 1", "" },
+ /* 69*/ { -1, "[150]021231", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (150) at position 1", "" },
+ /* 70*/ { -1, "[1500]021231", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1500) at position 1", "" },
+ /* 71*/ { -1, "[16]000000", ZINT_WARN_NONCOMPLIANT, "16000000", "261: AI (16) data position 3: Invalid month '00'", "" },
+ /* 72*/ { -1, "[16]000100", 0, "16000100", "", "" },
+ /* 73*/ { -1, "[16]00000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (16) at position 1", "" },
+ /* 74*/ { -1, "[160]000000", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (160) at position 1", "" },
+ /* 75*/ { -1, "[1600]000000", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1600) at position 1", "" },
+ /* 76*/ { -1, "[17]010200", 0, "17010200", "", "" },
+ /* 77*/ { -1, "[17]0102000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (17) at position 1", "" },
+ /* 78*/ { -1, "[170]010200", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (170) at position 1", "" },
+ /* 79*/ { -1, "[1700]010200", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1700) at position 1", "" },
+ /* 80*/ { -1, "[18]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (18) at position 1", "" },
+ /* 81*/ { -1, "[180]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (180) at position 1", "" },
+ /* 82*/ { -1, "[1800]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1800) at position 1", "" },
+ /* 83*/ { -1, "[19]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (19) at position 1", "" },
+ /* 84*/ { -1, "[190]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (190) at position 1", "" },
+ /* 85*/ { -1, "[1900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (1900) at position 1", "" },
+ /* 86*/ { -1, "[20]12", 0, "2012", "", "" },
+ /* 87*/ { -1, "[20]1", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (20) at position 1", "" },
+ /* 88*/ { -1, "[200]12", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (200) at position 1", "" },
+ /* 89*/ { -1, "[2000]12", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2000) at position 1", "" },
+ /* 90*/ { -1, "[21]A12345678", 0, "21A12345678", "", "" },
+ /* 91*/ { -1, "[21]123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (21) at position 1", "" },
+ /* 92*/ { -1, "[210]A12345678", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (210) at position 1", "" },
+ /* 93*/ { -1, "[2100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2100) at position 1", "" },
+ /* 94*/ { -1, "[22]abcdefghijklmnopqrst", 0, "22abcdefghijklmnopqrst", "", "" },
+ /* 95*/ { -1, "[22]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (22) at position 1", "" },
+ /* 96*/ { -1, "[220]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (220) at position 1", "" },
+ /* 97*/ { -1, "[2200]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2200) at position 1", "" },
+ /* 98*/ { -1, "[23]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (23) at position 1", "" },
+ /* 99*/ { -1, "^231234", ZINT_ERROR_INVALID_DATA, "", "856: Invalid AI (23) at position 2", "" },
+ /*100*/ { GS1RAW_MODE, "231234", ZINT_ERROR_INVALID_DATA, "", "856: Invalid AI (23) at position 1", "" },
+ /*101*/ { -1, "[230]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (230) at position 1", "" },
+ /*102*/ { -1, "[2300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2300) at position 1", "" },
+ /*103*/ { -1, "[235]1abcdefghijklmnopqrstuvwxyz0", 0, "2351abcdefghijklmnopqrstuvwxyz0", "", "" },
+ /*104*/ { -1, "^2351abcdefghijklmnopqrstuvwxyz0", 0, "2351abcdefghijklmnopqrstuvwxyz0", "", "" },
+ /*105*/ { GS1RAW_MODE, "2351abcdefghijklmnopqrstuvwxyz0", 0, "2351abcdefghijklmnopqrstuvwxyz0", "", "" },
+ /*106*/ { -1, "[235]1abcdefghijklmnopqrstuvwxyz01", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (235) at position 1", "" },
+ /*107*/ { -1, "^2351abcdefghijklmnopqrstuvwxyz01", ZINT_ERROR_INVALID_DATA, "", "859: Invalid data length for AI (235) at position 2", "" },
+ /*108*/ { GS1RAW_MODE, "2351abcdefghijklmnopqrstuvwxyz01", ZINT_ERROR_INVALID_DATA, "", "859: Invalid data length for AI (235) at position 1", "" },
+ /*109*/ { -1, "[24]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (24) at position 1", "" },
+ /*110*/ { -1, "^241234", 0, "241234", "", "Interpreted as valid AI [241]" },
+ /*111*/ { GS1RAW_MODE, "241234", 0, "241234", "", "" },
+ /*112*/ { -1, "[240]abcdefghijklmnopqrstuvwxyz1234", 0, "240abcdefghijklmnopqrstuvwxyz1234", "", "" },
+ /*113*/ { -1, "[240]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (240) at position 1", "" },
+ /*114*/ { -1, "[2400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2400) at position 1", "" },
+ /*115*/ { -1, "[241]abcdefghijklmnopqrstuvwxyz1234", 0, "241abcdefghijklmnopqrstuvwxyz1234", "", "" },
+ /*116*/ { -1, "[241]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (241) at position 1", "" },
+ /*117*/ { -1, "[2410]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2410) at position 1", "" },
+ /*118*/ { -1, "[242]12345", 0, "24212345", "", "" },
+ /*119*/ { -1, "[242]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (242) at position 1", "" },
+ /*120*/ { -1, "[2420]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2420) at position 1", "" },
+ /*121*/ { -1, "[243]abcdefghijklmnopqrst", 0, "243abcdefghijklmnopqrst", "", "" },
+ /*122*/ { -1, "[243]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (243) at position 1", "" },
+ /*123*/ { -1, "[2430]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2430) at position 1", "" },
+ /*124*/ { -1, "[244]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (244) at position 1", "" },
+ /*125*/ { -1, "[2440]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2440) at position 1", "" },
+ /*126*/ { -1, "[249]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (249) at position 1", "" },
+ /*127*/ { -1, "[2490]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2490) at position 1", "" },
+ /*128*/ { -1, "[25]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (25) at position 1", "" },
+ /*129*/ { -1, "[250]abcdefghijklmnopqrstuvwxyz1234", 0, "250abcdefghijklmnopqrstuvwxyz1234", "", "" },
+ /*130*/ { -1, "[250]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (250) at position 1", "" },
+ /*131*/ { -1, "[2500]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2500) at position 1", "" },
+ /*132*/ { -1, "[251]abcdefghijklmnopqrstuvwxyz1234", 0, "251abcdefghijklmnopqrstuvwxyz1234", "", "" },
+ /*133*/ { -1, "[251]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (251) at position 1", "" },
+ /*134*/ { -1, "[2510]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2510) at position 1", "" },
+ /*135*/ { -1, "[252]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (252) at position 1", "" },
+ /*136*/ { -1, "[2520]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2520) at position 1", "" },
+ /*137*/ { -1, "[253]131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (253) at position 1", "" },
+ /*138*/ { -1, "[253]1313131313134", ZINT_WARN_NONCOMPLIANT, "2531313131313134", "261: AI (253) data position 13: Bad checksum '4', expected '0'", "" },
+ /*139*/ { -1, "[253]1313131313130", 0, "2531313131313130", "", "" },
+ /*140*/ { -1, "[253]131313131313412345678901234567", ZINT_WARN_NONCOMPLIANT, "253131313131313412345678901234567", "261: AI (253) data position 13: Bad checksum '4', expected '0'", "" },
+ /*141*/ { -1, "[253]131313131313012345678901234567", 0, "253131313131313012345678901234567", "", "" },
+ /*142*/ { -1, "[253]1313131313134123456789012345678", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (253) at position 1", "" },
+ /*143*/ { -1, "[2530]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2530) at position 1", "" },
+ /*144*/ { -1, "[254]abcdefghijklmnopqrst", 0, "254abcdefghijklmnopqrst", "", "" },
+ /*145*/ { -1, "[254]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (254) at position 1", "" },
+ /*146*/ { -1, "[2540]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2540) at position 1", "" },
+ /*147*/ { -1, "[255]131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (255) at position 1", "" },
+ /*148*/ { -1, "[255]1313131313134", ZINT_WARN_NONCOMPLIANT, "2551313131313134", "261: AI (255) data position 13: Bad checksum '4', expected '0'", "" },
+ /*149*/ { -1, "[255]1313131313130", 0, "2551313131313130", "", "" },
+ /*150*/ { -1, "[255]1313131313134123456789012", ZINT_WARN_NONCOMPLIANT, "2551313131313134123456789012", "261: AI (255) data position 13: Bad checksum '4', expected '0'", "" },
+ /*151*/ { -1, "[255]1313131313130123456789012", 0, "2551313131313130123456789012", "", "" },
+ /*152*/ { -1, "[255]13131313131341234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (255) at position 1", "" },
+ /*153*/ { -1, "[2550]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2550) at position 1", "" },
+ /*154*/ { -1, "[256]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (256) at position 1", "" },
+ /*155*/ { -1, "[2560]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2560) at position 1", "" },
+ /*156*/ { -1, "[259]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (259) at position 1", "" },
+ /*157*/ { -1, "[2590]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2590) at position 1", "" },
+ /*158*/ { -1, "[26]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (26) at position 1", "" },
+ /*159*/ { -1, "[260]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (260) at position 1", "" },
+ /*160*/ { -1, "[2600]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2600) at position 1", "" },
+ /*161*/ { -1, "[27]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (27) at position 1", "" },
+ /*162*/ { -1, "[270]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (270) at position 1", "" },
+ /*163*/ { -1, "[2700]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2700) at position 1", "" },
+ /*164*/ { -1, "[28]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (28) at position 1", "" },
+ /*165*/ { -1, "[280]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (280) at position 1", "" },
+ /*166*/ { -1, "[2800]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2800) at position 1", "" },
+ /*167*/ { -1, "[29]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (29) at position 1", "" },
+ /*168*/ { -1, "[290]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (290) at position 1", "" },
+ /*169*/ { -1, "[2900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (2900) at position 1", "" },
+ /*170*/ { -1, "[30]12345678", 0, "3012345678", "", "" },
+ /*171*/ { -1, "[30]123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (30) at position 1", "" },
+ /*172*/ { -1, "[300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (300) at position 1", "" },
+ /*173*/ { -1, "[3000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3000) at position 1", "" },
+ /*174*/ { -1, "[31]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (31) at position 1", "" },
+ /*175*/ { -1, "[310]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (310) at position 1", "" },
+ /*176*/ { -1, "[3100]123456", 0, "3100123456", "", "" },
+ /*177*/ { -1, "[3100]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3100) at position 1", "" },
+ /*178*/ { -1, "[3101]123456", 0, "3101123456", "", "" },
+ /*179*/ { -1, "[3101]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3101) at position 1", "" },
+ /*180*/ { -1, "[3105]123456", 0, "3105123456", "", "" },
+ /*181*/ { -1, "[3105]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3105) at position 1", "" },
+ /*182*/ { -1, "[3106]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3106) at position 1", "" },
+ /*183*/ { -1, "[3109]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3109) at position 1", "" },
+ /*184*/ { -1, "[3110]123456", 0, "3110123456", "", "" },
+ /*185*/ { -1, "[3110]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3110) at position 1", "" },
+ /*186*/ { -1, "[3115]123456", 0, "3115123456", "", "" },
+ /*187*/ { -1, "[3115]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3115) at position 1", "" },
+ /*188*/ { -1, "[3116]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3116) at position 1", "" },
+ /*189*/ { -1, "[3119]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3119) at position 1", "" },
+ /*190*/ { -1, "[3120]123456", 0, "3120123456", "", "" },
+ /*191*/ { -1, "[3120]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3120) at position 1", "" },
+ /*192*/ { -1, "[3125]123456", 0, "3125123456", "", "" },
+ /*193*/ { -1, "[3125]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3125) at position 1", "" },
+ /*194*/ { -1, "[3126]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3126) at position 1", "" },
+ /*195*/ { -1, "[3129]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3129) at position 1", "" },
+ /*196*/ { -1, "[3130]123456", 0, "3130123456", "", "" },
+ /*197*/ { -1, "[3130]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3130) at position 1", "" },
+ /*198*/ { -1, "[3135]123456", 0, "3135123456", "", "" },
+ /*199*/ { -1, "[3135]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3135) at position 1", "" },
+ /*200*/ { -1, "[3136]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3136) at position 1", "" },
+ /*201*/ { -1, "[3139]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3139) at position 1", "" },
+ /*202*/ { -1, "[3140]123456", 0, "3140123456", "", "" },
+ /*203*/ { -1, "[3140]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3140) at position 1", "" },
+ /*204*/ { -1, "[3145]123456", 0, "3145123456", "", "" },
+ /*205*/ { -1, "[3145]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3145) at position 1", "" },
+ /*206*/ { -1, "[3146]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3146) at position 1", "" },
+ /*207*/ { -1, "[3149]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3149) at position 1", "" },
+ /*208*/ { -1, "[3150]123456", 0, "3150123456", "", "" },
+ /*209*/ { -1, "[3150]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3150) at position 1", "" },
+ /*210*/ { -1, "[3155]123456", 0, "3155123456", "", "" },
+ /*211*/ { -1, "[3155]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3155) at position 1", "" },
+ /*212*/ { -1, "[3156]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3156) at position 1", "" },
+ /*213*/ { -1, "[3159]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3159) at position 1", "" },
+ /*214*/ { -1, "[3160]123456", 0, "3160123456", "", "" },
+ /*215*/ { -1, "[3160]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3160) at position 1", "" },
+ /*216*/ { -1, "[3165]123456", 0, "3165123456", "", "" },
+ /*217*/ { -1, "[3165]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3165) at position 1", "" },
+ /*218*/ { -1, "[3166]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3166) at position 1", "" },
+ /*219*/ { -1, "[3169]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3169) at position 1", "" },
+ /*220*/ { -1, "[3170]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3170) at position 1", "" },
+ /*221*/ { -1, "[3179]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3179) at position 1", "" },
+ /*222*/ { -1, "[3180]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3180) at position 1", "" },
+ /*223*/ { -1, "[3189]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3189) at position 1", "" },
+ /*224*/ { -1, "[3190]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3190) at position 1", "" },
+ /*225*/ { -1, "[3199]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3199) at position 1", "" },
+ /*226*/ { -1, "[32]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (32) at position 1", "" },
+ /*227*/ { -1, "[320]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (320) at position 1", "" },
+ /*228*/ { -1, "[3200]123456", 0, "3200123456", "", "" },
+ /*229*/ { -1, "[3200]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3200) at position 1", "" },
+ /*230*/ { -1, "[3205]123456", 0, "3205123456", "", "" },
+ /*231*/ { -1, "[3205]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3205) at position 1", "" },
+ /*232*/ { -1, "[3206]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3206) at position 1", "" },
+ /*233*/ { -1, "[3209]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3209) at position 1", "" },
+ /*234*/ { -1, "[3210]123456", 0, "3210123456", "", "" },
+ /*235*/ { -1, "[3210]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3210) at position 1", "" },
+ /*236*/ { -1, "[3215]123456", 0, "3215123456", "", "" },
+ /*237*/ { -1, "[3215]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3215) at position 1", "" },
+ /*238*/ { -1, "[3216]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3216) at position 1", "" },
+ /*239*/ { -1, "[3219]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3219) at position 1", "" },
+ /*240*/ { -1, "[3220]123456", 0, "3220123456", "", "" },
+ /*241*/ { -1, "[3220]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3220) at position 1", "" },
+ /*242*/ { -1, "[3225]123456", 0, "3225123456", "", "" },
+ /*243*/ { -1, "[3225]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3225) at position 1", "" },
+ /*244*/ { -1, "[3229]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3229) at position 1", "" },
+ /*245*/ { -1, "[3230]123456", 0, "3230123456", "", "" },
+ /*246*/ { -1, "[3230]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3230) at position 1", "" },
+ /*247*/ { -1, "[3235]123456", 0, "3235123456", "", "" },
+ /*248*/ { -1, "[3235]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3235) at position 1", "" },
+ /*249*/ { -1, "[3239]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3239) at position 1", "" },
+ /*250*/ { -1, "[3240]123456", 0, "3240123456", "", "" },
+ /*251*/ { -1, "[3240]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3240) at position 1", "" },
+ /*252*/ { -1, "[3245]123456", 0, "3245123456", "", "" },
+ /*253*/ { -1, "[3245]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3245) at position 1", "" },
+ /*254*/ { -1, "[3249]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3249) at position 1", "" },
+ /*255*/ { -1, "[3250]123456", 0, "3250123456", "", "" },
+ /*256*/ { -1, "[3250]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3250) at position 1", "" },
+ /*257*/ { -1, "[3255]123456", 0, "3255123456", "", "" },
+ /*258*/ { -1, "[3255]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3255) at position 1", "" },
+ /*259*/ { -1, "[3259]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3259) at position 1", "" },
+ /*260*/ { -1, "[3260]123456", 0, "3260123456", "", "" },
+ /*261*/ { -1, "[3260]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3260) at position 1", "" },
+ /*262*/ { -1, "[3265]123456", 0, "3265123456", "", "" },
+ /*263*/ { -1, "[3265]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3265) at position 1", "" },
+ /*264*/ { -1, "[3269]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3269) at position 1", "" },
+ /*265*/ { -1, "[3270]123456", 0, "3270123456", "", "" },
+ /*266*/ { -1, "[3270]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3270) at position 1", "" },
+ /*267*/ { -1, "[3275]123456", 0, "3275123456", "", "" },
+ /*268*/ { -1, "[3275]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3275) at position 1", "" },
+ /*269*/ { -1, "[3279]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3279) at position 1", "" },
+ /*270*/ { -1, "[3280]123456", 0, "3280123456", "", "" },
+ /*271*/ { -1, "[3280]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3280) at position 1", "" },
+ /*272*/ { -1, "[3285]123456", 0, "3285123456", "", "" },
+ /*273*/ { -1, "[3285]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3285) at position 1", "" },
+ /*274*/ { -1, "[3289]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3289) at position 1", "" },
+ /*275*/ { -1, "[3290]123456", 0, "3290123456", "", "" },
+ /*276*/ { -1, "[3290]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3290) at position 1", "" },
+ /*277*/ { -1, "[3295]123456", 0, "3295123456", "", "" },
+ /*278*/ { -1, "[3295]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3295) at position 1", "" },
+ /*279*/ { -1, "[3296]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3296) at position 1", "" },
+ /*280*/ { -1, "[3299]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3299) at position 1", "" },
+ /*281*/ { -1, "[33]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (33) at position 1", "" },
+ /*282*/ { -1, "[330]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (330) at position 1", "" },
+ /*283*/ { -1, "[3300]123456", 0, "3300123456", "", "" },
+ /*284*/ { -1, "[3300]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3300) at position 1", "" },
+ /*285*/ { -1, "[3305]123456", 0, "3305123456", "", "" },
+ /*286*/ { -1, "[3305]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3305) at position 1", "" },
+ /*287*/ { -1, "[3306]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3306) at position 1", "" },
+ /*288*/ { -1, "[3309]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3309) at position 1", "" },
+ /*289*/ { -1, "[3310]123456", 0, "3310123456", "", "" },
+ /*290*/ { -1, "[3310]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3310) at position 1", "" },
+ /*291*/ { -1, "[3319]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3319) at position 1", "" },
+ /*292*/ { -1, "[3320]123456", 0, "3320123456", "", "" },
+ /*293*/ { -1, "[3320]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3320) at position 1", "" },
+ /*294*/ { -1, "[3329]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3329) at position 1", "" },
+ /*295*/ { -1, "[3330]123456", 0, "3330123456", "", "" },
+ /*296*/ { -1, "[3330]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3330) at position 1", "" },
+ /*297*/ { -1, "[3339]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3339) at position 1", "" },
+ /*298*/ { -1, "[3340]123456", 0, "3340123456", "", "" },
+ /*299*/ { -1, "[3340]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3340) at position 1", "" },
+ /*300*/ { -1, "[3349]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3349) at position 1", "" },
+ /*301*/ { -1, "[3350]123456", 0, "3350123456", "", "" },
+ /*302*/ { -1, "[3350]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3350) at position 1", "" },
+ /*303*/ { -1, "[3359]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3359) at position 1", "" },
+ /*304*/ { -1, "[3360]123456", 0, "3360123456", "", "" },
+ /*305*/ { -1, "[3360]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3360) at position 1", "" },
+ /*306*/ { -1, "[3369]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3369) at position 1", "" },
+ /*307*/ { -1, "[3370]123456", 0, "3370123456", "", "" },
+ /*308*/ { -1, "[3370]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3370) at position 1", "" },
+ /*309*/ { -1, "[3375]123456", 0, "3375123456", "", "" },
+ /*310*/ { -1, "[3375]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3375) at position 1", "" },
+ /*311*/ { -1, "[3376]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3376) at position 1", "" },
+ /*312*/ { -1, "[3379]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3379) at position 1", "" },
+ /*313*/ { -1, "[3380]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3380) at position 1", "" },
+ /*314*/ { -1, "[3390]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3390) at position 1", "" },
+ /*315*/ { -1, "[3399]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3399) at position 1", "" },
+ /*316*/ { -1, "[34]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (34) at position 1", "" },
+ /*317*/ { -1, "[340]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (340) at position 1", "" },
+ /*318*/ { -1, "[3400]123456", 0, "3400123456", "", "" },
+ /*319*/ { -1, "[3400]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3400) at position 1", "" },
+ /*320*/ { -1, "[3405]123456", 0, "3405123456", "", "" },
+ /*321*/ { -1, "[3405]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3405) at position 1", "" },
+ /*322*/ { -1, "[3406]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3406) at position 1", "" },
+ /*323*/ { -1, "[3409]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3409) at position 1", "" },
+ /*324*/ { -1, "[3410]123456", 0, "3410123456", "", "" },
+ /*325*/ { -1, "[3410]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3410) at position 1", "" },
+ /*326*/ { -1, "[3419]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3419) at position 1", "" },
+ /*327*/ { -1, "[3420]123456", 0, "3420123456", "", "" },
+ /*328*/ { -1, "[3420]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3420) at position 1", "" },
+ /*329*/ { -1, "[3429]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3429) at position 1", "" },
+ /*330*/ { -1, "[3430]123456", 0, "3430123456", "", "" },
+ /*331*/ { -1, "[3430]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3430) at position 1", "" },
+ /*332*/ { -1, "[3439]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3439) at position 1", "" },
+ /*333*/ { -1, "[3440]123456", 0, "3440123456", "", "" },
+ /*334*/ { -1, "[3440]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3440) at position 1", "" },
+ /*335*/ { -1, "[3449]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3449) at position 1", "" },
+ /*336*/ { -1, "[3450]123456", 0, "3450123456", "", "" },
+ /*337*/ { -1, "[3450]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3450) at position 1", "" },
+ /*338*/ { -1, "[3459]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3459) at position 1", "" },
+ /*339*/ { -1, "[3460]123456", 0, "3460123456", "", "" },
+ /*340*/ { -1, "[3460]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3460) at position 1", "" },
+ /*341*/ { -1, "[3469]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3469) at position 1", "" },
+ /*342*/ { -1, "[3470]123456", 0, "3470123456", "", "" },
+ /*343*/ { -1, "[3470]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3470) at position 1", "" },
+ /*344*/ { -1, "[3479]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3479) at position 1", "" },
+ /*345*/ { -1, "[3480]123456", 0, "3480123456", "", "" },
+ /*346*/ { -1, "[3480]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3480) at position 1", "" },
+ /*347*/ { -1, "[3489]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3489) at position 1", "" },
+ /*348*/ { -1, "[3490]123456", 0, "3490123456", "", "" },
+ /*349*/ { -1, "[3490]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3490) at position 1", "" },
+ /*350*/ { -1, "[3495]123456", 0, "3495123456", "", "" },
+ /*351*/ { -1, "[3495]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3495) at position 1", "" },
+ /*352*/ { -1, "[3496]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3496) at position 1", "" },
+ /*353*/ { -1, "[3499]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3499) at position 1", "" },
+ /*354*/ { -1, "[35]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (35) at position 1", "" },
+ /*355*/ { -1, "[350]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (350) at position 1", "" },
+ /*356*/ { -1, "[3500]123456", 0, "3500123456", "", "" },
+ /*357*/ { -1, "[3500]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3500) at position 1", "" },
+ /*358*/ { -1, "[3505]123456", 0, "3505123456", "", "" },
+ /*359*/ { -1, "[3505]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3505) at position 1", "" },
+ /*360*/ { -1, "[3506]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3506) at position 1", "" },
+ /*361*/ { -1, "[3509]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3509) at position 1", "" },
+ /*362*/ { -1, "[3510]123456", 0, "3510123456", "", "" },
+ /*363*/ { -1, "[3510]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3510) at position 1", "" },
+ /*364*/ { -1, "[3519]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3519) at position 1", "" },
+ /*365*/ { -1, "[3520]123456", 0, "3520123456", "", "" },
+ /*366*/ { -1, "[3520]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3520) at position 1", "" },
+ /*367*/ { -1, "[3529]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3529) at position 1", "" },
+ /*368*/ { -1, "[3530]123456", 0, "3530123456", "", "" },
+ /*369*/ { -1, "[3530]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3530) at position 1", "" },
+ /*370*/ { -1, "[3539]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3539) at position 1", "" },
+ /*371*/ { -1, "[3540]123456", 0, "3540123456", "", "" },
+ /*372*/ { -1, "[3540]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3540) at position 1", "" },
+ /*373*/ { -1, "[3549]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3549) at position 1", "" },
+ /*374*/ { -1, "[3550]123456", 0, "3550123456", "", "" },
+ /*375*/ { -1, "[3550]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3550) at position 1", "" },
+ /*376*/ { -1, "[3559]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3559) at position 1", "" },
+ /*377*/ { -1, "[3560]123456", 0, "3560123456", "", "" },
+ /*378*/ { -1, "[3560]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3560) at position 1", "" },
+ /*379*/ { -1, "[3569]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3569) at position 1", "" },
+ /*380*/ { -1, "[3570]123456", 0, "3570123456", "", "" },
+ /*381*/ { -1, "[3570]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3570) at position 1", "" },
+ /*382*/ { -1, "[3575]123456", 0, "3575123456", "", "" },
+ /*383*/ { -1, "[3376]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3376) at position 1", "" },
+ /*384*/ { -1, "[3579]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3579) at position 1", "" },
+ /*385*/ { -1, "[3580]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3580) at position 1", "" },
+ /*386*/ { -1, "[3590]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3590) at position 1", "" },
+ /*387*/ { -1, "[3599]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3599) at position 1", "" },
+ /*388*/ { -1, "[36]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (36) at position 1", "" },
+ /*389*/ { -1, "[360]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (360) at position 1", "" },
+ /*390*/ { -1, "[3600]123456", 0, "3600123456", "", "" },
+ /*391*/ { -1, "[3600]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3600) at position 1", "" },
+ /*392*/ { -1, "[3605]123456", 0, "3605123456", "", "" },
+ /*393*/ { -1, "[3605]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3605) at position 1", "" },
+ /*394*/ { -1, "[3606]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3606) at position 1", "" },
+ /*395*/ { -1, "[3609]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3609) at position 1", "" },
+ /*396*/ { -1, "[3610]123456", 0, "3610123456", "", "" },
+ /*397*/ { -1, "[3610]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3610) at position 1", "" },
+ /*398*/ { -1, "[3619]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3619) at position 1", "" },
+ /*399*/ { -1, "[3620]123456", 0, "3620123456", "", "" },
+ /*400*/ { -1, "[3620]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3620) at position 1", "" },
+ /*401*/ { -1, "[3629]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3629) at position 1", "" },
+ /*402*/ { -1, "[3630]123456", 0, "3630123456", "", "" },
+ /*403*/ { -1, "[3630]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3630) at position 1", "" },
+ /*404*/ { -1, "[3639]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3639) at position 1", "" },
+ /*405*/ { -1, "[3640]123456", 0, "3640123456", "", "" },
+ /*406*/ { -1, "[3640]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3640) at position 1", "" },
+ /*407*/ { -1, "[3649]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3649) at position 1", "" },
+ /*408*/ { -1, "[3650]123456", 0, "3650123456", "", "" },
+ /*409*/ { -1, "[3650]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3650) at position 1", "" },
+ /*410*/ { -1, "[3659]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3659) at position 1", "" },
+ /*411*/ { -1, "[3660]123456", 0, "3660123456", "", "" },
+ /*412*/ { -1, "[3660]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3660) at position 1", "" },
+ /*413*/ { -1, "[3669]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3669) at position 1", "" },
+ /*414*/ { -1, "[3670]123456", 0, "3670123456", "", "" },
+ /*415*/ { -1, "[3670]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3670) at position 1", "" },
+ /*416*/ { -1, "[3679]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3679) at position 1", "" },
+ /*417*/ { -1, "[3680]123456", 0, "3680123456", "", "" },
+ /*418*/ { -1, "[3680]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3680) at position 1", "" },
+ /*419*/ { -1, "[3689]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3689) at position 1", "" },
+ /*420*/ { -1, "[3690]123456", 0, "3690123456", "", "" },
+ /*421*/ { -1, "[3690]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3690) at position 1", "" },
+ /*422*/ { -1, "[3695]123456", 0, "3695123456", "", "" },
+ /*423*/ { -1, "[3695]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3695) at position 1", "" },
+ /*424*/ { -1, "[3696]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3696) at position 1", "" },
+ /*425*/ { -1, "[3699]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3699) at position 1", "" },
+ /*426*/ { -1, "[37]12345678", 0, "3712345678", "", "" },
+ /*427*/ { -1, "[37]123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (37) at position 1", "" },
+ /*428*/ { -1, "[370]12345678", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (370) at position 1", "" },
+ /*429*/ { -1, "[3700]12345678", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3700) at position 1", "" },
+ /*430*/ { -1, "[38]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (38) at position 1", "" },
+ /*431*/ { -1, "[380]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (380) at position 1", "" },
+ /*432*/ { -1, "[3800]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3800) at position 1", "" },
+ /*433*/ { -1, "[39]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (39) at position 1", "" },
+ /*434*/ { -1, "[390]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (390) at position 1", "" },
+ /*435*/ { -1, "[3900]123456789012345", 0, "3900123456789012345", "", "" },
+ /*436*/ { -1, "[3900]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3900) at position 1", "" },
+ /*437*/ { -1, "[3900]12345678901234", 0, "390012345678901234", "", "" },
+ /*438*/ { -1, "[3901]123456789012345", 0, "3901123456789012345", "", "" },
+ /*439*/ { -1, "[3901]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3901) at position 1", "" },
+ /*440*/ { -1, "[3905]123456789012345", 0, "3905123456789012345", "", "" },
+ /*441*/ { -1, "[3909]123456789012345", 0, "3909123456789012345", "", "" },
+ /*442*/ { -1, "[3909]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3909) at position 1", "" },
+ /*443*/ { -1, "[3910]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3910123123456789012345", "261: AI (3910) data position 1: Unknown currency code '123'", "" },
+ /*444*/ { -1, "[3910]997123456789012345", 0, "3910997123456789012345", "", "" },
+ /*445*/ { -1, "[3910]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910) at position 1", "" },
+ /*446*/ { -1, "[3910]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910) at position 1", "" },
+ /*447*/ { -1, "[3915]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3915123123456789012345", "261: AI (3915) data position 1: Unknown currency code '123'", "" },
+ /*448*/ { -1, "[3915]997123456789012345", 0, "3915997123456789012345", "", "" },
+ /*449*/ { -1, "[3915]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3915) at position 1", "" },
+ /*450*/ { -1, "[3919]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3919123123456789012345", "261: AI (3919) data position 1: Unknown currency code '123'", "" },
+ /*451*/ { -1, "[3919]997123456789012345", 0, "3919997123456789012345", "", "" },
+ /*452*/ { -1, "[3919]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3919) at position 1", "" },
+ /*453*/ { -1, "[3920]123456789012345", 0, "3920123456789012345", "", "" },
+ /*454*/ { -1, "[3920]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3920) at position 1", "" },
+ /*455*/ { -1, "[3925]123456789012345", 0, "3925123456789012345", "", "" },
+ /*456*/ { -1, "[3925]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3925) at position 1", "" },
+ /*457*/ { -1, "[3929]123456789012345", 0, "3929123456789012345", "", "" },
+ /*458*/ { -1, "[3929]1234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3929) at position 1", "" },
+ /*459*/ { -1, "[3930]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3930123123456789012345", "261: AI (3930) data position 1: Unknown currency code '123'", "" },
+ /*460*/ { -1, "[3930]997123456789012345", 0, "3930997123456789012345", "", "" },
+ /*461*/ { -1, "[3930]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3930) at position 1", "" },
+ /*462*/ { -1, "[3930]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3930) at position 1", "" },
+ /*463*/ { -1, "[3935]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3935123123456789012345", "261: AI (3935) data position 1: Unknown currency code '123'", "" },
+ /*464*/ { -1, "[3935]997123456789012345", 0, "3935997123456789012345", "", "" },
+ /*465*/ { -1, "[3935]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3935) at position 1", "" },
+ /*466*/ { -1, "[3939]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3939123123456789012345", "261: AI (3939) data position 1: Unknown currency code '123'", "" },
+ /*467*/ { -1, "[3939]997123456789012345", 0, "3939997123456789012345", "", "" },
+ /*468*/ { -1, "[3939]1231234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3939) at position 1", "" },
+ /*469*/ { -1, "[3940]1234", 0, "39401234", "", "" },
+ /*470*/ { -1, "[3940]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3940) at position 1", "" },
+ /*471*/ { -1, "[3940]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3940) at position 1", "" },
+ /*472*/ { -1, "[3941]1234", 0, "39411234", "", "" },
+ /*473*/ { -1, "[3941]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3941) at position 1", "" },
+ /*474*/ { -1, "[3941]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3941) at position 1", "" },
+ /*475*/ { -1, "[3942]1234", 0, "39421234", "", "" },
+ /*476*/ { -1, "[3942]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3942) at position 1", "" },
+ /*477*/ { -1, "[3943]1234", 0, "39431234", "", "" },
+ /*478*/ { -1, "[3943]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3943) at position 1", "" },
+ /*479*/ { -1, "[3944]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3944) at position 1", "" },
+ /*480*/ { -1, "[3945]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3945) at position 1", "" },
+ /*481*/ { -1, "[3949]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3949) at position 1", "" },
+ /*482*/ { -1, "[3950]123456", 0, "3950123456", "", "" },
+ /*483*/ { -1, "[3950]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3950) at position 1", "" },
+ /*484*/ { -1, "[3950]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3950) at position 1", "" },
+ /*485*/ { -1, "[3951]123456", 0, "3951123456", "", "" },
+ /*486*/ { -1, "[3951]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3951) at position 1", "" },
+ /*487*/ { -1, "[3952]123456", 0, "3952123456", "", "" },
+ /*488*/ { -1, "[3952]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3952) at position 1", "" },
+ /*489*/ { -1, "[3953]123456", 0, "3953123456", "", "" },
+ /*490*/ { -1, "[3953]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3953) at position 1", "" },
+ /*491*/ { -1, "[3954]123456", 0, "3954123456", "", "" },
+ /*492*/ { -1, "[3954]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3954) at position 1", "" },
+ /*493*/ { -1, "[3955]123456", 0, "3955123456", "", "" },
+ /*494*/ { -1, "[3955]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3955) at position 1", "" },
+ /*495*/ { -1, "[3956]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3956) at position 1", "" },
+ /*496*/ { -1, "[3959]123456", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3959) at position 1", "" },
+ /*497*/ { -1, "[3960]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3960) at position 1", "" },
+ /*498*/ { -1, "[3970]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3970) at position 1", "" },
+ /*499*/ { -1, "[3980]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3980) at position 1", "" },
+ /*500*/ { -1, "[3999]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (3999) at position 1", "" },
+ /*501*/ { -1, "[40]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (40) at position 1", "" },
+ /*502*/ { -1, "[400]123456789012345678901234567890", 0, "400123456789012345678901234567890", "", "" },
+ /*503*/ { -1, "[400]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (400) at position 1", "" },
+ /*504*/ { -1, "[4000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4000) at position 1", "" },
+ /*505*/ { -1, "[401]1234abcdefghijklmnopqrstuvwxyz", 0, "4011234abcdefghijklmnopqrstuvwxyz", "", "" },
+ /*506*/ { -1, "[401]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (401) at position 1", "" },
+ /*507*/ { -1, "[4010]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4010) at position 1", "" },
+ /*508*/ { -1, "[402]13131313131313132", ZINT_WARN_NONCOMPLIANT, "40213131313131313132", "261: AI (402) data position 17: Bad checksum '2', expected '0'", "" },
+ /*509*/ { -1, "[402]13131313131313130", 0, "40213131313131313130", "", "" },
+ /*510*/ { -1, "[402]1313131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (402) at position 1", "" },
+ /*511*/ { -1, "[4020]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4020) at position 1", "" },
+ /*512*/ { -1, "[403]abcdefghijklmnopqrstuvwxyz1234", 0, "403abcdefghijklmnopqrstuvwxyz1234", "", "" },
+ /*513*/ { -1, "[403]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (403) at position 1", "" },
+ /*514*/ { -1, "[4030]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4030) at position 1", "" },
+ /*515*/ { -1, "[404]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (404) at position 1", "" },
+ /*516*/ { -1, "[4040]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4040) at position 1", "" },
+ /*517*/ { -1, "[409]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (409) at position 1", "" },
+ /*518*/ { -1, "[4090]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4090) at position 1", "" },
+ /*519*/ { -1, "[41]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (41) at position 1", "" },
+ /*520*/ { -1, "[410]3898765432108", 0, "4103898765432108", "", "" },
+ /*521*/ { -1, "[410]12345678901234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (410) at position 1", "" },
+ /*522*/ { -1, "[4100]12345678901234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4100) at position 1", "" },
+ /*523*/ { -1, "[411]1313131313134", ZINT_WARN_NONCOMPLIANT, "4111313131313134", "261: AI (411) data position 13: Bad checksum '4', expected '0'", "" },
+ /*524*/ { -1, "[411]1313131313130", 0, "4111313131313130", "", "" },
+ /*525*/ { -1, "[411]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (411) at position 1", "" },
+ /*526*/ { -1, "[4110]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4110) at position 1", "" },
+ /*527*/ { -1, "[412]1313131313130", 0, "4121313131313130", "", "" },
+ /*528*/ { -1, "[412]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (412) at position 1", "" },
+ /*529*/ { -1, "[4120]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4120) at position 1", "" },
+ /*530*/ { -1, "[413]1313131313130", 0, "4131313131313130", "", "" },
+ /*531*/ { -1, "[413]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (413) at position 1", "" },
+ /*532*/ { -1, "[4130]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4130) at position 1", "" },
+ /*533*/ { -1, "[414]1313131313130", 0, "4141313131313130", "", "" },
+ /*534*/ { -1, "[414]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (414) at position 1", "" },
+ /*535*/ { -1, "[4140]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4140) at position 1", "" },
+ /*536*/ { -1, "[415]1313131313130", 0, "4151313131313130", "", "" },
+ /*537*/ { -1, "[415]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (415) at position 1", "" },
+ /*538*/ { -1, "[4150]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4150) at position 1", "" },
+ /*539*/ { -1, "[416]1313131313130", 0, "4161313131313130", "", "" },
+ /*540*/ { -1, "[416]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (416) at position 1", "" },
+ /*541*/ { -1, "[4160]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4160) at position 1", "" },
+ /*542*/ { -1, "[417]1313131313130", 0, "4171313131313130", "", "" },
+ /*543*/ { -1, "[417]13131313131", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (417) at position 1", "" },
+ /*544*/ { -1, "[4170]1313131313134", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4170) at position 1", "" },
+ /*545*/ { -1, "[418]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (418) at position 1", "" },
+ /*546*/ { -1, "[4180]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4180) at position 1", "" },
+ /*547*/ { -1, "[419]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (419) at position 1", "" },
+ /*548*/ { -1, "[4190]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4190) at position 1", "" },
+ /*549*/ { -1, "[42]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (42) at position 1", "" },
+ /*550*/ { -1, "[420]abcdefghijklmnopqrst", 0, "420abcdefghijklmnopqrst", "", "" },
+ /*551*/ { -1, "[420]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (420) at position 1", "" },
+ /*552*/ { -1, "[4200]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4200) at position 1", "" },
+ /*553*/ { -1, "[421]123abcdefghi", ZINT_WARN_NONCOMPLIANT, "421123abcdefghi", "261: AI (421) data position 1: Unknown country code '123'", "" },
+ /*554*/ { -1, "[421]434abcdefghi", 0, "421434abcdefghi", "", "" },
+ /*555*/ { -1, "[421]123abcdefghij", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (421) at position 1", "" },
+ /*556*/ { -1, "[421]1231", ZINT_WARN_NONCOMPLIANT, "4211231", "261: AI (421) data position 1: Unknown country code '123'", "" },
+ /*557*/ { -1, "[421]4341", 0, "4214341", "", "" },
+ /*558*/ { -1, "[421]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (421) at position 1", "" },
+ /*559*/ { -1, "[4210]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4210) at position 1", "" },
+ /*560*/ { -1, "[422]123", ZINT_WARN_NONCOMPLIANT, "422123", "261: AI (422) data position 1: Unknown country code '123'", "" },
+ /*561*/ { -1, "[422]004", 0, "422004", "", "" },
+ /*562*/ { -1, "[422]1234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (422) at position 1", "" },
+ /*563*/ { -1, "[422]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (422) at position 1", "" },
+ /*564*/ { -1, "[4220]123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4220) at position 1", "" },
+ /*565*/ { -1, "[423]123123123123123", ZINT_WARN_NONCOMPLIANT, "423123123123123123", "261: AI (423) data position 1: Unknown country code '123'", "" },
+ /*566*/ { -1, "[423]470004012887123", ZINT_WARN_NONCOMPLIANT, "423470004012887123", "261: AI (423) data position 13: Unknown country code '123'", "" },
+ /*567*/ { -1, "[423]470004012887438", 0, "423470004012887438", "", "" },
+ /*568*/ { -1, "[423]1231231231231231", ZINT_ERROR_INVALID_DATA, "4231231231231231231", "259: Invalid data length for AI (423) at position 1", "" },
+ /*569*/ { -1, "[423]12312312312312", ZINT_WARN_NONCOMPLIANT, "42312312312312312", "259: Invalid data length for AI (423) at position 1", "" },
+ /*570*/ { -1, "[423]1231231231231", ZINT_WARN_NONCOMPLIANT, "4231231231231231", "259: Invalid data length for AI (423) at position 1", "" },
+ /*571*/ { -1, "[423]12312312312", ZINT_WARN_NONCOMPLIANT, "42312312312312", "259: Invalid data length for AI (423) at position 1", "" },
+ /*572*/ { -1, "[423]1231231231", ZINT_WARN_NONCOMPLIANT, "4231231231231", "259: Invalid data length for AI (423) at position 1", "" },
+ /*573*/ { -1, "[423]123", ZINT_WARN_NONCOMPLIANT, "423123", "261: AI (423) data position 1: Unknown country code '123'", "" },
+ /*574*/ { -1, "[423]004", 0, "423004", "", "" },
+ /*575*/ { -1, "[423]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423) at position 1", "" },
+ /*576*/ { -1, "[4230]123123123123123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4230) at position 1", "" },
+ /*577*/ { -1, "[424]123", ZINT_WARN_NONCOMPLIANT, "424123", "261: AI (424) data position 1: Unknown country code '123'", "" },
+ /*578*/ { -1, "[424]004", 0, "424004", "", "" },
+ /*579*/ { -1, "[424]1234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (424) at position 1", "" },
+ /*580*/ { -1, "[424]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (424) at position 1", "" },
+ /*581*/ { -1, "[4240]123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4240) at position 1", "" },
+ /*582*/ { -1, "[425]123123123123123", ZINT_WARN_NONCOMPLIANT, "425123123123123123", "261: AI (425) data position 1: Unknown country code '123'", "" },
+ /*583*/ { -1, "[425]010500276634894", 0, "425010500276634894", "", "" },
+ /*584*/ { -1, "[425]010500276123894", ZINT_WARN_NONCOMPLIANT, "425010500276123894", "261: AI (425) data position 10: Unknown country code '123'", "" },
+ /*585*/ { -1, "[425]1231231231231231", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (425) at position 1", "" },
+ /*586*/ { -1, "[425]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (425) at position 1", "" },
+ /*587*/ { -1, "[4250]123123123123123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4250) at position 1", "" },
+ /*588*/ { -1, "[426]123", ZINT_WARN_NONCOMPLIANT, "426123", "261: AI (426) data position 1: Unknown country code '123'", "" },
+ /*589*/ { -1, "[426]426", 0, "426426", "", "" },
+ /*590*/ { -1, "[426]1234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (426) at position 1", "" },
+ /*591*/ { -1, "[426]12", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (426) at position 1", "" },
+ /*592*/ { -1, "[4260]123", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4260) at position 1", "" },
+ /*593*/ { -1, "[427]abc", 0, "427abc", "", "" },
+ /*594*/ { -1, "[427]abcd", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (427) at position 1", "" },
+ /*595*/ { -1, "[4270]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4270) at position 1", "" },
+ /*596*/ { -1, "[428]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (428) at position 1", "" },
+ /*597*/ { -1, "[4280]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4280) at position 1", "" },
+ /*598*/ { -1, "[429]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (429) at position 1", "" },
+ /*599*/ { -1, "[4290]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4290) at position 1", "" },
+ /*600*/ { -1, "[43]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (43) at position 1", "" },
+ /*601*/ { -1, "[430]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (430) at position 1", "" },
+ /*602*/ { -1, "[4300]1", 0, "43001", "", "" },
+ /*603*/ { -1, "[4300]12345678901234567890123456789012345", 0, "430012345678901234567890123456789012345", "", "" },
+ /*604*/ { -1, "[4300]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4300) at position 1", "" },
+ /*605*/ { -1, "[4301]1", 0, "43011", "", "" },
+ /*606*/ { -1, "[4301]12345678901234567890123456789012345", 0, "430112345678901234567890123456789012345", "", "" },
+ /*607*/ { -1, "[4301]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4301) at position 1", "" },
+ /*608*/ { -1, "[4302]1", 0, "43021", "", "" },
+ /*609*/ { -1, "[4302]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43021234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*610*/ { -1, "[4302]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4302) at position 1", "" },
+ /*611*/ { -1, "[4303]1", 0, "43031", "", "" },
+ /*612*/ { -1, "[4303]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43031234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*613*/ { -1, "[4303]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4303) at position 1", "" },
+ /*614*/ { -1, "[4304]1", 0, "43041", "", "" },
+ /*615*/ { -1, "[4304]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43041234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*616*/ { -1, "[4304]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4304) at position 1", "" },
+ /*617*/ { -1, "[4305]1", 0, "43051", "", "" },
+ /*618*/ { -1, "[4305]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43051234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*619*/ { -1, "[4305]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4305) at position 1", "" },
+ /*620*/ { -1, "[4306]1", 0, "43061", "", "" },
+ /*621*/ { -1, "[4306]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43061234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*622*/ { -1, "[4306]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4306) at position 1", "" },
+ /*623*/ { -1, "[4307]FR", 0, "4307FR", "", "" },
+ /*624*/ { -1, "[4307]F", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4307) at position 1", "" },
+ /*625*/ { -1, "[4307]FRR", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4307) at position 1", "" },
+ /*626*/ { -1, "[4308]1", 0, "43081", "", "" },
+ /*627*/ { -1, "[4308]123456789012345678901234567890", 0, "4308123456789012345678901234567890", "", "" },
+ /*628*/ { -1, "[4308]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4308) at position 1", "" },
+ /*629*/ { -1, "[4309]12345678901234567890", 0, "430912345678901234567890", "", "" },
+ /*630*/ { -1, "[4309]1234567890123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4309) at position 1", "" },
+ /*631*/ { -1, "[4309]1234567890123456789A", ZINT_WARN_NONCOMPLIANT, "43091234567890123456789A", "261: AI (4309) data position 20: Non-numeric character 'A'", "" },
+ /*632*/ { -1, "[431]1", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (431) at position 1", "" },
+ /*633*/ { -1, "[4310]1", 0, "43101", "", "" },
+ /*634*/ { -1, "[4310]12345678901234567890123456789012345", 0, "431012345678901234567890123456789012345", "", "" },
+ /*635*/ { -1, "[4310]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4310) at position 1", "" },
+ /*636*/ { -1, "[4311]1", 0, "43111", "", "" },
+ /*637*/ { -1, "[4311]12345678901234567890123456789012345", 0, "431112345678901234567890123456789012345", "", "" },
+ /*638*/ { -1, "[4311]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4311) at position 1", "" },
+ /*639*/ { -1, "[4312]1", 0, "43121", "", "" },
+ /*640*/ { -1, "[4312]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43121234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*641*/ { -1, "[4312]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4312) at position 1", "" },
+ /*642*/ { -1, "[4313]1", 0, "43131", "", "" },
+ /*643*/ { -1, "[4313]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43131234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*644*/ { -1, "[4313]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4313) at position 1", "" },
+ /*645*/ { -1, "[4314]1", 0, "43141", "", "" },
+ /*646*/ { -1, "[4314]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43141234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*647*/ { -1, "[4314]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4314) at position 1", "" },
+ /*648*/ { -1, "[4315]1", 0, "43151", "", "" },
+ /*649*/ { -1, "[4315]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43151234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*650*/ { -1, "[4315]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4315) at position 1", "" },
+ /*651*/ { -1, "[4316]1", 0, "43161", "", "" },
+ /*652*/ { -1, "[4316]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43161234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*653*/ { -1, "[4316]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4316) at position 1", "" },
+ /*654*/ { -1, "[4317]FR", 0, "4317FR", "", "" },
+ /*655*/ { -1, "[4317]F", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4317) at position 1", "" },
+ /*656*/ { -1, "[4317]FRF", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4317) at position 1", "" },
+ /*657*/ { -1, "[4318]1", 0, "43181", "", "" },
+ /*658*/ { -1, "[4318]12345678901234567890", 0, "431812345678901234567890", "", "" },
+ /*659*/ { -1, "[4318]123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4318) at position 1", "" },
+ /*660*/ { -1, "[4319]1", 0, "43191", "", "" },
+ /*661*/ { -1, "[4319]123456789012345678901234567890", 0, "4319123456789012345678901234567890", "", "" },
+ /*662*/ { -1, "[4319]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4319) at position 1", "" },
+ /*663*/ { -1, "[432]1", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (432) at position 1", "" },
+ /*664*/ { -1, "[4320]1", 0, "43201", "", "" },
+ /*665*/ { -1, "[4320]12345678901234567890123456789012345", 0, "432012345678901234567890123456789012345", "", "" },
+ /*666*/ { -1, "[4320]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4320) at position 1", "" },
+ /*667*/ { -1, "[4321]1", 0, "43211", "", "" },
+ /*668*/ { -1, "[4321]10", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4321) at position 1", "" },
+ /*669*/ { -1, "[4322]1", 0, "43221", "", "" },
+ /*670*/ { -1, "[4322]10", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4322) at position 1", "" },
+ /*671*/ { -1, "[4323]1", 0, "43231", "", "" },
+ /*672*/ { -1, "[4323]10", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4323) at position 1", "" },
+ /*673*/ { -1, "[4324]1212120000", 0, "43241212120000", "", "" },
+ /*674*/ { -1, "[4324]121212000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4324) at position 1", "" },
+ /*675*/ { -1, "[4324]12121200000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4324) at position 1", "" },
+ /*676*/ { -1, "[4325]1212120000", 0, "43251212120000", "", "" },
+ /*677*/ { -1, "[4325]121212000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4325) at position 1", "" },
+ /*678*/ { -1, "[4325]12121200000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4325) at position 1", "" },
+ /*679*/ { -1, "[4326]121212", 0, "4326121212", "", "" },
+ /*680*/ { -1, "[4326]12121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4326) at position 1", "" },
+ /*681*/ { -1, "[4326]1212120", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4326) at position 1", "" },
+ /*682*/ { -1, "[4327]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4327) at position 1", "" },
+ /*683*/ { -1, "[4328]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4328) at position 1", "" },
+ /*684*/ { -1, "[4329]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4329) at position 1", "" },
+ /*685*/ { -1, "[433]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (433) at position 1", "" },
+ /*686*/ { -1, "[4330]121212", 0, "4330121212", "", "" },
+ /*687*/ { -1, "[4331]121212-", 0, "4331121212-", "", "" },
+ /*688*/ { -1, "[4332]121212", 0, "4332121212", "", "" },
+ /*689*/ { -1, "[4333]121212-", 0, "4333121212-", "", "" },
+ /*690*/ { -1, "[4334]121212", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4334) at position 1", "" },
+ /*691*/ { -1, "[44]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (44) at position 1", "" },
+ /*692*/ { -1, "[440]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (440) at position 1", "" },
+ /*693*/ { -1, "[4400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4400) at position 1", "" },
+ /*694*/ { -1, "[49]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (49) at position 1", "" },
+ /*695*/ { -1, "[490]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (490) at position 1", "" },
+ /*696*/ { -1, "[4900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4900) at position 1", "" },
+ /*697*/ { -1, "[499]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (499) at position 1", "" },
+ /*698*/ { -1, "[4990]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (4990) at position 1", "" },
+ /*699*/ { -1, "[50]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (50) at position 1", "" },
+ /*700*/ { -1, "[500]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (500) at position 1", "" },
+ /*701*/ { -1, "[5000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (5000) at position 1", "" },
+ /*702*/ { -1, "[51]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (51) at position 1", "" },
+ /*703*/ { -1, "[510]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (510) at position 1", "" },
+ /*704*/ { -1, "[5100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (5100) at position 1", "" },
+ /*705*/ { -1, "[59]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (59) at position 1", "" },
+ /*706*/ { -1, "[590]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (590) at position 1", "" },
+ /*707*/ { -1, "[5900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (5900) at position 1", "" },
+ /*708*/ { -1, "[60]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (60) at position 1", "" },
+ /*709*/ { -1, "[600]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (600) at position 1", "" },
+ /*710*/ { -1, "[6000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (6000) at position 1", "" },
+ /*711*/ { -1, "[61]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (61) at position 1", "" },
+ /*712*/ { -1, "[610]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (610) at position 1", "" },
+ /*713*/ { -1, "[6100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (6100) at position 1", "" },
+ /*714*/ { -1, "[69]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (69) at position 1", "" },
+ /*715*/ { -1, "[690]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (690) at position 1", "" },
+ /*716*/ { -1, "[6900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (6900) at position 1", "" },
+ /*717*/ { -1, "[70]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (70) at position 1", "" },
+ /*718*/ { -1, "[700]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (700) at position 1", "" },
+ /*719*/ { -1, "[7000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7000) at position 1", "" },
+ /*720*/ { -1, "[7001]1234567890123", 0, "70011234567890123", "", "" },
+ /*721*/ { -1, "[7001]123456789012", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7001) at position 1", "" },
+ /*722*/ { -1, "[7002]abcdefghijklmnopqrstuvwxyz1234", 0, "7002abcdefghijklmnopqrstuvwxyz1234", "", "" },
+ /*723*/ { -1, "[7002]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7002) at position 1", "" },
+ /*724*/ { -1, "[7003]1212121212", 0, "70031212121212", "", "" },
+ /*725*/ { -1, "[7003]121212121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7003) at position 1", "" },
+ /*726*/ { -1, "[7004]1234", 0, "70041234", "", "" },
+ /*727*/ { -1, "[7004]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7004) at position 1", "" },
+ /*728*/ { -1, "[7005]abcdefghijkl", 0, "7005abcdefghijkl", "", "" },
+ /*729*/ { -1, "[7005]abcdefghijklm", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7005) at position 1", "" },
+ /*730*/ { -1, "[7006]200132", ZINT_WARN_NONCOMPLIANT, "7006200132", "261: AI (7006) data position 5: Invalid day '32'", "" },
+ /*731*/ { -1, "[7006]200100", ZINT_WARN_NONCOMPLIANT, "7006200100", "261: AI (7006) data position 5: Invalid day '00'", "" },
+ /*732*/ { -1, "[7006]200120", 0, "7006200120", "", "" },
+ /*733*/ { -1, "[7006]2001320", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7006) at position 1", "" },
+ /*734*/ { -1, "[7007]010101121212", 0, "7007010101121212", "", "" },
+ /*735*/ { -1, "[7007]01010112121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7007) at position 1", "" },
+ /*736*/ { -1, "[7007]A1010112121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7007) at position 1", "" },
+ /*737*/ { -1, "[7007]121212", 0, "7007121212", "", "" },
+ /*738*/ { -1, "[7007]12121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7007) at position 1", "" },
+ /*739*/ { -1, "[7007]1212121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7007) at position 1", "" },
+ /*740*/ { -1, "[7008]abc", 0, "7008abc", "", "" },
+ /*741*/ { -1, "[7008]abcd", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7008) at position 1", "" },
+ /*742*/ { -1, "[7009]abcdefghij", 0, "7009abcdefghij", "", "" },
+ /*743*/ { -1, "[7009]abcdefghijk", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7009) at position 1", "" },
+ /*744*/ { -1, "[7010]01", 0, "701001", "", "" },
+ /*745*/ { -1, "[7010]1", 0, "70101", "", "" },
+ /*746*/ { -1, "[7010]012", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7010) at position 1", "" },
+ /*747*/ { -1, "[7011]121212", 0, "7011121212", "", "" },
+ /*748*/ { -1, "[7011]1212121212", 0, "70111212121212", "", "" },
+ /*749*/ { -1, "[7011]12121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7011) at position 1", "" },
+ /*750*/ { -1, "[7011]121212121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7011) at position 1", "" },
+ /*751*/ { -1, "[7012]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7012) at position 1", "" },
+ /*752*/ { -1, "[7019]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7019) at position 1", "" },
+ /*753*/ { -1, "[7020]abcdefghijklmnopqrst", 0, "7020abcdefghijklmnopqrst", "", "" },
+ /*754*/ { -1, "[7020]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7020) at position 1", "" },
+ /*755*/ { -1, "[7021]abcdefghijklmnopqrst", 0, "7021abcdefghijklmnopqrst", "", "" },
+ /*756*/ { -1, "[7021]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7021) at position 1", "" },
+ /*757*/ { -1, "[7022]abcdefghijklmnopqrst", 0, "7022abcdefghijklmnopqrst", "", "" },
+ /*758*/ { -1, "[7022]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7022) at position 1", "" },
+ /*759*/ { -1, "[7023]1234abcdefghijklmnopqrstuvwxyz", 0, "70231234abcdefghijklmnopqrstuvwxyz", "", "" },
+ /*760*/ { -1, "[7023]1234abcdefghijklmnopqrstuvwxyza", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7023) at position 1", "" },
+ /*761*/ { -1, "[7024]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7024) at position 1", "" },
+ /*762*/ { -1, "[7025]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7025) at position 1", "" },
+ /*763*/ { -1, "[7029]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7029) at position 1", "" },
+ /*764*/ { -1, "[7030]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7030123abcdefghijklmnopqrstuvwxyza", "261: AI (7030) data position 1: Unknown country code '123'", "" },
+ /*765*/ { -1, "[7030]004abcdefghijklmnopqrstuvwxyza", 0, "7030004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*766*/ { -1, "[7030]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7030) at position 1", "" },
+ /*767*/ { -1, "[7031]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7031123abcdefghijklmnopqrstuvwxyza", "261: AI (7031) data position 1: Unknown country code '123'", "" },
+ /*768*/ { -1, "[7031]004abcdefghijklmnopqrstuvwxyza", 0, "7031004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*769*/ { -1, "[7031]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7031) at position 1", "" },
+ /*770*/ { -1, "[7032]004abcdefghijklmnopqrstuvwxyza", 0, "7032004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*771*/ { -1, "[7032]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7032) at position 1", "" },
+ /*772*/ { -1, "[7033]004abcdefghijklmnopqrstuvwxyza", 0, "7033004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*773*/ { -1, "[7033]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7033) at position 1", "" },
+ /*774*/ { -1, "[7034]004abcdefghijklmnopqrstuvwxyza", 0, "7034004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*775*/ { -1, "[7034]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7034) at position 1", "" },
+ /*776*/ { -1, "[7035]004abcdefghijklmnopqrstuvwxyza", 0, "7035004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*777*/ { -1, "[7035]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7035) at position 1", "" },
+ /*778*/ { -1, "[7036]004abcdefghijklmnopqrstuvwxyza", 0, "7036004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*779*/ { -1, "[7036]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7036) at position 1", "" },
+ /*780*/ { -1, "[7037]004abcdefghijklmnopqrstuvwxyza", 0, "7037004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*781*/ { -1, "[7037]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7037) at position 1", "" },
+ /*782*/ { -1, "[7038]004abcdefghijklmnopqrstuvwxyza", 0, "7038004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*783*/ { -1, "[7038]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7038) at position 1", "" },
+ /*784*/ { -1, "[7039]004abcdefghijklmnopqrstuvwxyza", 0, "7039004abcdefghijklmnopqrstuvwxyza", "", "" },
+ /*785*/ { -1, "[7039]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7039) at position 1", "" },
+ /*786*/ { -1, "[7040]1abc", 0, "70401abc", "", "" },
+ /*787*/ { -1, "[7040]1ab", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7040) at position 1", "" },
+ /*788*/ { -1, "[7040]1abcd", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7040) at position 1", "" },
+ /*789*/ { -1, "[7041]BGE", 0, "7041BGE", "", "" },
+ /*790*/ { -1, "[7041]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7041) at position 1", "" },
+ /*791*/ { -1, "[7042]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7042) at position 1", "" },
+ /*792*/ { -1, "[7050]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7050) at position 1", "" },
+ /*793*/ { -1, "[7090]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7090) at position 1", "" },
+ /*794*/ { -1, "[7099]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7099) at position 1", "" },
+ /*795*/ { -1, "[71]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (71) at position 1", "" },
+ /*796*/ { -1, "[710]abcdefghijklmnopqrst", 0, "710abcdefghijklmnopqrst", "", "" },
+ /*797*/ { -1, "[710]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (710) at position 1", "" },
+ /*798*/ { -1, "[7100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7100) at position 1", "" },
+ /*799*/ { -1, "[711]abcdefghijklmnopqrst", 0, "711abcdefghijklmnopqrst", "", "" },
+ /*800*/ { -1, "[711]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (711) at position 1", "" },
+ /*801*/ { -1, "[712]abcdefghijklmnopqrst", 0, "712abcdefghijklmnopqrst", "", "" },
+ /*802*/ { -1, "[712]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (712) at position 1", "" },
+ /*803*/ { -1, "[713]abcdefghijklmnopqrst", 0, "713abcdefghijklmnopqrst", "", "" },
+ /*804*/ { -1, "[713]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (713) at position 1", "" },
+ /*805*/ { -1, "[714]abcdefghijklmnopqrst", 0, "714abcdefghijklmnopqrst", "", "" },
+ /*806*/ { -1, "[714]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (714) at position 1", "" },
+ /*807*/ { -1, "[715]abcdefghijklmnopqrst", 0, "715abcdefghijklmnopqrst", "", "" },
+ /*808*/ { -1, "[715]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (715) at position 1", "" },
+ /*809*/ { -1, "[716]abcdefghijklmnopqrst", 0, "716abcdefghijklmnopqrst", "", "" },
+ /*810*/ { -1, "[716]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (716) at position 1", "" },
+ /*811*/ { -1, "[717]abcdefghijklmnopqrst", 0, "717abcdefghijklmnopqrst", "", "" },
+ /*812*/ { -1, "[717]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (717) at position 1", "" },
+ /*813*/ { -1, "[718]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (718) at position 1", "" },
+ /*814*/ { -1, "[719]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (719) at position 1", "" },
+ /*815*/ { -1, "[72]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (72) at position 1", "" },
+ /*816*/ { -1, "[720]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (720) at position 1", "" },
+ /*817*/ { -1, "[7200]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7200) at position 1", "" },
+ /*818*/ { -1, "[721]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (721) at position 1", "" },
+ /*819*/ { -1, "[7210]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7210) at position 1", "" },
+ /*820*/ { -1, "[7220]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7220) at position 1", "" },
+ /*821*/ { -1, "[7230]EMabcdefghijklmnopqrstuvwxyzab", 0, "7230EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*822*/ { -1, "[7230]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7230) at position 1", "" },
+ /*823*/ { -1, "[7230]EM", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7230) at position 1", "" },
+ /*824*/ { -1, "[7231]EMabcdefghijklmnopqrstuvwxyzab", 0, "7231EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*825*/ { -1, "[7231]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7231) at position 1", "" },
+ /*826*/ { -1, "[7232]EMabcdefghijklmnopqrstuvwxyzab", 0, "7232EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*827*/ { -1, "[7232]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7232) at position 1", "" },
+ /*828*/ { -1, "[7233]EMabcdefghijklmnopqrstuvwxyzab", 0, "7233EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*829*/ { -1, "[7233]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7233) at position 1", "" },
+ /*830*/ { -1, "[7234]EMabcdefghijklmnopqrstuvwxyzab", 0, "7234EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*831*/ { -1, "[7234]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7234) at position 1", "" },
+ /*832*/ { -1, "[7235]EMabcdefghijklmnopqrstuvwxyzab", 0, "7235EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*833*/ { -1, "[7235]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7235) at position 1", "" },
+ /*834*/ { -1, "[7236]EMabcdefghijklmnopqrstuvwxyzab", 0, "7236EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*835*/ { -1, "[7236]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7236) at position 1", "" },
+ /*836*/ { -1, "[7237]EMabcdefghijklmnopqrstuvwxyzab", 0, "7237EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*837*/ { -1, "[7237]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7237) at position 1", "" },
+ /*838*/ { -1, "[7238]EMabcdefghijklmnopqrstuvwxyzab", 0, "7238EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*839*/ { -1, "[7238]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7238) at position 1", "" },
+ /*840*/ { -1, "[7239]EMabcdefghijklmnopqrstuvwxyzab", 0, "7239EMabcdefghijklmnopqrstuvwxyzab", "", "" },
+ /*841*/ { -1, "[7239]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7239) at position 1", "" },
+ /*842*/ { -1, "[7239]E", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7239) at position 1", "" },
+ /*843*/ { -1, "[7240]abcdefghijklmnopqrst", 0, "7240abcdefghijklmnopqrst", "", "" },
+ /*844*/ { -1, "[7240]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7240) at position 1", "" },
+ /*845*/ { -1, "[7241]99", 0, "724199", "", "" },
+ /*846*/ { -1, "[7241]100", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7241) at position 1", "" },
+ /*847*/ { -1, "[7242]abcdefghijklmnopqrstuvwxy", 0, "7242abcdefghijklmnopqrstuvwxy", "", "" },
+ /*848*/ { -1, "[7242]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7242) at position 1", "" },
+ /*849*/ { -1, "[7243]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7243) at position 1", "" },
+ /*850*/ { -1, "[7249]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7249) at position 1", "" },
+ /*851*/ { -1, "[7250]12341201", 0, "725012341201", "", "" },
+ /*852*/ { -1, "[7250]123412012", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7250) at position 1", "" },
+ /*853*/ { -1, "[7251]123412011359", 0, "7251123412011359", "", "" },
+ /*854*/ { -1, "[7251]1234120113591", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7251) at position 1", "" },
+ /*855*/ { -1, "[7252]2", 0, "72522", "", "" },
+ /*856*/ { -1, "[7252]20", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7252) at position 1", "" },
+ /*857*/ { -1, "[7253]abcdefghijklmnopqrstuvwxyzabcdefghijklmn", 0, "7253abcdefghijklmnopqrstuvwxyzabcdefghijklmn", "", "" },
+ /*858*/ { -1, "[7253]abcdefghijklmnopqrstuvwxyzabcdefghijklmno", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7253) at position 1", "" },
+ /*859*/ { -1, "[7254]abcdefghijklmnopqrstuvwxyzabcdefghijklmn", 0, "7254abcdefghijklmnopqrstuvwxyzabcdefghijklmn", "", "" },
+ /*860*/ { -1, "[7254]abcdefghijklmnopqrstuvwxyzabcdefghijklmno", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7254) at position 1", "" },
+ /*861*/ { -1, "[7255]abcdefghij", 0, "7255abcdefghij", "", "" },
+ /*862*/ { -1, "[7255]abcdefghijk", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7255) at position 1", "" },
+ /*863*/ { -1, "[7256]abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl", 0, "7256abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl", "", "" },
+ /*864*/ { -1, "[7256]abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7256) at position 1", "" },
+ /*865*/ { -1, "[7257]abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr", 0, "7257abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr", "", "" },
+ /*866*/ { -1, "[7257]abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7257) at position 1", "" },
+ /*867*/ { -1, "[7258]1/1", 0, "72581/1", "", "" },
+ /*868*/ { -1, "[7258]1/01", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7258) at position 1", "" },
+ /*869*/ { -1, "[7259]abcdefghijklmnopqrstuvwxyzabcdefghijklmn", 0, "7259abcdefghijklmnopqrstuvwxyzabcdefghijklmn", "", "" },
+ /*870*/ { -1, "[7259]abcdefghijklmnopqrstuvwxyzabcdefghijklmno", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7259) at position 1", "" },
+ /*871*/ { -1, "[7260]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7260) at position 1", "" },
+ /*872*/ { -1, "[7299]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7299) at position 1", "" },
+ /*873*/ { -1, "[73]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (73) at position 1", "" },
+ /*874*/ { -1, "[7300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7300) at position 1", "" },
+ /*875*/ { -1, "[74]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (74) at position 1", "" },
+ /*876*/ { -1, "[7400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7400) at position 1", "" },
+ /*877*/ { -1, "[79]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (79) at position 1", "" },
+ /*878*/ { -1, "[7900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7900) at position 1", "" },
+ /*879*/ { -1, "[7999]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (7999) at position 1", "" },
+ /*880*/ { -1, "[80]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (80) at position 1", "" },
+ /*881*/ { -1, "[800]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (800) at position 1", "" },
+ /*882*/ { -1, "[8000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8000) at position 1", "" },
+ /*883*/ { -1, "[8001]12345678901234", ZINT_WARN_NONCOMPLIANT, "800112345678901234", "261: AI (8001) data position 13: Invalid winding direction '3'", "" },
+ /*884*/ { -1, "[8001]12345678901204", 0, "800112345678901204", "", "" },
+ /*885*/ { -1, "[8001]1234123456789012345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8001) at position 1", "" },
+ /*886*/ { -1, "[8002]abcdefghijklmnopqrst", 0, "8002abcdefghijklmnopqrst", "", "" },
+ /*887*/ { -1, "[8002]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8002) at position 1", "" },
+ /*888*/ { -1, "[8003]01234567890123abcdefghijklmnop", ZINT_WARN_NONCOMPLIANT, "800301234567890123abcdefghijklmnop", "261: AI (8003) data position 14: Bad checksum '3', expected '8'", "" },
+ /*889*/ { -1, "[8003]01234567890128abcdefghijklmnop", 0, "800301234567890128abcdefghijklmnop", "", "" },
+ /*890*/ { -1, "[8003]01234567890128abcdefghijklmnopq", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8003) at position 1", "" },
+ /*891*/ { -1, "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_WARN_NONCOMPLIANT, "8004abcdefghijklmnopqrstuvwxyz1234", "261: AI (8004) data position 1: Non-numeric company prefix 'a'", "" },
+ /*892*/ { -1, "[8004]1234efghijklmnopqrstuvwxyz1234", 0, "80041234efghijklmnopqrstuvwxyz1234", "", "" },
+ /*893*/ { -1, "[8004]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8004) at position 1", "" },
+ /*894*/ { -1, "[8004]123", ZINT_WARN_NONCOMPLIANT, "8004123", "261: AI (8004) data position 1: GS1 Company Prefix length 3 too short (minimum 4)", "" },
+ /*895*/ { -1, "[8005]123456", 0, "8005123456", "", "" },
+ /*896*/ { -1, "[8005]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8005) at position 1", "" },
+ /*897*/ { -1, "[8005]1234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8005) at position 1", "" },
+ /*898*/ { -1, "[8006]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8006123456789012341212", "261: AI (8006) data position 14: Bad checksum '4', expected '1'", "" },
+ /*899*/ { -1, "[8006]123456789012311212", 0, "8006123456789012311212", "", "" },
+ /*900*/ { -1, "[8006]12345678901234121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8006) at position 1", "" },
+ /*901*/ { -1, "[8006]1234567890123412123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8006) at position 1", "" },
+ /*902*/ { -1, "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_WARN_NONCOMPLIANT, "8007abcdefghijklmnopqrstuvwxyz12345678", "261: AI (8007) data position 1: Non-alphabetic IBAN country code 'ab'", "" },
+ /*903*/ { -1, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", "", "" },
+ /*904*/ { -1, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ123456789", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8007) at position 1", "" },
+ /*905*/ { -1, "[8008]123456121212", ZINT_WARN_NONCOMPLIANT, "8008123456121212", "261: AI (8008) data position 3: Invalid month '34'", "" },
+ /*906*/ { -1, "[8008]121256121212", ZINT_WARN_NONCOMPLIANT, "8008121256121212", "261: AI (8008) data position 5: Invalid day '56'", "" },
+ /*907*/ { -1, "[8008]121231121212", 0, "8008121231121212", "", "" },
+ /*908*/ { -1, "[8008]1234561212", ZINT_WARN_NONCOMPLIANT, "80081234561212", "261: AI (8008) data position 3: Invalid month '34'", "" },
+ /*909*/ { -1, "[8008]1212311212", 0, "80081212311212", "", "" },
+ /*910*/ { -1, "[8008]12345612", ZINT_WARN_NONCOMPLIANT, "800812345612", "261: AI (8008) data position 3: Invalid month '34'", "" },
+ /*911*/ { -1, "[8008]12010112", 0, "800812010112", "", "" },
+ /*912*/ { -1, "[8008]1234561", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8008) at position 1", "" },
+ /*913*/ { -1, "[8008]123456121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8008) at position 1", "" },
+ /*914*/ { -1, "[8008]12345612121", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8008) at position 1", "" },
+ /*915*/ { -1, "[8008]1234561212123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8008) at position 1", "" },
+ /*916*/ { -1, "[8009]12345678901234567890123456789012345678901234567890", 0, "800912345678901234567890123456789012345678901234567890", "", "" },
+ /*917*/ { -1, "[8009]123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8009) at position 1", "" },
+ /*918*/ { -1, "[8010]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8010) at position 1", "" },
+ /*919*/ { -1, "[8011]123456789012", 0, "8011123456789012", "", "" },
+ /*920*/ { -1, "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8011) at position 1", "" },
+ /*921*/ { -1, "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst", "", "" },
+ /*922*/ { -1, "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8012) at position 1", "" },
+ /*923*/ { -1, "[8013]1234abcdefghijklmnopqrsQP", 0, "80131234abcdefghijklmnopqrsQP", "", "" },
+ /*924*/ { -1, "[8013]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8013) at position 1", "" },
+ /*925*/ { -1, "[8014]1234abcdefghijklmnopqrsQP", 0, "80141234abcdefghijklmnopqrsQP", "", "" },
+ /*926*/ { -1, "[8014]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8014) at position 1", "" },
+ /*927*/ { -1, "[8015]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8015) at position 1", "" },
+ /*928*/ { -1, "[8016]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8016) at position 1", "" },
+ /*929*/ { -1, "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139", "261: AI (8017) data position 18: Bad checksum '9', expected '1'", "" },
+ /*930*/ { -1, "[8017]313131313131313131", 0, "8017313131313131313131", "", "" },
+ /*931*/ { -1, "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8017) at position 1", "" },
+ /*932*/ { -1, "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8017) at position 1", "" },
+ /*933*/ { -1, "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139", "261: AI (8018) data position 18: Bad checksum '9', expected '1'", "" },
+ /*934*/ { -1, "[8018]313131313131313131", 0, "8018313131313131313131", "", "" },
+ /*935*/ { -1, "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8018) at position 1", "" },
+ /*936*/ { -1, "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8018) at position 1", "" },
+ /*937*/ { -1, "[8019]1234567890", 0, "80191234567890", "", "" },
+ /*938*/ { -1, "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8019) at position 1", "" },
+ /*939*/ { -1, "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy", "", "" },
+ /*940*/ { -1, "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8020) at position 1", "" },
+ /*941*/ { -1, "[8021]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8021) at position 1", "" },
+ /*942*/ { -1, "[8025]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8025) at position 1", "" },
+ /*943*/ { -1, "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212", "261: AI (8026) data position 14: Bad checksum '4', expected '1'", "" },
+ /*944*/ { -1, "[8026]123456789012311212", 0, "8026123456789012311212", "", "" },
+ /*945*/ { -1, "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8026) at position 1", "" },
+ /*946*/ { -1, "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8026) at position 1", "" },
+ /*947*/ { -1, "[8027]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8027) at position 1", "" },
+ /*948*/ { -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", "", "" },
+ /*949*/ { -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ1", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8030) at position 1", "" },
+ /*950*/ { -1, "[8031]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8031) at position 1", "" },
+ /*951*/ { -1, "[8040]123456789012345", 0, "8040123456789012345", "", "" },
+ /*952*/ { -1, "[8040]12345678901234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8040) at position 1", "" },
+ /*953*/ { -1, "[8041]123456789012345", 0, "8041123456789012345", "", "" },
+ /*954*/ { -1, "[8041]12345678901234", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8041) at position 1", "" },
+ /*955*/ { -1, "[8042]12345678901234567890123456789012", 0, "804212345678901234567890123456789012", "", "" },
+ /*956*/ { -1, "[8042]123456789012345678901234567890123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8042) at position 1", "" },
+ /*957*/ { -1, "[8043]123456789012345678", 0, "8043123456789012345678", "", "" },
+ /*958*/ { -1, "[8043]1234567890123456781", 0, "80431234567890123456781", "", "" },
+ /*959*/ { -1, "[8043]12345678901234567812", 0, "804312345678901234567812", "", "" },
+ /*960*/ { -1, "[8043]123456789012345678123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8043) at position 1", "" },
+ /*961*/ { -1, "[8044]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8044) at position 1", "" },
+ /*962*/ { -1, "[8049]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8049) at position 1", "" },
+ /*963*/ { -1, "[8050]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8050) at position 1", "" },
+ /*964*/ { -1, "[8060]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8060) at position 1", "" },
+ /*965*/ { -1, "[8070]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8070) at position 1", "" },
+ /*966*/ { -1, "[8080]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8080) at position 1", "" },
+ /*967*/ { -1, "[8090]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8090) at position 1", "" },
+ /*968*/ { -1, "[8099]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8099) at position 1", "" },
+ /*969*/ { -1, "[81]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (81) at position 1", "" },
+ /*970*/ { -1, "[8100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8100) at position 1", "" },
+ /*971*/ { -1, "[8109]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8109) at position 1", "" },
+ /*972*/ { -1, "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000", "", "" },
+ /*973*/ { -1, "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8110) at position 1", "" },
+ /*974*/ { -1, "[8111]1234", 0, "81111234", "", "" },
+ /*975*/ { -1, "[8111]12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8111) at position 1", "" },
+ /*976*/ { -1, "[8111]123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8111) at position 1", "" },
+ /*977*/ { -1, "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890", "259: Invalid data length for AI (8112) at position 1", "" },
+ /*978*/ { -1, "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8112) at position 1", "" },
+ /*979*/ { -1, "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345", "", "" },
+ /*980*/ { -1, "[8113]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8113) at position 1", "" },
+ /*981*/ { -1, "[8120]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8120) at position 1", "" },
+ /*982*/ { -1, "[8130]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8130) at position 1", "" },
+ /*983*/ { -1, "[8140]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8140) at position 1", "" },
+ /*984*/ { -1, "[8150]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8150) at position 1", "" },
+ /*985*/ { -1, "[8190]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8190) at position 1", "" },
+ /*986*/ { -1, "[8199]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8199) at position 1", "" },
+ /*987*/ { -1, "[82]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (82) at position 1", "" },
+ /*988*/ { -1, "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*989*/ { -1, "^82001234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*990*/ { GS1RAW_MODE, "82001234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*991*/ { -1, "[8201]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8201) at position 1", "" },
+ /*992*/ { -1, "[8210]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8210) at position 1", "" },
+ /*993*/ { -1, "[8220]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8220) at position 1", "" },
+ /*994*/ { -1, "[8230]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8230) at position 1", "" },
+ /*995*/ { -1, "[8240]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8240) at position 1", "" },
+ /*996*/ { -1, "[8250]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8250) at position 1", "" },
+ /*997*/ { -1, "[8290]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8290) at position 1", "" },
+ /*998*/ { -1, "[8299]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8299) at position 1", "" },
+ /*999*/ { -1, "[83]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (83) at position 1", "" },
+ /*1000*/ { -1, "[830]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (830) at position 1", "" },
+ /*1001*/ { -1, "[8300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8300) at position 1", "" },
+ /*1002*/ { -1, "[84]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (84) at position 1", "" },
+ /*1003*/ { -1, "[840]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (840) at position 1", "" },
+ /*1004*/ { -1, "[8400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8400) at position 1", "" },
+ /*1005*/ { -1, "[85]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (85) at position 1", "" },
+ /*1006*/ { -1, "[850]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (850) at position 1", "" },
+ /*1007*/ { -1, "[8500]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8500) at position 1", "" },
+ /*1008*/ { -1, "[89]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (89) at position 1", "" },
+ /*1009*/ { -1, "[890]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (890) at position 1", "" },
+ /*1010*/ { -1, "[8900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (8900) at position 1", "" },
+ /*1011*/ { -1, "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234", "", "" },
+ /*1012*/ { -1, "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (90) at position 1", "" },
+ /*1013*/ { -1, "[900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (900) at position 1", "" },
+ /*1014*/ { -1, "[9000]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9000) at position 1", "" },
+ /*1015*/ { -1, "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1016*/ { -1, "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (91) at position 1", "" },
+ /*1017*/ { -1, "[910]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (910) at position 1", "" },
+ /*1018*/ { -1, "[9100]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9100) at position 1", "" },
+ /*1019*/ { -1, "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1020*/ { -1, "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (92) at position 1", "" },
+ /*1021*/ { -1, "[920]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (920) at position 1", "" },
+ /*1022*/ { -1, "[9200]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9200) at position 1", "" },
+ /*1023*/ { -1, "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1024*/ { -1, "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (93) at position 1", "" },
+ /*1025*/ { -1, "[930]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (930) at position 1", "" },
+ /*1026*/ { -1, "[9300]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9300) at position 1", "" },
+ /*1027*/ { -1, "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1028*/ { -1, "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (94) at position 1", "" },
+ /*1029*/ { -1, "[940]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (940) at position 1", "" },
+ /*1030*/ { -1, "[9400]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9400) at position 1", "" },
+ /*1031*/ { -1, "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1032*/ { -1, "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (95) at position 1", "" },
+ /*1033*/ { -1, "[950]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (950) at position 1", "" },
+ /*1034*/ { -1, "[9500]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9500) at position 1", "" },
+ /*1035*/ { -1, "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1036*/ { -1, "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (96) at position 1", "" },
+ /*1037*/ { -1, "[960]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (960) at position 1", "" },
+ /*1038*/ { -1, "[9600]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9600) at position 1", "" },
+ /*1039*/ { -1, "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1040*/ { -1, "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (97) at position 1", "" },
+ /*1041*/ { -1, "[970]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (970) at position 1", "" },
+ /*1042*/ { -1, "[9700]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9700) at position 1", "" },
+ /*1043*/ { -1, "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1044*/ { -1, "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (98) at position 1", "" },
+ /*1045*/ { -1, "[980]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (980) at position 1", "" },
+ /*1046*/ { -1, "[9800]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9800) at position 1", "" },
+ /*1047*/ { -1, "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "", "" },
+ /*1048*/ { -1, "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (99) at position 1", "" },
+ /*1049*/ { -1, "[990]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (990) at position 1", "" },
+ /*1050*/ { -1, "[9900]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9900) at position 1", "" },
+ /*1051*/ { -1, "[9999]1234", ZINT_ERROR_INVALID_DATA, "", "260: Invalid AI (9999) at position 1", "" },
+ /*1052*/ { -1, "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1053*/ { -1, "^01123456789012347006200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1054*/ { GS1RAW_MODE, "01123456789012347006200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1055*/ { -1, "[01]12345678901231[7006]200101", 0, "01123456789012317006200101", "", "" },
+ /*1056*/ { -1, "^01123456789012317006200101", 0, "01123456789012317006200101", "", "" },
+ /*1057*/ { GS1RAW_MODE, "01123456789012317006200101", 0, "01123456789012317006200101", "", "" },
+ /*1058*/ { -1, "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890\0350112345678901234", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1059*/ { -1, "^39001234567890^0112345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890\0350112345678901234", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1060*/ { GS1RAW_MODE, "39001234567890\0350112345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890\0350112345678901234", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1061*/ { -1, "[3900]1234567890[01]12345678901231", 0, "39001234567890\0350112345678901231", "", "" },
+ /*1062*/ { -1, "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234\035390112345678901234\0352012", "261: AI (253) data position 13: Bad checksum '3', expected '8'", "" },
+ /*1063*/ { -1, "^25312345678901234^390112345678901234^2012", ZINT_WARN_NONCOMPLIANT, "25312345678901234\035390112345678901234\0352012", "261: AI (253) data position 13: Bad checksum '3', expected '8'", "" },
+ /*1064*/ { GS1RAW_MODE, "25312345678901234\035390112345678901234\0352012", ZINT_WARN_NONCOMPLIANT, "25312345678901234\035390112345678901234\0352012", "261: AI (253) data position 13: Bad checksum '3', expected '8'", "" },
+ /*1065*/ { -1, "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284\035390112345678901234\0352012", "", "" },
+ /*1066*/ { -1, "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234\0350112345678901234390112345678901234\0352012", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1067*/ { -1, "^25312345678901234^0112345678901234390112345678901234^2012", ZINT_WARN_NONCOMPLIANT, "25312345678901234\0350112345678901234390112345678901234\0352012", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1068*/ { GS1RAW_MODE, "25312345678901234\0350112345678901234390112345678901234\0352012", ZINT_WARN_NONCOMPLIANT, "25312345678901234\0350112345678901234390112345678901234\0352012", "261: AI (01) data position 14: Bad checksum '4', expected '1'", "" },
+ /*1069*/ { -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284\0350112345678901231390112345678901234\0352012", "", "" },
+ /*1070*/ { -1, "^25312345678901284^0112345678901231390112345678901234^2012", 0, "25312345678901284\0350112345678901231390112345678901234\0352012", "", "" },
+ /*1071*/ { GS1RAW_MODE, "25312345678901284\0350112345678901231390112345678901234\0352012", 0, "25312345678901284\0350112345678901231390112345678901234\0352012", "", "" },
+ /*1072*/ { -1, "[01]12345678901231[0A]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "", "257: Invalid AI at position 19 in input (non-numeric characters in AI)", "" },
+ /*1073*/ { -1, "^01123456789012310A12345678901231^2012", ZINT_ERROR_INVALID_DATA, "", "857: Invalid AI at position 18", "" },
+ /*1074*/ { GS1RAW_MODE, "01123456789012310A12345678901231\0352012", ZINT_ERROR_INVALID_DATA, "", "857: Invalid AI at position 17", "" },
+ /*1075*/ { -1, "[01]12345678901231[0]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 19 in input (AI too short)", "" },
+ /*1076*/ { -1, "[01]12345678901231[]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "", "256: Invalid AI at position 19 in input (AI too short)", "" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
struct zint_symbol *symbol = NULL;
- int reduced_length = 0; /* Suppress clang -fsanitize=memory false positive */
+ int reduced_length ZINT_TESTUTIL_SANITIZEM_INIT;
- char reduced[1024] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char reduced[1024] ZINT_TESTUTIL_SANITIZEM_INIT;
char escaped[1024];
+ char escaped2[1024];
testStartSymbol(p_ctx->func_name, &symbol);
@@ -1606,13 +1874,18 @@ static void test_gs1_verify(const testCtx *const p_ctx) {
assert_nonnull(symbol, "Symbol not created\n");
length = (int) strlen(data[i].data);
+ if (data[i].input_mode != -1) {
+ symbol->input_mode = data[i].input_mode;
+ }
- ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, ZUCP(reduced), &reduced_length);
+ ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, ZUCP(reduced), &reduced_length, 0 /*set_hrt*/);
if (p_ctx->generate) {
- printf(" /*%3d*/ { \"%s\", %s, \"%s\", \"%s\" },\n",
- i, testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), testUtilErrorName(ret),
- data[i].expected, symbol->errtxt);
+ printf(" /*%3d*/ { %s, \"%s\", %s, \"%s\", \"%s\", \"%s\" },\n",
+ i, testUtilInputModeName(data[i].input_mode),
+ testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), testUtilErrorName(ret),
+ testUtilEscape(data[i].expected, (int) strlen(data[i].expected), escaped2, sizeof(escaped2)),
+ symbol->errtxt, data[i].comment);
} else {
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (length %d \"%s\") (%s)\n",
i, ret, data[i].ret, length, data[i].data, symbol->errtxt);
@@ -1636,6 +1909,7 @@ static void test_gs1_verify(const testCtx *const p_ctx) {
static void test_gs1_lint(const testCtx *const p_ctx) {
struct item {
+ int input_mode;
const char *data;
int ret;
const char *expected;
@@ -1643,666 +1917,704 @@ static void test_gs1_lint(const testCtx *const p_ctx) {
};
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
- /* 0*/ { "[00]123456789012345675", 0, "00123456789012345675", "" }, /* numeric */
- /* 1*/ { "[00]12345678901234567.", ZINT_WARN_NONCOMPLIANT, "0012345678901234567.", "261: AI (00) position 18: Non-numeric character '.'" }, /* numeric */
- /* 2*/ { "[00]123456789012345678", ZINT_WARN_NONCOMPLIANT, "00123456789012345678", "261: AI (00) position 18: Bad checksum '8', expected '5'" }, /* csum */
- /* 3*/ { "[00]1234567890123456759", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (00)" }, /* length */
- /* 4*/ { "[00]12345678901234567", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (00)" }, /* length */
- /* 5*/ { "[00]123456789012345675A", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (00)" }, /* length */
- /* 6*/ { "[91]!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", 0, "91!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", "" }, /* cset82 */
- /* 7*/ { "[91] ", ZINT_WARN_NONCOMPLIANT, "91 ", "261: AI (91) position 1: Invalid CSET 82 character ' '" }, /* cset82 */
- /* 8*/ { "[91]#", ZINT_WARN_NONCOMPLIANT, "91#", "261: AI (91) position 1: Invalid CSET 82 character '#'" }, /* cset82 */
- /* 9*/ { "[91]a^", ZINT_WARN_NONCOMPLIANT, "91a^", "261: AI (91) position 2: Invalid CSET 82 character '^'" }, /* cset82 */
- /* 10*/ { "[91]!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxy{", ZINT_WARN_NONCOMPLIANT, "91!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxy{", "261: AI (91) position 82: Invalid CSET 82 character '{'" }, /* cset82 */
- /* 11*/ { "[8010]0123#-/456789ABCDEFGHIJKLMNOPQ", 0, "80100123#-/456789ABCDEFGHIJKLMNOPQ", "" }, /* cset39 */
- /* 12*/ { "[8010]6789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, "80106789ABCDEFGHIJKLMNOPQRSTUVWXYZ", "" }, /* cset39 */
- /* 13*/ { "[8010]01!", ZINT_WARN_NONCOMPLIANT, "801001!", "261: AI (8010) position 3: Invalid CSET 39 character '!'" }, /* cset39 */
- /* 14*/ { "[8010]01a", ZINT_WARN_NONCOMPLIANT, "801001a", "261: AI (8010) position 3: Invalid CSET 39 character 'a'" }, /* cset39 */
- /* 15*/ { "[8010]6789ABCDEFGHIJKLMNOPQRSTUVWXY}", ZINT_WARN_NONCOMPLIANT, "80106789ABCDEFGHIJKLMNOPQRSTUVWXY}", "261: AI (8010) position 30: Invalid CSET 39 character '}'" }, /* cset39 */
- /* 16*/ { "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", 0, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", "" }, /* cset64 */
- /* 17*/ { "[8030]+0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", ZINT_WARN_NONCOMPLIANT, "8030+0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", "261: AI (8030) position 1: Invalid CSET 64 character '+'" }, /* cset64 */
- /* 18*/ { "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz", ZINT_WARN_NONCOMPLIANT, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz", "261: AI (8030) position 38: Invalid CSET 64 character '^'" }, /* cset64 */
- /* 19*/ { "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz==", 0, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz==", "" }, /* cset64 */
- /* 20*/ { "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz=", ZINT_WARN_NONCOMPLIANT, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz=", "261: AI (8030) position 65: Invalid CSET 64 character '='" }, /* cset64 */
- /* 21*/ { "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz1=", 0, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz1=", "" }, /* cset64 */
- /* 22*/ { "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz", ZINT_WARN_NONCOMPLIANT, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz", "261: AI (8030) position 38: Invalid CSET 64 character '='" }, /* cset64 */
- /* 23*/ { "[8010]#-/0123456789ABCDEFGHIJKLMNOPQ", ZINT_WARN_NONCOMPLIANT, "8010#-/0123456789ABCDEFGHIJKLMNOPQ", "261: AI (8010) position 1: Non-numeric company prefix '#'" }, /* key */
- /* 24*/ { "[8010]0#-/123456789ABCDEFGHIJKLMNOPQ", ZINT_WARN_NONCOMPLIANT, "80100#-/123456789ABCDEFGHIJKLMNOPQ", "261: AI (8010) position 2: Non-numeric company prefix '#'" }, /* key */
- /* 25*/ { "[8010]01#-/123456789ABCDEFGHIJKLMNOP", ZINT_WARN_NONCOMPLIANT, "801001#-/123456789ABCDEFGHIJKLMNOP", "261: AI (8010) position 3: Non-numeric company prefix '#'" }, /* key */
- /* 26*/ { "[8010]012#-/123456789ABCDEFGHIJKLMNO", ZINT_WARN_NONCOMPLIANT, "8010012#-/123456789ABCDEFGHIJKLMNO", "261: AI (8010) position 4: Non-numeric company prefix '#'" }, /* key */
- /* 27*/ { "[8010]0123#-/123456789ABCDEFGHIJKLMN", 0, "80100123#-/123456789ABCDEFGHIJKLMN", "" }, /* key */
- /* 28*/ { "[401]0", ZINT_WARN_NONCOMPLIANT, "4010", "259: Invalid data length for AI (401)" }, /* key */
- /* 29*/ { "[8013]1987654Ad4X4bL5ttr2310c2K", 0, "80131987654Ad4X4bL5ttr2310c2K", "" }, /* csumalpha */
- /* 30*/ { "[8013]12345678901234567890123NT", 0, "801312345678901234567890123NT", "" }, /* csumalpha */
- /* 31*/ { "[8013]12345_ABCDEFGHIJKLMCP", 0, "801312345_ABCDEFGHIJKLMCP", "" }, /* csumalpha */
- /* 32*/ { "[8013]12345_NOPQRSTUVWXYZDN", 0, "801312345_NOPQRSTUVWXYZDN", "" }, /* csumalpha */
- /* 33*/ { "[8013]12345_abcdefghijklmN3", 0, "801312345_abcdefghijklmN3", "" }, /* csumalpha */
- /* 34*/ { "[8013]12345_nopqrstuvwxyzP2", 0, "801312345_nopqrstuvwxyzP2", "" }, /* csumalpha */
- /* 35*/ { "[8013]12345_!\"%&'()*+,-./LC", 0, "801312345_!\"%&'()*+,-./LC", "" }, /* csumalpha */
- /* 36*/ { "[8013]12345_0123456789:;<=>?62", 0, "801312345_0123456789:;<=>?62", "" }, /* csumalpha */
- /* 37*/ { "[8013]7907665Bm8v2AB", 0, "80137907665Bm8v2AB", "" }, /* csumalpha */
- /* 38*/ { "[8013]97850l6KZm0yCD", 0, "801397850l6KZm0yCD", "" }, /* csumalpha */
- /* 39*/ { "[8013]225803106GSpEF", 0, "8013225803106GSpEF", "" }, /* csumalpha */
- /* 40*/ { "[8013]149512464PM+GH", 0, "8013149512464PM+GH", "" }, /* csumalpha */
- /* 41*/ { "[8013]62577B8fRG7HJK", 0, "801362577B8fRG7HJK", "" }, /* csumalpha */
- /* 42*/ { "[8013]515942070CYxLM", 0, "8013515942070CYxLM", "" }, /* csumalpha */
- /* 43*/ { "[8013]390800494sP6NP", 0, "8013390800494sP6NP", "" }, /* csumalpha */
- /* 44*/ { "[8013]386830132uO+QR", 0, "8013386830132uO+QR", "" }, /* csumalpha */
- /* 45*/ { "[8013]53395376X1:nST", 0, "801353395376X1:nST", "" }, /* csumalpha */
- /* 46*/ { "[8013]957813138Sb6UV", 0, "8013957813138Sb6UV", "" }, /* csumalpha */
- /* 47*/ { "[8013]530790no0qOgWX", 0, "8013530790no0qOgWX", "" }, /* csumalpha */
- /* 48*/ { "[8013]62185314IvwmYZ", 0, "801362185314IvwmYZ", "" }, /* csumalpha */
- /* 49*/ { "[8013]23956qk1&dB!23", 0, "801323956qk1&dB!23", "" }, /* csumalpha */
- /* 50*/ { "[8013]794394895ic045", 0, "8013794394895ic045", "" }, /* csumalpha */
- /* 51*/ { "[8013]57453Uq3qA?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", 0, "91!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", "" }, /* cset82 */
+ /* 13*/ { -1, "[91] ", ZINT_WARN_NONCOMPLIANT, "91 ", "261: AI (91) data position 1: Invalid CSET 82 character ' '" }, /* cset82 */
+ /* 14*/ { -1, "^91 ", ZINT_WARN_NONCOMPLIANT, "91 ", "261: AI (91) data position 1: Invalid CSET 82 character ' '" }, /* cset82 */
+ /* 15*/ { GS1RAW_MODE, "91 ", ZINT_WARN_NONCOMPLIANT, "91 ", "261: AI (91) data position 1: Invalid CSET 82 character ' '" }, /* cset82 */
+ /* 16*/ { -1, "[91]#", ZINT_WARN_NONCOMPLIANT, "91#", "261: AI (91) data position 1: Invalid CSET 82 character '#'" }, /* cset82 */
+ /* 17*/ { -1, "[91]a^", ZINT_WARN_NONCOMPLIANT, "91a^", "261: AI (91) data position 2: Invalid CSET 82 character '^'" }, /* cset82 */
+ /* 18*/ { -1, "^91a^", 0, "91a", "" }, /* cset82 - caret interpreted as FNC1 */
+ /* 19*/ { GS1RAW_MODE, "91a^", ZINT_WARN_NONCOMPLIANT, "91a^", "261: AI (91) data position 2: Invalid CSET 82 character '^'" }, /* cset82 */
+ /* 20*/ { -1, "[91]a^345", ZINT_WARN_NONCOMPLIANT, "91a^345", "261: AI (91) data position 2: Invalid CSET 82 character '^'" }, /* cset82 */
+ /* 21*/ { -1, "^91a^345", ZINT_ERROR_INVALID_DATA, "91a^345", "856: Invalid AI (34) at position 6" }, /* cset82 - caret interpreted as FNC1 */
+ /* 22*/ { GS1RAW_MODE, "91a^345", ZINT_WARN_NONCOMPLIANT, "91a^345", "261: AI (91) data position 2: Invalid CSET 82 character '^'" }, /* cset82 */
+ /* 23*/ { -1, "[91]a^3450123456", ZINT_WARN_NONCOMPLIANT, "91a^3450123456", "261: AI (91) data position 2: Invalid CSET 82 character '^'" }, /* cset82 */
+ /* 24*/ { -1, "^91a^3450123456", 0, "91a\0353450123456", "" }, /* cset82 - caret interpreted as FNC1 */
+ /* 25*/ { GS1RAW_MODE, "91a^3450123456", ZINT_WARN_NONCOMPLIANT, "91a^3450123456", "261: AI (91) data position 2: Invalid CSET 82 character '^'" }, /* cset82 */
+ /* 26*/ { -1, "[91]!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxy{", ZINT_WARN_NONCOMPLIANT, "91!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxy{", "261: AI (91) data position 82: Invalid CSET 82 character '{'" }, /* cset82 */
+ /* 27*/ { -1, "^91!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxy{", ZINT_WARN_NONCOMPLIANT, "91!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxy{", "261: AI (91) data position 82: Invalid CSET 82 character '{'" }, /* cset82 */
+ /* 28*/ { GS1RAW_MODE, "91!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxy{", ZINT_WARN_NONCOMPLIANT, "91!\"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxy{", "261: AI (91) data position 82: Invalid CSET 82 character '{'" }, /* cset82 */
+ /* 29*/ { -1, "[8010]0123#-/456789ABCDEFGHIJKLMNOPQ", 0, "80100123#-/456789ABCDEFGHIJKLMNOPQ", "" }, /* cset39 */
+ /* 30*/ { -1, "^80100123#-/456789ABCDEFGHIJKLMNOPQ", 0, "80100123#-/456789ABCDEFGHIJKLMNOPQ", "" }, /* cset39 */
+ /* 31*/ { GS1RAW_MODE, "80100123#-/456789ABCDEFGHIJKLMNOPQ", 0, "80100123#-/456789ABCDEFGHIJKLMNOPQ", "" }, /* cset39 */
+ /* 32*/ { -1, "[8010]6789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, "80106789ABCDEFGHIJKLMNOPQRSTUVWXYZ", "" }, /* cset39 */
+ /* 33*/ { -1, "[8010]01!", ZINT_WARN_NONCOMPLIANT, "801001!", "261: AI (8010) data position 3: Invalid CSET 39 character '!'" }, /* cset39 */
+ /* 34*/ { -1, "^801001!", ZINT_WARN_NONCOMPLIANT, "801001!", "261: AI (8010) data position 3: Invalid CSET 39 character '!'" }, /* cset39 */
+ /* 35*/ { GS1RAW_MODE, "801001!", ZINT_WARN_NONCOMPLIANT, "801001!", "261: AI (8010) data position 3: Invalid CSET 39 character '!'" }, /* cset39 */
+ /* 36*/ { -1, "[8010]01a", ZINT_WARN_NONCOMPLIANT, "801001a", "261: AI (8010) data position 3: Invalid CSET 39 character 'a'" }, /* cset39 */
+ /* 37*/ { -1, "[8010]6789ABCDEFGHIJKLMNOPQRSTUVWXY}", ZINT_WARN_NONCOMPLIANT, "80106789ABCDEFGHIJKLMNOPQRSTUVWXY}", "261: AI (8010) data position 30: Invalid CSET 39 character '}'" }, /* cset39 */
+ /* 38*/ { -1, "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", 0, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", "" }, /* cset64 */
+ /* 39*/ { -1, "[8030]+0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", ZINT_WARN_NONCOMPLIANT, "8030+0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", "261: AI (8030) data position 1: Invalid CSET 64 character '+'" }, /* cset64 */
+ /* 40*/ { -1, "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz", ZINT_WARN_NONCOMPLIANT, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz", "261: AI (8030) data position 38: Invalid CSET 64 character '^'" }, /* cset64 */
+ /* 41*/ { -1, "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz==", 0, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz==", "" }, /* cset64 */
+ /* 42*/ { -1, "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz=", ZINT_WARN_NONCOMPLIANT, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz=", "261: AI (8030) data position 65: Invalid CSET 64 character '='" }, /* cset64 */
+ /* 43*/ { -1, "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz1=", 0, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz1=", "" }, /* cset64 */
+ /* 44*/ { -1, "[8030]-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz", ZINT_WARN_NONCOMPLIANT, "8030-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz", "261: AI (8030) data position 38: Invalid CSET 64 character '='" }, /* cset64 */
+ /* 45*/ { -1, "[8010]#-/0123456789ABCDEFGHIJKLMNOPQ", ZINT_WARN_NONCOMPLIANT, "8010#-/0123456789ABCDEFGHIJKLMNOPQ", "261: AI (8010) data position 1: Non-numeric company prefix '#'" }, /* key */
+ /* 46*/ { -1, "[8010]0#-/123456789ABCDEFGHIJKLMNOPQ", ZINT_WARN_NONCOMPLIANT, "80100#-/123456789ABCDEFGHIJKLMNOPQ", "261: AI (8010) data position 2: Non-numeric company prefix '#'" }, /* key */
+ /* 47*/ { -1, "[8010]01#-/123456789ABCDEFGHIJKLMNOP", ZINT_WARN_NONCOMPLIANT, "801001#-/123456789ABCDEFGHIJKLMNOP", "261: AI (8010) data position 3: Non-numeric company prefix '#'" }, /* key */
+ /* 48*/ { -1, "[8010]012#-/123456789ABCDEFGHIJKLMNO", ZINT_WARN_NONCOMPLIANT, "8010012#-/123456789ABCDEFGHIJKLMNO", "261: AI (8010) data position 4: Non-numeric company prefix '#'" }, /* key */
+ /* 49*/ { -1, "^8010012#-/123456789ABCDEFGHIJKLMNO", ZINT_WARN_NONCOMPLIANT, "8010012#-/123456789ABCDEFGHIJKLMNO", "261: AI (8010) data position 4: Non-numeric company prefix '#'" }, /* key */
+ /* 50*/ { GS1RAW_MODE, "8010012#-/123456789ABCDEFGHIJKLMNO", ZINT_WARN_NONCOMPLIANT, "8010012#-/123456789ABCDEFGHIJKLMNO", "261: AI (8010) data position 4: Non-numeric company prefix '#'" }, /* key */
+ /* 51*/ { -1, "[8010]0123#-/123456789ABCDEFGHIJKLMN", 0, "80100123#-/123456789ABCDEFGHIJKLMN", "" }, /* key */
+ /* 52*/ { -1, "[401]0", ZINT_WARN_NONCOMPLIANT, "4010", "259: Invalid data length for AI (401) at position 1" }, /* key */
+ /* 53*/ { -1, "^4010", ZINT_WARN_NONCOMPLIANT, "4010", "259: Invalid data length for AI (401) at position 2" }, /* key */
+ /* 54*/ { GS1RAW_MODE, "4010", ZINT_WARN_NONCOMPLIANT, "4010", "259: Invalid data length for AI (401) at position 1" }, /* key */
+ /* 55*/ { -1, "[8013]1987654Ad4X4bL5ttr2310c2K", 0, "80131987654Ad4X4bL5ttr2310c2K", "" }, /* csumalpha */
+ /* 56*/ { -1, "[8013]12345678901234567890123NT", 0, "801312345678901234567890123NT", "" }, /* csumalpha */
+ /* 57*/ { -1, "[8013]12345_ABCDEFGHIJKLMCP", 0, "801312345_ABCDEFGHIJKLMCP", "" }, /* csumalpha */
+ /* 58*/ { -1, "[8013]12345_NOPQRSTUVWXYZDN", 0, "801312345_NOPQRSTUVWXYZDN", "" }, /* csumalpha */
+ /* 59*/ { -1, "[8013]12345_abcdefghijklmN3", 0, "801312345_abcdefghijklmN3", "" }, /* csumalpha */
+ /* 60*/ { -1, "[8013]12345_nopqrstuvwxyzP2", 0, "801312345_nopqrstuvwxyzP2", "" }, /* csumalpha */
+ /* 61*/ { -1, "[8013]12345_!\"%&'()*+,-./LC", 0, "801312345_!\"%&'()*+,-./LC", "" }, /* csumalpha */
+ /* 62*/ { -1, "[8013]12345_0123456789:;<=>?62", 0, "801312345_0123456789:;<=>?62", "" }, /* csumalpha */
+ /* 63*/ { -1, "[8013]7907665Bm8v2AB", 0, "80137907665Bm8v2AB", "" }, /* csumalpha */
+ /* 64*/ { -1, "[8013]97850l6KZm0yCD", 0, "801397850l6KZm0yCD", "" }, /* csumalpha */
+ /* 65*/ { -1, "[8013]225803106GSpEF", 0, "8013225803106GSpEF", "" }, /* csumalpha */
+ /* 66*/ { -1, "[8013]149512464PM+GH", 0, "8013149512464PM+GH", "" }, /* csumalpha */
+ /* 67*/ { -1, "[8013]62577B8fRG7HJK", 0, "801362577B8fRG7HJK", "" }, /* csumalpha */
+ /* 68*/ { -1, "[8013]515942070CYxLM", 0, "8013515942070CYxLM", "" }, /* csumalpha */
+ /* 69*/ { -1, "[8013]390800494sP6NP", 0, "8013390800494sP6NP", "" }, /* csumalpha */
+ /* 70*/ { -1, "[8013]386830132uO+QR", 0, "8013386830132uO+QR", "" }, /* csumalpha */
+ /* 71*/ { -1, "[8013]53395376X1:nST", 0, "801353395376X1:nST", "" }, /* csumalpha */
+ /* 72*/ { -1, "[8013]957813138Sb6UV", 0, "8013957813138Sb6UV", "" }, /* csumalpha */
+ /* 73*/ { -1, "[8013]530790no0qOgWX", 0, "8013530790no0qOgWX", "" }, /* csumalpha */
+ /* 74*/ { -1, "[8013]62185314IvwmYZ", 0, "801362185314IvwmYZ", "" }, /* csumalpha */
+ /* 75*/ { -1, "[8013]23956qk1&dB!23", 0, "801323956qk1&dB!23", "" }, /* csumalpha */
+ /* 76*/ { -1, "[8013]794394895ic045", 0, "8013794394895ic045", "" }, /* csumalpha */
+ /* 77*/ { -1, "[8013]57453Uq3qAinput_mode = data[i].input_mode;
+ }
+ ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, ZUCP(reduced), &reduced_length, 0 /*set_hrt*/);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (length %d \"%s\") (%s)\n",
i, ret, data[i].ret, length, data[i].data, symbol->errtxt);
@@ -2357,150 +2672,197 @@ static void test_input_mode(const testCtx *const p_ctx) {
/* 0*/ { BARCODE_AZTEC, "[01]12345678901231", GS1_MODE, -1 , 0, 0 },
/* 1*/ { BARCODE_AZTEC, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
/* 2*/ { BARCODE_AZTEC, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
- /* 3*/ { BARCODE_AZTEC, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 4*/ { BARCODE_AZTEC, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 5*/ { BARCODE_AZTEC, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 6*/ { BARCODE_AZTEC, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 7*/ { BARCODE_AZTEC, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 8*/ { BARCODE_AZTEC, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 9*/ { BARCODE_AZTEC, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 10*/ { BARCODE_AZTEC, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 11*/ { BARCODE_AZTEC, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 12*/ { BARCODE_AZTEC, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 13*/ { BARCODE_AZTEC, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
- /* 14*/ { BARCODE_AZTEC, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
- /* 15*/ { BARCODE_AZTEC, "[10]()", GS1_MODE, -1, 0, 0 },
- /* 16*/ { BARCODE_AZTEC, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 17*/ { BARCODE_AZTEC, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 18*/ { BARCODE_AZTEC, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
- /* 19*/ { BARCODE_AZTEC, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 20*/ { BARCODE_AZTEC, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 21*/ { BARCODE_AZTEC, "1234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* Must still begin with AI */
- /* 22*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* Codablock-F does not support GS1 */
- /* 23*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
- /* 24*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE | ESCAPE_MODE | GS1NOCHECK_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
- /* 25*/ { BARCODE_CODABLOCKF, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
- /* 26*/ { BARCODE_CODABLOCKF, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
- /* 27*/ { BARCODE_CODEONE, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
- /* 28*/ { BARCODE_CODEONE, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
- /* 29*/ { BARCODE_CODEONE, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
- /* 30*/ { BARCODE_CODEONE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 31*/ { BARCODE_CODEONE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 32*/ { BARCODE_CODEONE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 33*/ { BARCODE_CODEONE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 34*/ { BARCODE_CODEONE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 35*/ { BARCODE_CODEONE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 36*/ { BARCODE_CODEONE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 37*/ { BARCODE_CODEONE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 38*/ { BARCODE_CODEONE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 39*/ { BARCODE_CODEONE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 40*/ { BARCODE_CODEONE, "[10]()", GS1_MODE, -1, 0, 0 },
- /* 41*/ { BARCODE_CODEONE, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 42*/ { BARCODE_CODEONE, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 43*/ { BARCODE_CODEONE, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
- /* 44*/ { BARCODE_CODEONE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 45*/ { BARCODE_CODEONE, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 46*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
- /* 47*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
- /* 48*/ { BARCODE_CODE16K, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
- /* 49*/ { BARCODE_CODE16K, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 50*/ { BARCODE_CODE16K, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 51*/ { BARCODE_CODE16K, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 52*/ { BARCODE_CODE16K, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 53*/ { BARCODE_CODE16K, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 54*/ { BARCODE_CODE16K, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 55*/ { BARCODE_CODE16K, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 56*/ { BARCODE_CODE16K, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 57*/ { BARCODE_CODE16K, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 58*/ { BARCODE_CODE16K, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 59*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
- /* 60*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
- /* 61*/ { BARCODE_CODE16K, "[10]()", GS1_MODE, -1, 0, 0 },
- /* 62*/ { BARCODE_CODE16K, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 63*/ { BARCODE_CODE16K, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 64*/ { BARCODE_CODE16K, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
- /* 65*/ { BARCODE_CODE16K, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 66*/ { BARCODE_CODE16K, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 67*/ { BARCODE_CODE49, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
- /* 68*/ { BARCODE_CODE49, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
- /* 69*/ { BARCODE_CODE49, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
- /* 70*/ { BARCODE_CODE49, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 71*/ { BARCODE_CODE49, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 72*/ { BARCODE_CODE49, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 73*/ { BARCODE_CODE49, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 74*/ { BARCODE_CODE49, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 75*/ { BARCODE_CODE49, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 76*/ { BARCODE_CODE49, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 77*/ { BARCODE_CODE49, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 78*/ { BARCODE_CODE49, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 79*/ { BARCODE_CODE49, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 80*/ { BARCODE_CODE49, "[10]()", GS1_MODE, -1, 0, 0 },
- /* 81*/ { BARCODE_CODE49, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 82*/ { BARCODE_CODE49, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 83*/ { BARCODE_CODE49, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
- /* 84*/ { BARCODE_CODE49, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 85*/ { BARCODE_CODE49, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 86*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
- /* 87*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
- /* 88*/ { BARCODE_DATAMATRIX, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
- /* 89*/ { BARCODE_DATAMATRIX, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 90*/ { BARCODE_DATAMATRIX, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 91*/ { BARCODE_DATAMATRIX, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 92*/ { BARCODE_DATAMATRIX, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 93*/ { BARCODE_DATAMATRIX, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 94*/ { BARCODE_DATAMATRIX, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 95*/ { BARCODE_DATAMATRIX, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /* 96*/ { BARCODE_DATAMATRIX, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /* 97*/ { BARCODE_DATAMATRIX, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /* 98*/ { BARCODE_DATAMATRIX, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /* 99*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
- /*100*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
- /*101*/ { BARCODE_DATAMATRIX, "[10]()", GS1_MODE, -1, 0, 0 },
- /*102*/ { BARCODE_DATAMATRIX, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*103*/ { BARCODE_DATAMATRIX, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*104*/ { BARCODE_DATAMATRIX, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
- /*105*/ { BARCODE_DATAMATRIX, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*106*/ { BARCODE_DATAMATRIX, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*107*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
- /*108*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
- /*109*/ { BARCODE_DOTCODE, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
- /*110*/ { BARCODE_DOTCODE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /*111*/ { BARCODE_DOTCODE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /*112*/ { BARCODE_DOTCODE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*113*/ { BARCODE_DOTCODE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /*114*/ { BARCODE_DOTCODE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*115*/ { BARCODE_DOTCODE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /*116*/ { BARCODE_DOTCODE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /*117*/ { BARCODE_DOTCODE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /*118*/ { BARCODE_DOTCODE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*119*/ { BARCODE_DOTCODE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /*120*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE, READER_INIT, 0, 0 }, /* Reader Init permissible with default GS1 mode */
- /*121*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, READER_INIT, 0, 1 },
- /*122*/ { BARCODE_DOTCODE, "[10]()", GS1_MODE, -1, 0, 0 },
- /*123*/ { BARCODE_DOTCODE, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*124*/ { BARCODE_DOTCODE, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*125*/ { BARCODE_DOTCODE, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
- /*126*/ { BARCODE_DOTCODE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*127*/ { BARCODE_DOTCODE, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*128*/ { BARCODE_QRCODE, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
- /*129*/ { BARCODE_QRCODE, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
- /*130*/ { BARCODE_QRCODE, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
- /*131*/ { BARCODE_QRCODE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /*132*/ { BARCODE_QRCODE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /*133*/ { BARCODE_QRCODE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*134*/ { BARCODE_QRCODE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /*135*/ { BARCODE_QRCODE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*136*/ { BARCODE_QRCODE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /*137*/ { BARCODE_QRCODE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
- /*138*/ { BARCODE_QRCODE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
- /*139*/ { BARCODE_QRCODE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*140*/ { BARCODE_QRCODE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
- /*141*/ { BARCODE_QRCODE, "[10]()", GS1_MODE, -1, 0, 0 },
- /*142*/ { BARCODE_QRCODE, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*143*/ { BARCODE_QRCODE, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*144*/ { BARCODE_QRCODE, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
- /*145*/ { BARCODE_QRCODE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
- /*146*/ { BARCODE_QRCODE, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 3*/ { BARCODE_AZTEC, "^0112345678901231", GS1_MODE, -1, 0, 1 },
+ /* 4*/ { BARCODE_AZTEC, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, 0, 1 },
+ /* 5*/ { BARCODE_AZTEC, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /* 6*/ { BARCODE_AZTEC, "^0112345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /* 7*/ { BARCODE_AZTEC, "0112345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /* 8*/ { BARCODE_AZTEC, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /* 9*/ { BARCODE_AZTEC, "^0112345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /* 10*/ { BARCODE_AZTEC, "0112345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE | GS1RAW_MODE, -1, 0, 1 },
+ /* 11*/ { BARCODE_AZTEC, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 12*/ { BARCODE_AZTEC, "^01123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 13*/ { BARCODE_AZTEC, "01123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 14*/ { BARCODE_AZTEC, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 15*/ { BARCODE_AZTEC, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 16*/ { BARCODE_AZTEC, "^0112345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 17*/ { BARCODE_AZTEC, "0112345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 18*/ { BARCODE_AZTEC, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 19*/ { BARCODE_AZTEC, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /* 20*/ { BARCODE_AZTEC, "^011234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /* 21*/ { BARCODE_AZTEC, "011234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /* 22*/ { BARCODE_AZTEC, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 23*/ { BARCODE_AZTEC, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 24*/ { BARCODE_AZTEC, "^011234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 25*/ { BARCODE_AZTEC, "011234567890123", GS1_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 26*/ { BARCODE_AZTEC, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 27*/ { BARCODE_AZTEC, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 28*/ { BARCODE_AZTEC, "^0112345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 29*/ { BARCODE_AZTEC, "0112345678901231", GS1_MODE | GS1RAW_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 30*/ { BARCODE_AZTEC, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 31*/ { BARCODE_AZTEC, "[10]()", GS1_MODE, -1, 0, 0 },
+ /* 32*/ { BARCODE_AZTEC, "^10()", GS1_MODE, -1, 0, 1 },
+ /* 33*/ { BARCODE_AZTEC, "10()", GS1_MODE | GS1RAW_MODE, -1, 0, 1 },
+ /* 34*/ { BARCODE_AZTEC, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 35*/ { BARCODE_AZTEC, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 36*/ { BARCODE_AZTEC, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
+ /* 37*/ { BARCODE_AZTEC, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 38*/ { BARCODE_AZTEC, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 39*/ { BARCODE_AZTEC, "1234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* Must still begin with AI */
+ /* 40*/ { BARCODE_AZTEC, "^1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 41*/ { BARCODE_AZTEC, "1234", GS1_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 42*/ { BARCODE_AZTEC, "https://example.com/01/12345678901231", GS1_MODE, -1, 0, 0 },
+ /* 43*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* Codablock-F does not support GS1 */
+ /* 44*/ { BARCODE_CODABLOCKF, "^0112345678901231", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 45*/ { BARCODE_CODABLOCKF, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 46*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 47*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE | ESCAPE_MODE | GS1NOCHECK_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 48*/ { BARCODE_CODABLOCKF, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 49*/ { BARCODE_CODABLOCKF, "^1234", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 50*/ { BARCODE_CODABLOCKF, "1234", GS1_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 51*/ { BARCODE_CODABLOCKF, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 52*/ { BARCODE_CODEONE, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
+ /* 53*/ { BARCODE_CODEONE, "^0112345678901231", GS1_MODE, -1, 0, 1 },
+ /* 54*/ { BARCODE_CODEONE, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, 0, 1 },
+ /* 55*/ { BARCODE_CODEONE, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
+ /* 56*/ { BARCODE_CODEONE, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
+ /* 57*/ { BARCODE_CODEONE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /* 58*/ { BARCODE_CODEONE, "^0112345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /* 59*/ { BARCODE_CODEONE, "0112345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /* 60*/ { BARCODE_CODEONE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /* 61*/ { BARCODE_CODEONE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 62*/ { BARCODE_CODEONE, "^01123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 63*/ { BARCODE_CODEONE, "01123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 64*/ { BARCODE_CODEONE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 65*/ { BARCODE_CODEONE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 66*/ { BARCODE_CODEONE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 67*/ { BARCODE_CODEONE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /* 68*/ { BARCODE_CODEONE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /* 69*/ { BARCODE_CODEONE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 70*/ { BARCODE_CODEONE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 71*/ { BARCODE_CODEONE, "[10]()", GS1_MODE, -1, 0, 0 },
+ /* 72*/ { BARCODE_CODEONE, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 73*/ { BARCODE_CODEONE, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 74*/ { BARCODE_CODEONE, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
+ /* 75*/ { BARCODE_CODEONE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 76*/ { BARCODE_CODEONE, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 77*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
+ /* 78*/ { BARCODE_CODE16K, "^0112345678901231", GS1_MODE, -1, 0, 1 },
+ /* 79*/ { BARCODE_CODE16K, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, 0, 1 },
+ /* 80*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
+ /* 81*/ { BARCODE_CODE16K, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
+ /* 82*/ { BARCODE_CODE16K, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /* 83*/ { BARCODE_CODE16K, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /* 84*/ { BARCODE_CODE16K, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 85*/ { BARCODE_CODE16K, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 86*/ { BARCODE_CODE16K, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 87*/ { BARCODE_CODE16K, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 88*/ { BARCODE_CODE16K, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /* 89*/ { BARCODE_CODE16K, "^011234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /* 90*/ { BARCODE_CODE16K, "011234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /* 91*/ { BARCODE_CODE16K, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /* 92*/ { BARCODE_CODE16K, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 93*/ { BARCODE_CODE16K, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /* 94*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 95*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
+ /* 96*/ { BARCODE_CODE16K, "[10]()", GS1_MODE, -1, 0, 0 },
+ /* 97*/ { BARCODE_CODE16K, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 98*/ { BARCODE_CODE16K, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /* 99*/ { BARCODE_CODE16K, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
+ /*100*/ { BARCODE_CODE16K, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*101*/ { BARCODE_CODE16K, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*102*/ { BARCODE_CODE49, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
+ /*103*/ { BARCODE_CODE49, "^0112345678901231", GS1_MODE, -1, 0, 1 },
+ /*104*/ { BARCODE_CODE49, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, 0, 1 },
+ /*105*/ { BARCODE_CODE49, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
+ /*106*/ { BARCODE_CODE49, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
+ /*107*/ { BARCODE_CODE49, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /*108*/ { BARCODE_CODE49, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /*109*/ { BARCODE_CODE49, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*110*/ { BARCODE_CODE49, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*111*/ { BARCODE_CODE49, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*112*/ { BARCODE_CODE49, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*113*/ { BARCODE_CODE49, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /*114*/ { BARCODE_CODE49, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /*115*/ { BARCODE_CODE49, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*116*/ { BARCODE_CODE49, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*117*/ { BARCODE_CODE49, "[10]()", GS1_MODE, -1, 0, 0 },
+ /*118*/ { BARCODE_CODE49, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*119*/ { BARCODE_CODE49, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*120*/ { BARCODE_CODE49, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
+ /*121*/ { BARCODE_CODE49, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*122*/ { BARCODE_CODE49, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*123*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
+ /*124*/ { BARCODE_DATAMATRIX, "^0112345678901231", GS1_MODE, -1, 0, 1 },
+ /*125*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
+ /*126*/ { BARCODE_DATAMATRIX, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
+ /*127*/ { BARCODE_DATAMATRIX, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /*128*/ { BARCODE_DATAMATRIX, "^0112345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /*129*/ { BARCODE_DATAMATRIX, "0112345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /*130*/ { BARCODE_DATAMATRIX, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /*131*/ { BARCODE_DATAMATRIX, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*132*/ { BARCODE_DATAMATRIX, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*133*/ { BARCODE_DATAMATRIX, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*134*/ { BARCODE_DATAMATRIX, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*135*/ { BARCODE_DATAMATRIX, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /*136*/ { BARCODE_DATAMATRIX, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /*137*/ { BARCODE_DATAMATRIX, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*138*/ { BARCODE_DATAMATRIX, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*139*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
+ /*140*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 },
+ /*141*/ { BARCODE_DATAMATRIX, "[10]()", GS1_MODE, -1, 0, 0 },
+ /*142*/ { BARCODE_DATAMATRIX, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*143*/ { BARCODE_DATAMATRIX, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*144*/ { BARCODE_DATAMATRIX, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
+ /*145*/ { BARCODE_DATAMATRIX, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*146*/ { BARCODE_DATAMATRIX, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*147*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
+ /*148*/ { BARCODE_DOTCODE, "^0112345678901231", GS1_MODE, -1, 0, 1 },
+ /*149*/ { BARCODE_DOTCODE, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, 0, 1 },
+ /*150*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
+ /*151*/ { BARCODE_DOTCODE, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
+ /*152*/ { BARCODE_DOTCODE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /*153*/ { BARCODE_DOTCODE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /*154*/ { BARCODE_DOTCODE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*155*/ { BARCODE_DOTCODE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*156*/ { BARCODE_DOTCODE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*157*/ { BARCODE_DOTCODE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*158*/ { BARCODE_DOTCODE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /*159*/ { BARCODE_DOTCODE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /*160*/ { BARCODE_DOTCODE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*161*/ { BARCODE_DOTCODE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*162*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE, READER_INIT, 0, 0 }, /* Reader Init permissible with default GS1 mode */
+ /*163*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, READER_INIT, 0, 1 },
+ /*164*/ { BARCODE_DOTCODE, "[10]()", GS1_MODE, -1, 0, 0 },
+ /*165*/ { BARCODE_DOTCODE, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*166*/ { BARCODE_DOTCODE, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*167*/ { BARCODE_DOTCODE, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
+ /*168*/ { BARCODE_DOTCODE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*169*/ { BARCODE_DOTCODE, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*170*/ { BARCODE_QRCODE, "[01]12345678901231", GS1_MODE, -1, 0, 0 },
+ /*171*/ { BARCODE_QRCODE, "^0112345678901231", GS1_MODE, -1, 0, 1 },
+ /*172*/ { BARCODE_QRCODE, "0112345678901231", GS1_MODE | GS1RAW_MODE, -1, 0, 1 },
+ /*173*/ { BARCODE_QRCODE, "[01]12345678901231", GS1_MODE | ESCAPE_MODE, -1, 0, 1 },
+ /*174*/ { BARCODE_QRCODE, "(01)12345678901231", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 1 },
+ /*175*/ { BARCODE_QRCODE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /*176*/ { BARCODE_QRCODE, "(01)12345678901234", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /*177*/ { BARCODE_QRCODE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*178*/ { BARCODE_QRCODE, "(01)123456789012345", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*179*/ { BARCODE_QRCODE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*180*/ { BARCODE_QRCODE, "(01)12345678901234A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*181*/ { BARCODE_QRCODE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 0 },
+ /*182*/ { BARCODE_QRCODE, "^011234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /*183*/ { BARCODE_QRCODE, "011234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, -1, ZINT_WARN_NONCOMPLIANT, 1 },
+ /*184*/ { BARCODE_QRCODE, "(01)1234567890123A", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0, 1 },
+ /*185*/ { BARCODE_QRCODE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*186*/ { BARCODE_QRCODE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0, 0 },
+ /*187*/ { BARCODE_QRCODE, "[10]()", GS1_MODE, -1, 0, 0 },
+ /*188*/ { BARCODE_QRCODE, "(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*189*/ { BARCODE_QRCODE, "(10)()", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*190*/ { BARCODE_QRCODE, "(10)\\(\\)", GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, 0, 0 },
+ /*191*/ { BARCODE_QRCODE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*192*/ { BARCODE_QRCODE, "1234", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 },
+ /*193*/ { BARCODE_QRCODE, "https://example.com/01/12345678901231", GS1_MODE, -1, 0, 0 },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -2528,6 +2890,9 @@ static void test_input_mode(const testCtx *const p_ctx) {
ret = testUtilSymbolCmp(symbol, previous_symbol);
assert_zero(ret, "i:%d testUtilSymbolCmp ret %d != 0\n", i, ret);
}
+ assert_zero(symbol->text_length, "i:%d text_length non-zero %d\n", i, symbol->text_length);
+ assert_zero(symbol->text[0], "i:%d text non-zero %c(%d)\n", i, symbol->text[0], symbol->text[0]);
+
ZBarcode_Delete(previous_symbol);
previous_symbol = symbol;
}
@@ -2554,188 +2919,254 @@ static void test_gs1nocheck_mode(const testCtx *const p_ctx) {
static const struct item data[] = {
/* 0*/ { BARCODE_GS1_128, -1, "[01]12345678901231", "", 0, "" },
/* 1*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231", "", 0, "" },
- /* 2*/ { BARCODE_GS1_128, -1, "[01]12345678901234", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'" },
+ /* 2*/ { BARCODE_GS1_128, -1, "[01]12345678901234", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1'" },
/* 3*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901234", "", 0, "" },
- /* 4*/ { BARCODE_GS1_128, -1, "[01]123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01)" },
- /* 5*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]123456789012345", "", 0, "" },
- /* 6*/ { BARCODE_GS1_128, -1, "[01]1234567890123", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01)" },
- /* 7*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123", "", 0, "" },
- /* 8*/ { BARCODE_GS1_128, -1, "[01]12345678901231[20]1", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20)" },
- /* 9*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231[20]1", "", 0, "" },
- /* 10*/ { BARCODE_GS1_128, -1, "[03]123", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (03)" },
- /* 11*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[03]123", "", 0, "" },
- /* 12*/ { BARCODE_GS1_128, -1, "[04]1234[05]12345[06]123456", "", ZINT_ERROR_INVALID_DATA, "Error 260: Invalid AI (04)" },
- /* 13*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[04]1234[05]12345[06]123456", "", 0, "" },
- /* 14*/ { BARCODE_GS1_128, -1, "[01]1234567890123A", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) position 14: Non-numeric character 'A'" },
- /* 15*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123A", "", 0, "" },
- /* 16*/ { BARCODE_GS1_128, -1, "[01]1234567890123.", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) position 14: Non-numeric character '.'" },
- /* 17*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123.", "", 0, "" },
- /* 18*/ { BARCODE_GS1_128, -1, "[01]1234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
- /* 19*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" }, /* Nonprintable ASCII still checked */
- /* 20*/ { BARCODE_GS1_128, -1, "[01]1234567890123\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" },
- /* 21*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" }, /* Extended ASCII still checked */
- /* 22*/ { BARCODE_GS1_128, -1, "0112345678901231", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" },
- /* 23*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "0112345678901231", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" }, /* Format still checked */
- /* 24*/ { BARCODE_GS1_128, -1, "[01]", "", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field in input" },
- /* 25*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]", "", 0, "" }, /* Zero-length data not checked */
- /* 26*/ { BARCODE_GS1_128, -1, "[01][20]12", "", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field in input" },
- /* 27*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01][20]12", "", 0, "" }, /* Zero-length data not checked */
- /* 28*/ { BARCODE_GS1_128, -1, "[0]123", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /* 29*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[0]123", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 1 AI with no data still checked */
- /* 30*/ { BARCODE_GS1_128, -1, "[0]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /* 31*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[0]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 1 AI with no data still checked */
- /* 32*/ { BARCODE_GS1_128, -1, "[]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /* 33*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[]12", "", 0, "" }, /* Length 0 AI with data not checked */
- /* 34*/ { BARCODE_GS1_128, -1, "[]12[01]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /* 35*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[]12[01]", "", 0, "" }, /* Length 0 AI with data not checked, non-short AI with zero-length data not checked */
- /* 36*/ { BARCODE_GS1_128, -1, "[01][]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short)" },
- /* 37*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01][]12", "", 0, "" }, /* Length 0 AI with data not checked, non-short AI with zero-length data not checked */
- /* 38*/ { BARCODE_GS1_128, -1, "[1]1[]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short)" },
- /* 39*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[1]1[]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short)" }, /* Length 1 AI with data still checked */
- /* 40*/ { BARCODE_GS1_128, -1, "[]12[1]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /* 41*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[]12[1]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 1 AI with data still checked */
- /* 42*/ { BARCODE_GS1_128, -1, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /* 43*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 0 AI with no data still checked */
- /* 44*/ { BARCODE_GS1_128, -1, "[01]12345678901231[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" },
- /* 45*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" }, /* Length 0 AI with no data still checked */
- /* 46*/ { BARCODE_GS1_128, -1, "[01]12345678901231[][20]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" },
- /* 47*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231[][20]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" }, /* Length 0 AI with no data still checked */
- /* 48*/ { BARCODE_GS1_128, -1, "[01]12345678901231[]1[20]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" },
- /* 49*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231[]1[20]12", "", 0, "" }, /* Length 0 AI with data not checked */
- /* 50*/ { BARCODE_GS1_128, -1, "[1234567890]123", "", ZINT_ERROR_INVALID_DATA, "Error 255: Invalid AI at position 1 in input (AI too long)" },
- /* 51*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[1234567890]123", "", ZINT_ERROR_INVALID_DATA, "Error 255: Invalid AI at position 1 in input (AI too long)" }, /* Too long still checked */
- /* 52*/ { BARCODE_GS1_128, -1, "[12345]123", "", ZINT_ERROR_INVALID_DATA, "Error 255: Invalid AI at position 1 in input (AI too long)" },
- /* 53*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[12345]123", "", ZINT_ERROR_INVALID_DATA, "Error 255: Invalid AI at position 1 in input (AI too long)" }, /* Too long still checked */
- /* 54*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(91)AB[", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (91) position 3: Invalid CSET 82 character '['" },
- /* 55*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1NOCHECK_MODE, "(91)AB[", "", 0, "" },
- /* 56*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]12", 0, "" },
- /* 57*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901231", "[20]12", 0, "" },
- /* 58*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901234", "[20]12", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1' (linear component)" },
- /* 59*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901234", "[20]12", 0, "" },
- /* 60*/ { BARCODE_GS1_128_CC, -1, "[01]123456789012345", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01) (linear component)" },
- /* 61*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]123456789012345", "[20]12", 0, "" },
- /* 62*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]123", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) (2D component)" },
- /* 63*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901231", "[20]123", 0, "" },
- /* 64*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" },
- /* 65*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901231", "[20]1A", 0, "" },
- /* 66*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121\177", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (linear component)" },
- /* 67*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121\177", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (linear component)" }, /* Nonprintable ASCII still checked */
- /* 68*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" },
- /* 69*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" }, /* Nonprintable ASCII still checked */
- /* 70*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121\200", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (linear component)" },
- /* 71*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121\200", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (linear component)" },
- /* 72*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" },
- /* 73*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" }, /* Extended ASCII still checked */
- /* 74*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" },
- /* 75*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" }, /* Format still checked */
- /* 76*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field in input (2D component)" },
- /* 77*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]", 0, "" }, /* Zero-length data not checked */
- /* 78*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[2]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
- /* 79*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[2]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 1 AI still checked */
- /* 80*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
- /* 81*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[]12", 0, "" }, /* Length 0 AI with data not checked */
- /* 82*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[1]2[]1", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short) (2D component)" },
- /* 83*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[1]2[]1", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short) (2D component)" }, /* Length 1 AI still checked */
- /* 84*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
- /* 85*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
- /* 86*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[][20]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
- /* 87*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[][20]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
- /* 88*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]12[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short) (2D component)" },
- /* 89*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]12[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
- /* 90*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" },
- /* 91*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" }, /* Non-CSET 82 always checked for composite data */
- /* 92*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231", "", 0, "" },
- /* 93*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]12345678901231", "", 0, "" },
- /* 94*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]1234", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11)" },
- /* 95*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234", "", 0, "" },
- /* 96*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]1234A", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11)" },
- /* 97*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234A", "", 0, "" },
- /* 98*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]12345A", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) position 6: Non-numeric character 'A'" },
- /* 99*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]12345A", "", 0, "" },
- /*100*/ { BARCODE_DBAR_EXP, -1, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
- /*101*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" }, /* Nonprintable ASCII still checked */
- /*102*/ { BARCODE_DBAR_EXP, -1, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" },
- /*103*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" }, /* Extended ASCII still checked */
- /*104*/ { BARCODE_DBAR_EXP, -1, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" },
- /*105*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" }, /* Format still checked */
- /*106*/ { BARCODE_DBAR_EXP, -1, "[10]", "", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field in input" },
- /*107*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[10]", "", 0, "" }, /* Zero-length data not checked */
- /*108*/ { BARCODE_DBAR_EXP, -1, "[2]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /*109*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[2]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 1 AI still checked */
- /*110*/ { BARCODE_DBAR_EXP, -1, "[]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /*111*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[]1", "", 0, "" }, /* Length 0 AI with data not checked */
- /*112*/ { BARCODE_DBAR_EXP, -1, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
- /*113*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 0 AI with no data still checked */
- /*114*/ { BARCODE_DBAR_EXP, -1, "[20]12[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short)" },
- /*115*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[20]12[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short)" }, /* Length 0 AI with no data still checked */
- /*116*/ { BARCODE_DBAR_EXP, -1, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 386: Invalid character in General Field data" },
- /*117*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 386: Invalid character in General Field data" }, /* Non-CSET 82 always checked for DBAR_EXP */
- /*118*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
- /*119*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
- /*120*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) (linear component)" },
- /*121*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", 0, "" },
- /*122*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) position 3: Invalid month '34' (linear component)" },
- /*123*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", 0, "" },
- /*124*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (30) (2D component)" },
- /*125*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", 0, "" },
- /*126*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (30) position 8: Non-numeric character 'A' (2D component)" },
- /*127*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", 0, "" },
- /*128*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" },
- /*129*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" }, /* Nonprintable ASCII still checked */
- /*130*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" },
- /*131*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" }, /* Extended ASCII still checked */
- /*132*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" },
- /*133*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" }, /* Format still checked */
- /*134*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[10]", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field in input (2D component)" },
- /*135*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[10]", 0, "" }, /* Zero-length data not checked */
- /*136*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[2]1", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
- /*137*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[2]1", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 1 AI still checked */
- /*138*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
- /*139*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[]12", 0, "" }, /* Length 0 AI with data not checked */
- /*140*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
- /*141*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
- /*142*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[20]12[][10]123", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short) (2D component)" },
- /*143*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]12[][10]123", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
- /*144*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" },
- /*145*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" }, /* Non-CSET 82 always checked for composite */
- /*146*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231", "", 0, "" },
- /*147*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]12345678901231", "", 0, "" },
- /*148*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]1234", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11)" },
- /*149*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234", "", 0, "" },
- /*150*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]1234A", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11)" },
- /*151*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234A", "", 0, "" },
- /*152*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]12345A", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) position 6: Non-numeric character 'A'" },
- /*153*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]12345A", "", 0, "" },
- /*154*/ { BARCODE_DBAR_EXPSTK, -1, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
- /*155*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" }, /* Nonprintable ASCII still checked */
- /*156*/ { BARCODE_DBAR_EXPSTK, -1, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" },
- /*157*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" }, /* Extended ASCII still checked */
- /*158*/ { BARCODE_DBAR_EXPSTK, -1, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" },
- /*159*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" }, /* Format still checked */
- /*160*/ { BARCODE_DBAR_EXPSTK, -1, "[01]", "", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field in input" },
- /*161*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]", "", 0, "" }, /* Zero-length data not checked */
- /*162*/ { BARCODE_DBAR_EXPSTK, -1, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 386: Invalid character in General Field data" },
- /*163*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 386: Invalid character in General Field data" }, /* Non-CSET 82 always checked for DBAR_EXPSTK */
- /*164*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
- /*165*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
- /*166*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) (linear component)" },
- /*167*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", 0, "" },
- /*168*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) position 3: Invalid month '34' (linear component)" },
- /*169*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", 0, "" },
- /*170*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (30) (2D component)" },
- /*171*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", 0, "" },
- /*172*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (30) position 8: Non-numeric character 'A' (2D component)" },
- /*173*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", 0, "" },
- /*174*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" },
- /*175*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" }, /* Nonprintable ASCII still checked */
- /*176*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" },
- /*177*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" }, /* Extended ASCII still checked */
- /*178*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" },
- /*179*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" }, /* Format still checked */
- /*180*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[235]", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field in input (2D component)" },
- /*181*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[235]", 0, "" }, /* Zero-length data not checked */
- /*182*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" },
- /*183*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" }, /* Non-CSET 82 always checked for composite */
+ /* 4*/ { BARCODE_GS1_128, -1, "^0112345678901234", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1'" },
+ /* 5*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^0112345678901234", "", 0, "" },
+ /* 6*/ { BARCODE_GS1_128, GS1RAW_MODE, "0112345678901234", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1'" },
+ /* 7*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "0112345678901234", "", 0, "" },
+ /* 8*/ { BARCODE_GS1_128, -1, "[01]123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01) at position 1" },
+ /* 9*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]123456789012345", "", 0, "" },
+ /* 10*/ { BARCODE_GS1_128, -1, "^01123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 859: Invalid data length for AI (01) at position 2" },
+ /* 11*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^01123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 859: Invalid data length for AI (01) at position 2" }, /* Raw/caret need underlong data lengths to work - also new so no need for backward-compatibility */
+ /* 12*/ { BARCODE_GS1_128, GS1RAW_MODE, "01123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 859: Invalid data length for AI (01) at position 1" },
+ /* 13*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "01123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 859: Invalid data length for AI (01) at position 1" },
+ /* 14*/ { BARCODE_GS1_128, -1, "[01]1234567890123", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01) at position 1" },
+ /* 15*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123", "", 0, "" },
+ /* 16*/ { BARCODE_GS1_128, -1, "^011234567890123", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01) at position 2" },
+ /* 17*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^011234567890123", "", 0, "" }, /* Raw/caret too short data lengths ok */
+ /* 18*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01) at position 1" },
+ /* 19*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "011234567890123", "", 0, "" },
+ /* 20*/ { BARCODE_GS1_128, -1, "^011234567890123^", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01) at position 2" },
+ /* 21*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^011234567890123^", "", 0, "" },
+ /* 22*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123\035", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01) at position 1" },
+ /* 23*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "011234567890123\035", "", 0, "" },
+ /* 24*/ { BARCODE_GS1_128, -1, "[01]12345678901231[20]1", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) at position 19" },
+ /* 25*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231[20]1", "", 0, "" },
+ /* 26*/ { BARCODE_GS1_128, -1, "^0112345678901231201", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) at position 18" },
+ /* 27*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^0112345678901231201", "", 0, "" },
+ /* 28*/ { BARCODE_GS1_128, GS1RAW_MODE, "0112345678901231201", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) at position 17" },
+ /* 29*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "0112345678901231201", "", 0, "" },
+ /* 30*/ { BARCODE_GS1_128, -1, "^0112345678901231201^", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) at position 18" },
+ /* 31*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^0112345678901231201^", "", 0, "" },
+ /* 32*/ { BARCODE_GS1_128, GS1RAW_MODE, "0112345678901231201\035", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) at position 17" },
+ /* 33*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "0112345678901231201\035", "", 0, "" },
+ /* 34*/ { BARCODE_GS1_128, -1, "^0112345678901231^201", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) at position 19" },
+ /* 35*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^0112345678901231^201", "", 0, "" },
+ /* 36*/ { BARCODE_GS1_128, GS1RAW_MODE, "0112345678901231\035201", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) at position 18" },
+ /* 37*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "0112345678901231\035201", "", 0, "" },
+ /* 38*/ { BARCODE_GS1_128, -1, "[03]123", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (03) at position 1" },
+ /* 39*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[03]123", "", 0, "" },
+ /* 40*/ { BARCODE_GS1_128, -1, "^03123", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (03) at position 2" },
+ /* 41*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^03123", "", 0, "" },
+ /* 42*/ { BARCODE_GS1_128, GS1RAW_MODE, "03123", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (03) at position 1" },
+ /* 43*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "03123", "", 0, "" },
+ /* 44*/ { BARCODE_GS1_128, -1, "[04]1234[05]12345[06]123456", "", ZINT_ERROR_INVALID_DATA, "Error 260: Invalid AI (04) at position 1" },
+ /* 45*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[04]1234[05]12345[06]123456", "", 0, "" },
+ /* 46*/ { BARCODE_GS1_128, -1, "^041234^0512345^06123456", "", ZINT_ERROR_INVALID_DATA, "Error 856: Invalid AI (04) at position 2" },
+ /* 47*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^041234^0512345^06123456", "", ZINT_ERROR_INVALID_DATA, "Error 856: Invalid AI (04) at position 2" }, /* Raw/caret mode needs valid AIs to work */
+ /* 48*/ { BARCODE_GS1_128, GS1RAW_MODE, "041234\0350512345\03506123456", "", ZINT_ERROR_INVALID_DATA, "Error 856: Invalid AI (04) at position 1" },
+ /* 49*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "041234\0350512345\03506123456", "", ZINT_ERROR_INVALID_DATA, "Error 856: Invalid AI (04) at position 1" },
+ /* 50*/ { BARCODE_GS1_128, -1, "[01]1234567890123A", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Non-numeric character 'A'" },
+ /* 51*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123A", "", 0, "" },
+ /* 52*/ { BARCODE_GS1_128, -1, "^011234567890123A", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Non-numeric character 'A'" },
+ /* 53*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^011234567890123A", "", 0, "" },
+ /* 54*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123A", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Non-numeric character 'A'" },
+ /* 55*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "011234567890123A", "", 0, "" },
+ /* 56*/ { BARCODE_GS1_128, -1, "[01]1234567890123.", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Non-numeric character '.'" },
+ /* 57*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123.", "", 0, "" },
+ /* 58*/ { BARCODE_GS1_128, -1, "[01]1234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
+ /* 59*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" }, /* Nonprintable ASCII still checked */
+ /* 60*/ { BARCODE_GS1_128, -1, "^011234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
+ /* 61*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^011234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
+ /* 62*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
+ /* 63*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "011234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
+ /* 64*/ { BARCODE_GS1_128, -1, "[01]1234567890123\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" },
+ /* 65*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]1234567890123\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" }, /* Extended ASCII still checked */
+ /* 66*/ { BARCODE_GS1_128, -1, "0112345678901231", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" },
+ /* 67*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "0112345678901231", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" }, /* Format still checked */
+ /* 68*/ { BARCODE_GS1_128, -1, "[01]", "", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field for AI (01) at position 1" },
+ /* 69*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]", "", 0, "" }, /* Zero-length data not checked */
+ /* 70*/ { BARCODE_GS1_128, -1, "^01", "", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (01) at position 2" },
+ /* 71*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^01", "", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (01) at position 2" }, /* Raw/caret mode needs valid data_lengths to work */
+ /* 72*/ { BARCODE_GS1_128, GS1RAW_MODE, "01", "", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (01) at position 1" },
+ /* 73*/ { BARCODE_GS1_128, GS1NOCHECK_MODE | GS1RAW_MODE, "01", "", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (01) at position 1" },
+ /* 74*/ { BARCODE_GS1_128, -1, "[01][20]12", "", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field for AI (01) at position 1" },
+ /* 75*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01][20]12", "", 0, "" }, /* Zero-length data not checked */
+ /* 76*/ { BARCODE_GS1_128, -1, "[0]123", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /* 77*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[0]123", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 1 AI with no data still checked */
+ /* 78*/ { BARCODE_GS1_128, -1, "[0]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /* 79*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[0]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 1 AI with no data still checked */
+ /* 80*/ { BARCODE_GS1_128, -1, "^0", "", ZINT_ERROR_INVALID_DATA, "Error 857: Invalid AI at position 2" },
+ /* 81*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^0", "", ZINT_ERROR_INVALID_DATA, "Error 857: Invalid AI at position 2" },
+ /* 82*/ { BARCODE_GS1_128, -1, "[]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /* 83*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[]12", "", 0, "" }, /* Length 0 AI with data not checked */
+ /* 84*/ { BARCODE_GS1_128, -1, "[]12[01]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /* 85*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[]12[01]", "", 0, "" }, /* Length 0 AI with data not checked, non-short AI with zero-length data not checked */
+ /* 86*/ { BARCODE_GS1_128, -1, "[01][]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short)" },
+ /* 87*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01][]12", "", 0, "" }, /* Length 0 AI with data not checked, non-short AI with zero-length data not checked */
+ /* 88*/ { BARCODE_GS1_128, -1, "[1]1[]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short)" },
+ /* 89*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[1]1[]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short)" }, /* Length 1 AI with data still checked */
+ /* 90*/ { BARCODE_GS1_128, -1, "[]12[1]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /* 91*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[]12[1]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 1 AI with data still checked */
+ /* 92*/ { BARCODE_GS1_128, -1, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /* 93*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 0 AI with no data still checked */
+ /* 94*/ { BARCODE_GS1_128, -1, "^", "", ZINT_ERROR_INVALID_DATA, "Error 857: Invalid AI at position 1" },
+ /* 95*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "^", "", ZINT_ERROR_INVALID_DATA, "Error 857: Invalid AI at position 1" },
+ /* 96*/ { BARCODE_GS1_128, -1, "[01]12345678901231[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" },
+ /* 97*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" }, /* Length 0 AI with no data still checked */
+ /* 98*/ { BARCODE_GS1_128, -1, "[01]12345678901231[][20]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" },
+ /* 99*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231[][20]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" }, /* Length 0 AI with no data still checked */
+ /*100*/ { BARCODE_GS1_128, -1, "[01]12345678901231[]1[20]12", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 19 in input (AI too short)" },
+ /*101*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[01]12345678901231[]1[20]12", "", 0, "" }, /* Length 0 AI with data not checked */
+ /*102*/ { BARCODE_GS1_128, -1, "[1234567890]123", "", ZINT_ERROR_INVALID_DATA, "Error 255: Invalid AI at position 1 in input (AI too long)" },
+ /*103*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[1234567890]123", "", ZINT_ERROR_INVALID_DATA, "Error 255: Invalid AI at position 1 in input (AI too long)" }, /* Too long still checked */
+ /*104*/ { BARCODE_GS1_128, -1, "[12345]123", "", ZINT_ERROR_INVALID_DATA, "Error 255: Invalid AI at position 1 in input (AI too long)" },
+ /*105*/ { BARCODE_GS1_128, GS1NOCHECK_MODE, "[12345]123", "", ZINT_ERROR_INVALID_DATA, "Error 255: Invalid AI at position 1 in input (AI too long)" }, /* Too long still checked */
+ /*106*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(91)AB[", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (91) data position 3: Invalid CSET 82 character '['" },
+ /*107*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1NOCHECK_MODE, "(91)AB[", "", 0, "" },
+ /*108*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]12", 0, "" },
+ /*109*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901231", "[20]12", 0, "" },
+ /*110*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901234", "[20]12", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1' (linear component)" },
+ /*111*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901234", "[20]12", 0, "" },
+ /*112*/ { BARCODE_GS1_128_CC, -1, "[01]123456789012345", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (01) at position 1 (linear component)" },
+ /*113*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]123456789012345", "[20]12", 0, "" },
+ /*114*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]123", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (20) at position 1 (2D component)" },
+ /*115*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901231", "[20]123", 0, "" },
+ /*116*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (20) data position 2: Non-numeric character 'A' (2D component)" },
+ /*117*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901231", "[20]1A", 0, "" },
+ /*118*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121\177", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (linear component)" },
+ /*119*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121\177", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (linear component)" }, /* Nonprintable ASCII still checked */
+ /*120*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" },
+ /*121*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" }, /* Nonprintable ASCII still checked */
+ /*122*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121\200", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (linear component)" },
+ /*123*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121\200", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (linear component)" },
+ /*124*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" },
+ /*125*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" }, /* Extended ASCII still checked */
+ /*126*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" },
+ /*127*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" }, /* Format still checked */
+ /*128*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field for AI (20) at position 1 (2D component)" },
+ /*129*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]", 0, "" }, /* Zero-length data not checked */
+ /*130*/ { BARCODE_GS1_128_CC, -1, "^011234567890121", "^20", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (20) at position 2 (2D component)" },
+ /*131*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "^011234567890121", "^20", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (20) at position 2 (2D component)" },
+ /*132*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, "011234567890121", "20", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (20) at position 1 (2D component)" },
+ /*133*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE | GS1RAW_MODE, "011234567890121", "20", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (20) at position 1 (2D component)" },
+ /*134*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "^011234567890121", "^20", ZINT_ERROR_INVALID_DATA, "Error 858: Empty data field for AI (20) at position 2 (2D component)" },
+ /*135*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[2]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
+ /*136*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[2]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 1 AI still checked */
+ /*137*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
+ /*138*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[]12", 0, "" }, /* Length 0 AI with data not checked */
+ /*139*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[1]2[]1", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short) (2D component)" },
+ /*140*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[1]2[]1", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 5 in input (AI too short) (2D component)" }, /* Length 1 AI still checked */
+ /*141*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
+ /*142*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
+ /*143*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[][20]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
+ /*144*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[][20]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
+ /*145*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]12[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short) (2D component)" },
+ /*146*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]12[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
+ /*147*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" },
+ /*148*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" }, /* Non-CSET 82 always checked for composite data */
+ /*149*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231", "", 0, "" },
+ /*150*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]12345678901231", "", 0, "" },
+ /*151*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]1234", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) at position 26" },
+ /*152*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234", "", 0, "" },
+ /*153*/ { BARCODE_DBAR_EXP, -1, "^011234567890123110123^111234", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) at position 24" },
+ /*154*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, "011234567890123110123\035111234", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) at position 23" },
+ /*155*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]1234A", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) at position 26" },
+ /*156*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234A", "", 0, "" },
+ /*157*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]12345A", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) data position 6: Non-numeric character 'A'" },
+ /*158*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]12345A", "", 0, "" },
+ /*159*/ { BARCODE_DBAR_EXP, -1, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
+ /*160*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" }, /* Nonprintable ASCII still checked */
+ /*161*/ { BARCODE_DBAR_EXP, -1, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" },
+ /*162*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" }, /* Extended ASCII still checked */
+ /*163*/ { BARCODE_DBAR_EXP, -1, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" },
+ /*164*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" }, /* Format still checked */
+ /*165*/ { BARCODE_DBAR_EXP, -1, "[10]", "", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field for AI (10) at position 1" },
+ /*166*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[10]", "", 0, "" }, /* Zero-length data not checked */
+ /*167*/ { BARCODE_DBAR_EXP, -1, "[2]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /*168*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[2]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 1 AI still checked */
+ /*169*/ { BARCODE_DBAR_EXP, -1, "[]1", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /*170*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[]1", "", 0, "" }, /* Length 0 AI with data not checked */
+ /*171*/ { BARCODE_DBAR_EXP, -1, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" },
+ /*172*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short)" }, /* Length 0 AI with no data still checked */
+ /*173*/ { BARCODE_DBAR_EXP, -1, "[20]12[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short)" },
+ /*174*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[20]12[]", "", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short)" }, /* Length 0 AI with no data still checked */
+ /*175*/ { BARCODE_DBAR_EXP, -1, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 386: Invalid character in General Field data" },
+ /*176*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 386: Invalid character in General Field data" }, /* Non-CSET 82 always checked for DBAR_EXP */
+ /*177*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
+ /*178*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
+ /*179*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) at position 26 (linear component)" },
+ /*180*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", 0, "" },
+ /*181*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) data position 3: Invalid month '34' (linear component)" },
+ /*182*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", 0, "" },
+ /*183*/ { BARCODE_DBAR_EXP_CC, -1, "^011234567890123110123^11123456", "^21ABC123^2212345", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) data position 3: Invalid month '34' (linear component)" },
+ /*184*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "^011234567890123110123^11123456", "^21ABC123^2212345", 0, "" },
+ /*185*/ { BARCODE_DBAR_EXP_CC, GS1RAW_MODE, "011234567890123110123\03511123456", "21ABC123\0352212345", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) data position 3: Invalid month '34' (linear component)" },
+ /*186*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE | GS1RAW_MODE, "011234567890123110123\03511123456", "21ABC123\0352212345", 0, "" },
+ /*187*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (30) at position 20 (2D component)" },
+ /*188*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", 0, "" },
+ /*189*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (30) data position 8: Non-numeric character 'A' (2D component)" },
+ /*190*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", 0, "" },
+ /*191*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" },
+ /*192*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" }, /* Nonprintable ASCII still checked */
+ /*193*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" },
+ /*194*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" }, /* Extended ASCII still checked */
+ /*195*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" },
+ /*196*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" }, /* Format still checked */
+ /*197*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[10]", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field for AI (10) at position 1 (2D component)" },
+ /*198*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[10]", 0, "" }, /* Zero-length data not checked */
+ /*199*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[2]1", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
+ /*200*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[2]1", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 1 AI still checked */
+ /*201*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[]12", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
+ /*202*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[]12", 0, "" }, /* Length 0 AI with data not checked */
+ /*203*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" },
+ /*204*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[]", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 1 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
+ /*205*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[20]12[][10]123", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short) (2D component)" },
+ /*206*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]12[][10]123", ZINT_ERROR_INVALID_DATA, "Error 256: Invalid AI at position 7 in input (AI too short) (2D component)" }, /* Length 0 AI with no data still checked */
+ /*207*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" },
+ /*208*/ { BARCODE_DBAR_EXP_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" }, /* Non-CSET 82 always checked for composite */
+ /*209*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231", "", 0, "" },
+ /*210*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]12345678901231", "", 0, "" },
+ /*211*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]1234", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) at position 26" },
+ /*212*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234", "", 0, "" },
+ /*213*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]1234A", "", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) at position 26" },
+ /*214*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234A", "", 0, "" },
+ /*215*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]12345A", "", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) data position 6: Non-numeric character 'A'" },
+ /*216*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]12345A", "", 0, "" },
+ /*217*/ { BARCODE_DBAR_EXPSTK, -1, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" },
+ /*218*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1" }, /* Nonprintable ASCII still checked */
+ /*219*/ { BARCODE_DBAR_EXPSTK, -1, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" },
+ /*220*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1" }, /* Extended ASCII still checked */
+ /*221*/ { BARCODE_DBAR_EXPSTK, -1, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" },
+ /*222*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI" }, /* Format still checked */
+ /*223*/ { BARCODE_DBAR_EXPSTK, -1, "[01]", "", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field for AI (01) at position 1" },
+ /*224*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[01]", "", 0, "" }, /* Zero-length data not checked */
+ /*225*/ { BARCODE_DBAR_EXPSTK, -1, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 386: Invalid character in General Field data" },
+ /*226*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 386: Invalid character in General Field data" }, /* Non-CSET 82 always checked for DBAR_EXPSTK */
+ /*227*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
+ /*228*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
+ /*229*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (11) at position 26 (linear component)" },
+ /*230*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", 0, "" },
+ /*231*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (11) data position 3: Invalid month '34' (linear component)" },
+ /*232*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", 0, "" },
+ /*233*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", ZINT_ERROR_INVALID_DATA, "Error 259: Invalid data length for AI (30) at position 20 (2D component)" },
+ /*234*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", 0, "" },
+ /*235*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (30) data position 8: Non-numeric character 'A' (2D component)" },
+ /*236*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]123456789012[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", 0, "" },
+ /*237*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" },
+ /*238*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 263: DEL characters are not supported by GS1 (2D component)" }, /* Nonprintable ASCII still checked */
+ /*239*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" },
+ /*240*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 250: Extended ASCII characters are not supported by GS1 (2D component)" }, /* Extended ASCII still checked */
+ /*241*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" },
+ /*242*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 252: Data does not start with an AI (2D component)" }, /* Format still checked */
+ /*243*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[235]", ZINT_ERROR_INVALID_DATA, "Error 258: Empty data field for AI (235) at position 1 (2D component)" },
+ /*244*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[235]", 0, "" }, /* Zero-length data not checked */
+ /*245*/ { BARCODE_DBAR_EXPSTK_CC, -1, "^011234567890121", "^235", ZINT_ERROR_INVALID_DATA, "Error 856: Invalid AI (23) at position 2 (2D component)" },
+ /*246*/ { BARCODE_DBAR_EXPSTK_CC, GS1RAW_MODE, "011234567890121", "235", ZINT_ERROR_INVALID_DATA, "Error 856: Invalid AI (23) at position 1 (2D component)" },
+ /*247*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" },
+ /*248*/ { BARCODE_DBAR_EXPSTK_CC, GS1NOCHECK_MODE, "[01]1234567890121", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 441: Invalid character in input (2D component)" }, /* Non-CSET 82 always checked for composite */
+ /*249*/ { BARCODE_DBAR_EXPSTK_CC, -1, "^011234567890121", "^", ZINT_ERROR_INVALID_DATA, "Error 857: Invalid AI at position 1 (2D component)" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -2774,6 +3205,273 @@ static void test_gs1nocheck_mode(const testCtx *const p_ctx) {
testFinish();
}
+INTERNAL int zint_test_gs1_hrt_conv_parsed(struct zint_symbol *symbol, const unsigned char source[], const int length,
+ const int ai_count, const int *ai_vals, const int *ai_locs, const int *data_locs,
+ const int *data_lens, const int no_errtxt);
+
+static void test_gs1_hrt_conv_parsed(const testCtx *const p_ctx) {
+
+ struct item {
+ const char *data;
+ int ai_count;
+ int ai_vals[4];
+ int ai_locs[4];
+ int data_locs[4];
+ int data_lens[4];
+ int ret;
+ const char *expected;
+ };
+ /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
+ static const struct item data[] = {
+ /* 0*/ { "^0112345678901231", 1, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 14, 0, 0, 0 }, 0, "(01)12345678901231" },
+ /* 1*/ { "^011234567890123190ABCD^21123456AB", 3, { 1, 90, 21, 0 }, { 1, 17, 24, 0 }, { 3, 19, 26, 0 }, { 14, 4, 8, 0 }, 0, "(01)12345678901231(90)ABCD(21)123456AB" },
+ /* 2*/ { "^91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890^92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890^93123456789012345678901234567890123456789012345678901234567890123", 3, { 91, 92, 93, 0 }, { 1, 94, 187, 0 }, { 3, 96, 189, 0 }, { 90, 90, 63, 0 }, 0, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123" },
+ /* 3*/ { "^91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890^92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890^931234567890123456789012345678901234567890123456789012345678901234", 3, { 91, 92, 93, 0 }, { 1, 94, 187, 0 }, { 3, 96, 189, 0 }, { 90, 90, 64, 0 }, ZINT_WARN_HRT_TRUNCATED, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
+ /* 4*/ { "^91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890^92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890^93123456789012345678901234567890123456789012345678901234567890123^94123", 4, { 91, 92, 93, 94 }, { 1, 94, 187, 256 }, { 3, 96, 189, 258 }, { 90, 90, 63, 3 }, ZINT_WARN_HRT_TRUNCATED, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123" },
+ };
+ const int data_size = ARRAY_SIZE(data);
+ int i, length, ret;
+ struct zint_symbol *symbol = NULL;
+
+ testStartSymbol(p_ctx->func_name, &symbol);
+
+ for (i = 0; i < data_size; i++) {
+
+ if (testContinue(p_ctx, i)) continue;
+
+ symbol = ZBarcode_Create();
+ assert_nonnull(symbol, "Symbol not created\n");
+
+ length = (int) strlen(data[i].data);
+ ret = zint_test_gs1_hrt_conv_parsed(symbol, ZCUCP(data[i].data), length, data[i].ai_count, data[i].ai_vals,
+ data[i].ai_locs, data[i].data_locs, data[i].data_lens, 0 /*no_errtxt*/);
+ assert_equal(ret, data[i].ret, "i:%d gs1_hrt_conv_parsed ret %d != %d (%s) (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt, symbol->text);
+ assert_zero(strcmp(ZCCP(symbol->text), data[i].expected), "i:%d strcmp(%s, %s) != 0\n",
+ i, symbol->text, data[i].expected);
+ length = (int) strlen(ZCCP(symbol->text));
+ assert_equal(symbol->text_length, length, "i:%d text_length %d != %d (%s) (%s)\n",
+ i, symbol->text_length, length, symbol->errtxt, symbol->text);
+
+ ZBarcode_Delete(symbol);
+ }
+
+ testFinish();
+}
+
+INTERNAL int zint_test_gs1_hrt_cpy(struct zint_symbol *symbol, const unsigned char source[], const int length,
+ const int no_errtxt);
+
+static void test_gs1_hrt_cpy(const testCtx *const p_ctx) {
+
+ struct item {
+ const char *data;
+ int ret;
+ const char *expected;
+ };
+ /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
+ static const struct item data[] = {
+ /* 0*/ { "(01)12345678901231", 0, "(01)12345678901231" },
+ /* 1*/ { "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123", 0, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123" },
+ /* 2*/ { "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123", 0, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123" },
+ /* 3*/ { "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)1234567890123456789012345678901234567890123456789012345678901234", ZINT_WARN_HRT_TRUNCATED, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
+ /* 4*/ { "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123(94)123456789", ZINT_WARN_HRT_TRUNCATED, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123" },
+ };
+ const int data_size = ARRAY_SIZE(data);
+ int i, length, ret;
+ struct zint_symbol *symbol = NULL;
+
+ testStartSymbol(p_ctx->func_name, &symbol);
+
+ for (i = 0; i < data_size; i++) {
+
+ if (testContinue(p_ctx, i)) continue;
+
+ symbol = ZBarcode_Create();
+ assert_nonnull(symbol, "Symbol not created\n");
+ symbol->input_mode |= GS1PARENS_MODE;
+
+ length = (int) strlen(data[i].data);
+ ret = zint_test_gs1_hrt_cpy(symbol, ZCUCP(data[i].data), length, 0 /*no_errtxt*/);
+ assert_equal(ret, data[i].ret, "i:%d gs1_hrt_cpy ret %d != %d (%s) (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt, symbol->text);
+ assert_zero(strcmp(ZCCP(symbol->text), data[i].expected), "i:%d strcmp(%s, %s) != 0\n",
+ i, symbol->text, data[i].expected);
+ length = (int) strlen(ZCCP(symbol->text));
+ assert_equal(symbol->text_length, length, "i:%d text_length %d != %d (%s) (%s)\n",
+ i, symbol->text_length, length, symbol->errtxt, symbol->text);
+
+ ZBarcode_Delete(symbol);
+ }
+
+ testFinish();
+}
+
+INTERNAL int zint_test_gs1_hrt_conv_brackets(struct zint_symbol *symbol, const unsigned char source[],
+ const int length, const int no_errtxt);
+
+static void test_gs1_hrt_conv_brackets(const testCtx *const p_ctx) {
+
+ struct item {
+ const char *data;
+ int ret;
+ const char *expected;
+ };
+ /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
+ static const struct item data[] = {
+ /* 0*/ { "[01]12345678901231", 0, "(01)12345678901231" },
+ /* 1*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123", 0, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123" },
+ /* 2*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123", 0, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123" },
+ /* 3*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234567890123456789012345678901234567890123456789012345678901234", ZINT_WARN_HRT_TRUNCATED, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" },
+ /* 4*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123[94]123456789", ZINT_WARN_HRT_TRUNCATED, "(91)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(92)123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890(93)123456789012345678901234567890123456789012345678901234567890123" },
+ };
+ const int data_size = ARRAY_SIZE(data);
+ int i, length, ret;
+ struct zint_symbol *symbol = NULL;
+
+ testStartSymbol(p_ctx->func_name, &symbol);
+
+ for (i = 0; i < data_size; i++) {
+
+ if (testContinue(p_ctx, i)) continue;
+
+ symbol = ZBarcode_Create();
+ assert_nonnull(symbol, "Symbol not created\n");
+
+ length = (int) strlen(data[i].data);
+ ret = zint_test_gs1_hrt_conv_brackets(symbol, ZCUCP(data[i].data), length, 0 /*no_errtxt*/);
+ assert_equal(ret, data[i].ret, "i:%d gs1_hrt_conv_brackets ret %d != %d (%s) (%s)\n",
+ i, ret, data[i].ret, symbol->errtxt, symbol->text);
+ assert_zero(strcmp(ZCCP(symbol->text), data[i].expected), "i:%d strcmp(%s, %s) != 0\n",
+ i, symbol->text, data[i].expected);
+ length = (int) strlen(ZCCP(symbol->text));
+ assert_equal(symbol->text_length, length, "i:%d text_length %d != %d (%s) (%s)\n",
+ i, symbol->text_length, length, symbol->errtxt, symbol->text);
+
+ ZBarcode_Delete(symbol);
+ }
+
+ testFinish();
+}
+
+INTERNAL int zint_test_gs1_lint_parse_raw_caret(const unsigned char source[], const int length,
+ const int ai_max, int *ai_vals, int *ai_locs, int *data_locs, int *data_lens, int *p_ai_count,
+ int *p_err_no, int *p_err_posn);
+
+static void test_gs1_lint_parse_raw_caret(const testCtx *const p_ctx) {
+
+ struct item {
+ const char *data;
+ int ret;
+
+ int expected_ai_count;
+ int expected_ai_vals[4];
+ int expected_ai_locs[4];
+ int expected_data_locs[4];
+ int expected_data_lens[4];
+ int expected_err_no;
+ int expected_err_posn;
+ };
+ /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
+ static const struct item data[] = {
+ /* 0*/ { "^", 0, 0, { -1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 1, 1 },
+ /* 1*/ { "", 0, 0, { -1, 0, 0, 0 }, { -1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 1, 0 },
+ /* 2*/ { "\035", 0, 0, { -1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 1, 1 },
+ /* 3*/ { "^0", 0, 0, { -1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 1, 2 },
+ /* 4*/ { "0", 0, 0, { -1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 1, 1 },
+ /* 5*/ { "\0350", 0, 0, { -1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 1, 2 },
+ /* 6*/ { "^01", 0, 0, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 0, 0, 0, 0 }, 2, 2 },
+ /* 7*/ { "01", 0, 0, { 1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 0, 0, 0 }, { 0, 0, 0, 0 }, 2, 1 },
+ /* 8*/ { "\03501", 0, 0, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 0, 0, 0, 0 }, 2, 2 },
+ /* 9*/ { "^011", 1, 1, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 1, 0, 0, 0 }, 0, 0 }, /* Too short ok */
+ /* 10*/ { "011", 1, 1, { 1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 0, 0, 0 }, { 1, 0, 0, 0 }, 0, 0 },
+ /* 11*/ { "\035011", 1, 1, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 1, 0, 0, 0 }, 0, 0 }, /* Initial GS ok */
+ /* 12*/ { "^011^", 1, 1, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 1, 0, 0, 0 }, 0, 0 }, /* Too short ok */
+ /* 13*/ { "011\035", 1, 1, { 1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 0, 0, 0 }, { 1, 0, 0, 0 }, 0, 0 },
+ /* 14*/ { "\035011\035", 1, 1, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 1, 0, 0, 0 }, 0, 0 },
+ /* 15*/ { "^011234567890123", 1, 1, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 13, 0, 0, 0 }, 0, 0 }, /* Too short ok */
+ /* 16*/ { "011234567890123", 1, 1, { 1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 0, 0, 0 }, { 13, 0, 0, 0 }, 0, 0 },
+ /* 17*/ { "^011234567890123^", 1, 1, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 13, 0, 0, 0 }, 0, 0 },
+ /* 18*/ { "011234567890123\035", 1, 1, { 1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 0, 0, 0 }, { 13, 0, 0, 0 }, 0, 0 },
+ /* 19*/ { "^0112345678901231", 1, 1, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 3, 0, 0, 0 }, { 14, 0, 0, 0 }, 0, 0 },
+ /* 20*/ { "0112345678901231", 1, 1, { 1, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 0, 0, 0 }, { 14, 0, 0, 0 }, 0, 0 },
+ /* 21*/ { "^01123456789012312012", 1, 2, { 1, 20, 0, 0 }, { 1, 17, 0, 0 }, { 3, 19, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 },
+ /* 22*/ { "01123456789012312012", 1, 2, { 1, 20, 0, 0 }, { 0, 16, 0, 0 }, { 2, 18, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 },
+ /* 23*/ { "\03501123456789012312012", 1, 2, { 1, 20, 0, 0 }, { 1, 17, 0, 0 }, { 3, 19, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 },
+ /* 24*/ { "^0112345678901231^2012", 1, 2, { 1, 20, 0, 0 }, { 1, 18, 0, 0 }, { 3, 20, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 }, /* Separator after predefined allowed */
+ /* 25*/ { "0112345678901231\0352012", 1, 2, { 1, 20, 0, 0 }, { 0, 17, 0, 0 }, { 2, 19, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 },
+ /* 26*/ { "^011234567890123^2012", 1, 2, { 1, 20, 0, 0 }, { 1, 17, 0, 0 }, { 3, 19, 0, 0 }, { 13, 2, 0, 0 }, 0, 0 },
+ /* 27*/ { "011234567890123\0352012", 1, 2, { 1, 20, 0, 0 }, { 0, 16, 0, 0 }, { 2, 18, 0, 0 }, { 13, 2, 0, 0 }, 0, 0 },
+ /* 28*/ { "^01123456789012312012^", 1, 2, { 1, 20, 0, 0 }, { 1, 17, 0, 0 }, { 3, 19, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 }, /* Redundant terminating separator allowed for predefined */
+ /* 29*/ { "^011234567890123^2012^", 1, 2, { 1, 20, 0, 0 }, { 1, 17, 0, 0 }, { 3, 19, 0, 0 }, { 13, 2, 0, 0 }, 0, 0 },
+ /* 30*/ { "011234567890123\0352012\035", 1, 2, { 1, 20, 0, 0 }, { 0, 16, 0, 0 }, { 2, 18, 0, 0 }, { 13, 2, 0, 0 }, 0, 0 },
+ /* 31*/ { "01123456789012312012\035", 1, 2, { 1, 20, 0, 0 }, { 0, 16, 0, 0 }, { 2, 18, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 },
+ /* 32*/ { "^01123456789012319012", 1, 2, { 1, 90, 0, 0 }, { 1, 17, 0, 0 }, { 3, 19, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 },
+ /* 33*/ { "01123456789012319012", 1, 2, { 1, 90, 0, 0 }, { 0, 16, 0, 0 }, { 2, 18, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 },
+ /* 34*/ { "^01123456789012319012^", 1, 2, { 1, 90, 0, 0 }, { 1, 17, 0, 0 }, { 3, 19, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 }, /* Redundant terminating separator allowed for non-predefined */
+ /* 35*/ { "01123456789012319012\035", 1, 2, { 1, 90, 0, 0 }, { 0, 16, 0, 0 }, { 2, 18, 0, 0 }, { 14, 2, 0, 0 }, 0, 0 },
+ /* 36*/ { "^0112345678901231901^912", 1, 3, { 1, 90, 91, 0 }, { 1, 17, 21, 0 }, { 3, 19, 23, 0 }, { 14, 1, 1, 0 }, 0, 0 },
+ /* 37*/ { "0112345678901231901\035912", 1, 3, { 1, 90, 91, 0 }, { 0, 16, 20, 0 }, { 2, 18, 22, 0 }, { 14, 1, 1, 0 }, 0, 0 },
+ /* 38*/ { "^242123456^10ABC123", 1, 2, { 242, 10, 0, 0 }, { 1, 11, 0, 0 }, { 4, 13, 0, 0 }, { 6, 6, 0, 0 }, 0, 0 },
+ /* 39*/ { "242123456\03510ABC123", 1, 2, { 242, 10, 0, 0 }, { 0, 10, 0, 0 }, { 3, 12, 0, 0 }, { 6, 6, 0, 0 }, 0, 0 },
+ /* 40*/ { "^800112341234512398^0112345678901231", 1, 2, { 8001, 1, 0, 0 }, { 1, 20, 0, 0 }, { 5, 22, 0, 0 }, { 14, 14, 0, 0 }, 0, 0 },
+ /* 41*/ { "800112341234512398\0350112345678901231", 1, 2, { 8001, 1, 0, 0 }, { 0, 19, 0, 0 }, { 4, 21, 0, 0 }, { 14, 14, 0, 0 }, 0, 0 },
+ /* 42*/ { "^01123456789012319012012^2012912", 1, 4, { 1, 90, 20, 91 }, { 1, 17, 25, 29 }, { 3, 19, 27, 31 }, { 14, 5, 2, 1 }, 0, 0 },
+ /* 43*/ { "01123456789012319012012\0352012912", 1, 4, { 1, 90, 20, 91 }, { 0, 16, 24, 28 }, { 2, 18, 26, 30 }, { 14, 5, 2, 1 }, 0, 0 },
+ /* 44*/ { "^2551234567890128^39401234^4101234567890128", 1, 3, { 255, 3940, 410, 0 }, { 1, 18, 27, 0 }, { 4, 22, 30, 0 }, { 13, 4, 13, 0 }, 0, 0 },
+ /* 45*/ { "2551234567890128\03539401234\0354101234567890128", 1, 3, { 255, 3940, 410, 0 }, { 0, 17, 26, 0 }, { 3, 21, 29, 0 }, { 13, 4, 13, 0 }, 0, 0 },
+ /* 46*/ { "\0352551234567890128\03539401234\0354101234567890128", 1, 3, { 255, 3940, 410, 0 }, { 1, 18, 27, 0 }, { 4, 22, 30, 0 }, { 13, 4, 13, 0 }, 0, 0 },
+ };
+ const int data_size = ARRAY_SIZE(data);
+ int i, length, ret;
+
+ testStart(p_ctx->func_name);
+
+ for (i = 0; i < data_size; i++) {
+ int ai_count = 0, err_no = 0, err_posn = 0;
+ int ai_vals[4] = {0};
+ int ai_locs[4] = {0};
+ int data_locs[4] = {0};
+ int data_lens[4] = {0};
+
+ if (testContinue(p_ctx, i)) continue;
+
+ length = (int) strlen(data[i].data);
+ ret = zint_test_gs1_lint_parse_raw_caret(ZCUCP(data[i].data), length, ARRAY_SIZE(ai_vals), ai_vals,
+ ai_locs, data_locs, data_lens, &ai_count, &err_no, &err_posn);
+ assert_equal(ret, data[i].ret, "i:%d gs1_lint_parse_raw_caret ret %d != %d (%s)\n",
+ i, ret, data[i].ret, data[i].data);
+ assert_equal(err_no, data[i].expected_err_no, "i:%d err_no %d != %d\n",
+ i, err_no, data[i].expected_err_no);
+ assert_equal(err_posn, data[i].expected_err_posn, "i:%d err_posn %d != %d\n",
+ i, err_posn, data[i].expected_err_posn);
+ assert_equal(ai_count, data[i].expected_ai_count, "i:%d ai_count %d != %d\n",
+ i, ai_count, data[i].expected_ai_count);
+ assert_zero(memcmp(ai_vals, data[i].expected_ai_vals, sizeof(int) * ARRAY_SIZE(ai_vals)),
+ "i:%d ai_vals %d,%d,%d,%d != %d,%d,%d,%d\n", i,
+ ai_vals[0], ai_vals[1], ai_vals[2], ai_vals[3],
+ data[i].expected_ai_vals[0], data[i].expected_ai_vals[1],
+ data[i].expected_ai_vals[2], data[i].expected_ai_vals[3]);
+ assert_zero(memcmp(ai_locs, data[i].expected_ai_locs, sizeof(int) * ARRAY_SIZE(ai_locs)),
+ "i:%d ai_locs %d,%d,%d,%d != %d,%d,%d,%d\n", i,
+ ai_locs[0], ai_locs[1], ai_locs[2], ai_locs[3],
+ data[i].expected_ai_locs[0], data[i].expected_ai_locs[1],
+ data[i].expected_ai_locs[2], data[i].expected_ai_locs[3]);
+ assert_zero(memcmp(data_locs, data[i].expected_data_locs, sizeof(int) * ARRAY_SIZE(data_locs)),
+ "i:%d data_locs %d,%d,%d,%d != %d,%d,%d,%d\n", i,
+ data_locs[0], data_locs[1], data_locs[2], data_locs[3],
+ data[i].expected_data_locs[0], data[i].expected_data_locs[1],
+ data[i].expected_data_locs[2], data[i].expected_data_locs[3]);
+ assert_zero(memcmp(data_lens, data[i].expected_data_lens, sizeof(int) * ARRAY_SIZE(data_lens)),
+ "i:%d data_lens %d,%d,%d,%d != %d,%d,%d,%d\n", i,
+ data_lens[0], data_lens[1], data_lens[2], data_lens[3],
+ data[i].expected_data_lens[0], data[i].expected_data_lens[1],
+ data[i].expected_data_lens[2], data[i].expected_data_lens[3]);
+ }
+
+ testFinish();
+}
+
int main(int argc, char *argv[]) {
testFunction funcs[] = { /* name, func */
@@ -2783,6 +3481,10 @@ int main(int argc, char *argv[]) {
{ "test_gs1_lint", test_gs1_lint },
{ "test_input_mode", test_input_mode },
{ "test_gs1nocheck_mode", test_gs1nocheck_mode },
+ { "test_gs1_hrt_conv_parsed", test_gs1_hrt_conv_parsed },
+ { "test_gs1_hrt_cpy", test_gs1_hrt_cpy },
+ { "test_gs1_hrt_conv_brackets", test_gs1_hrt_conv_brackets },
+ { "test_gs1_lint_parse_raw_caret", test_gs1_lint_parse_raw_caret },
};
testRun(argc, argv, funcs, ARRAY_SIZE(funcs));
diff --git a/backend/tests/test_gs1se.c b/backend/tests/test_gs1se.c
index 1436682a..ce1a5702 100644
--- a/backend/tests/test_gs1se.c
+++ b/backend/tests/test_gs1se.c
@@ -44,127 +44,191 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
int input_mode;
const char *data;
const char *composite;
- int ret;
+ int ret;
+ int compare_previous;
const char *comment;
const char *expected;
};
+ /* s/\v(\/\*)[ 0-9]*(\*\/)/\=printf("%s%3d%s", submatch(1), (@z+setreg('z',@z+1)), submatch(2))/ | let @z=0: */
static const struct item data[] = {
- /* 0*/ { BARCODE_GS1_128, -1, "12345678901234", "", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
- /* 1*/ { BARCODE_GS1_128, -1, "[01]12345678901231", "", 0, "Input mode ignored; verified manually against TEC-IT",
+ /* 0*/ { BARCODE_GS1_128, -1, "12345678901234", "", ZINT_ERROR_INVALID_DATA, 0, "GS1 data required", "" },
+ /* 1*/ { BARCODE_GS1_128, -1, "[01]12345678901231", "", 0, 0, "Input mode ignored; verified manually against TEC-IT",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /* 2*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(01)12345678901231", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 2*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(01)12345678901231", "", 0, 1, "Input mode ignored (parentheses instead of square brackets)",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /* 3*/ { BARCODE_GS1_128, GS1_MODE, "[01]12345678901231[21]()", "", 0, "Parentheses in AI data",
+ },
+ /* 3*/ { BARCODE_GS1_128, GS1_MODE, "[01]12345678901231[21]()", "", 0, 0, "Parentheses in AI data",
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011011100100101111011101000110010011001001000110111000101100011101011"
- },
- /* 4*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(21)\\(\\)", "", 0, "Parentheses in AI data",
+ },
+ /* 4*/ { BARCODE_GS1_128, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(21)\\(\\)", "", 0, 1, "Parentheses in AI data",
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011011100100101111011101000110010011001001000110111000101100011101011"
- },
- /* 5*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[21]1234", 0, "Input mode ignored",
+ },
+ /* 5*/ { BARCODE_GS1_128, -1, "^011234567890123121()", "", 0, 1, "",
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011011100100101111011101000110010011001001000110111000101100011101011"
+ },
+ /* 6*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123121()", "", 0, 1, "",
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011011100100101111011101000110010011001001000110111000101100011101011"
+ },
+ /* 7*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[21]1234", 0, 0, "Input mode ignored",
"0000000000000000000001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010000000000000000000000000"
"0000000000000000000001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010000000000000000000000000"
"0000000000000000000001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
- },
- /* 6*/ { BARCODE_GS1_128_CC, GS1PARENS_MODE, "(01)12345678901231", "(21)1234", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 8*/ { BARCODE_GS1_128_CC, GS1PARENS_MODE, "(01)12345678901231", "(21)1234", 0, 0, "Input mode ignored (parentheses instead of square brackets)",
"0000000000000000000001101101110110100001000001101001100111011000010011101001100001010001100010010011011000000110110001010000000000000000000000000"
"0000000000000000000001101101100111110100010011001101011100100000010011001001001111001011110011101011001000000110010001010000000000000000000000000"
"0000000000000000000001101101000101111100110000101001111010000001010011001101011101110011110010011110110000110111010001010000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
- },
- /* 7*/ { BARCODE_GS1_128_CC, GS1_MODE, "[01]12345678901231[10])", "[21](", 0, "Parentheses in AI data",
+ },
+ /* 9*/ { BARCODE_GS1_128_CC, GS1_MODE, "[01]12345678901231[10])", "[21](", 0, 0, "Parentheses in AI data",
"0000000000000000000000000000000000000000000110110111010100001000001000110000110001010001001110100111010100011100001110001100101100011011000101000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000110110110011100000101110110110000010011100101001100100100011110010111101101011100010000011001000101000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000110110100010001000100011110111100101111001001001100110111111010011010001111100100011101011101000101000000000000000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100110111011010000100010011011011101000100001011101000010011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011001000100101111011101100100100010111011110100010111101100011101011"
- },
- /* 8*/ { BARCODE_GS1_128_CC, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(10)\\)", "(21)\\(", 0, "Parentheses in AI data",
+ },
+ /* 10*/ { BARCODE_GS1_128_CC, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(10)\\)", "(21)\\(", 0, 1, "Parentheses in AI data",
"0000000000000000000000000000000000000000000110110111010100001000001000110000110001010001001110100111010100011100001110001100101100011011000101000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000110110110011100000101110110110000010011100101001100100100011110010111101101011100010000011001000101000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000110110100010001000100011110111100101111001001001100110111111010011010001111100100011101011101000101000000000000000000000000000000000000"
"0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100110111011010000100010011011011101000100001011101000010011100010100"
"1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011001000100101111011101100100100010111011110100010111101100011101011"
- },
- /* 9*/ { BARCODE_EAN14, -1, "1234567890123", "", 0, "Input mode ignored; verified manually against TEC-IT",
+ },
+ /* 11*/ { BARCODE_GS1_128_CC, GS1_MODE, "^011234567890123110)", "^21(", 0, 1, "",
+ "0000000000000000000000000000000000000000000110110111010100001000001000110000110001010001001110100111010100011100001110001100101100011011000101000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000110110110011100000101110110110000010011100101001100100100011110010111101101011100010000011001000101000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000110110100010001000100011110111100101111001001001100110111111010011010001111100100011101011101000101000000000000000000000000000000000000"
+ "0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100110111011010000100010011011011101000100001011101000010011100010100"
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011001000100101111011101100100100010111011110100010111101100011101011"
+ },
+ /* 12*/ { BARCODE_GS1_128_CC, GS1_MODE | GS1RAW_MODE, "011234567890123110)", "21(", 0, 1, "",
+ "0000000000000000000000000000000000000000000110110111010100001000001000110000110001010001001110100111010100011100001110001100101100011011000101000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000110110110011100000101110110110000010011100101001100100100011110010111101101011100010000011001000101000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000110110100010001000100011110111100101111001001001100110111111010011010001111100100011101011101000101000000000000000000000000000000000000"
+ "0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100110111011010000100010011011011101000100001011101000010011100010100"
+ "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011001000100101111011101100100100010111011110100010111101100011101011"
+ },
+ /* 13*/ { BARCODE_EAN14, -1, "1234567890123", "", 0, 0, "Input mode ignored; verified manually against TEC-IT",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /*10*/ { BARCODE_EAN14, GS1PARENS_MODE, "1234567890123", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 14*/ { BARCODE_EAN14, GS1PARENS_MODE, "1234567890123", "", 0, 1, "Input mode ignored (parentheses instead of square brackets)",
"11010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110100001100101100011101011"
- },
- /*11*/ { BARCODE_NVE18, -1, "12345678901234567", "", 0, "Input mode ignored; verified manually against TEC-IT",
+ },
+ /* 15*/ { BARCODE_NVE18, -1, "12345678901234567", "", 0, 0, "Input mode ignored; verified manually against TEC-IT",
"110100111001111010111011011001100101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010010101101110001100011101011"
- },
- /*12*/ { BARCODE_NVE18, GS1PARENS_MODE, "12345678901234567", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 16*/ { BARCODE_NVE18, GS1PARENS_MODE, "12345678901234567", "", 0, 1, "Input mode ignored (parentheses instead of square brackets)",
"110100111001111010111011011001100101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010010101101110001100011101011"
- },
- /*13*/ { BARCODE_DBAR_EXP, -1, "2012", "", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
- /*14*/ { BARCODE_DBAR_EXP, -1, "[20]12[01]12345678901231", "", 0, "Input mode ignored",
+ },
+ /* 17*/ { BARCODE_DBAR_EXP, -1, "2012", "", ZINT_ERROR_INVALID_DATA, 0, "GS1 data required", "" },
+ /* 18*/ { BARCODE_DBAR_EXP, -1, "[20]12[01]12345678901231", "", 0, 0, "Input mode ignored",
"01001100000110011010111111110000101000001000011001010111110010001110101111110000111010001001111101110111111001110010100011111100001011110011101000010110111000011010001011111111001110000110111101011101"
- },
- /*15*/ { BARCODE_DBAR_EXP, GS1PARENS_MODE, "(20)12(01)12345678901231", "", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 19*/ { BARCODE_DBAR_EXP, GS1PARENS_MODE, "(20)12(01)12345678901231", "", 0, 1, "",
"01001100000110011010111111110000101000001000011001010111110010001110101111110000111010001001111101110111111001110010100011111100001011110011101000010110111000011010001011111111001110000110111101011101"
- },
- /*16*/ { BARCODE_DBAR_EXP, UNICODE_MODE, "[20]12[01]12345678901231", "", 0, "Input mode ignored",
+ },
+ /* 20*/ { BARCODE_DBAR_EXP, -1, "^20120112345678901231", "", 0, 1, "",
"01001100000110011010111111110000101000001000011001010111110010001110101111110000111010001001111101110111111001110010100011111100001011110011101000010110111000011010001011111111001110000110111101011101"
- },
- /*17*/ { BARCODE_DBAR_EXP, -1, "[21])[8006]123456789012310102", "", 0, "Parentheses in AI data",
+ },
+ /* 21*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, "20120112345678901231", "", 0, 1, "",
+ "01001100000110011010111111110000101000001000011001010111110010001110101111110000111010001001111101110111111001110010100011111100001011110011101000010110111000011010001011111111001110000110111101011101"
+ },
+ /* 22*/ { BARCODE_DBAR_EXP, UNICODE_MODE, "[20]12[01]12345678901231", "", 0, 1, "Input mode ignored",
+ "01001100000110011010111111110000101000001000011001010111110010001110101111110000111010001001111101110111111001110010100011111100001011110011101000010110111000011010001011111111001110000110111101011101"
+ },
+ /* 23*/ { BARCODE_DBAR_EXP, -1, "[21])[8006]123456789012310102", "", 0, 0, "Parentheses in AI data",
"01011100110010001110111111110000101010100000001100010011011111101110101111100000011011011001110000010101100000010000100011111100001010001011100000110100011001011110001011111111001110000100101110000100001110001001101000110000000010100000001100101001110101111011000010111111111001101"
- },
- /*18*/ { BARCODE_DBAR_EXP, ESCAPE_MODE | GS1PARENS_MODE, "(21)\\)(8006)123456789012310102", "", 0, "Parentheses in AI data",
+ },
+ /* 24*/ { BARCODE_DBAR_EXP, ESCAPE_MODE | GS1PARENS_MODE, "(21)\\)(8006)123456789012310102", "", 0, 1, "Parentheses in AI data",
"01011100110010001110111111110000101010100000001100010011011111101110101111100000011011011001110000010101100000010000100011111100001010001011100000110100011001011110001011111111001110000100101110000100001110001001101000110000000010100000001100101001110101111011000010111111111001101"
- },
- /*19*/ { BARCODE_DBAR_EXP_CC, -1, "[20]12", "[21]1234[8006]123456789012310102", 0, "",
+ },
+ /* 25*/ { BARCODE_DBAR_EXP, -1, "^21)^8006123456789012310102", "", 0, 1, "",
+ "01011100110010001110111111110000101010100000001100010011011111101110101111100000011011011001110000010101100000010000100011111100001010001011100000110100011001011110001011111111001110000100101110000100001110001001101000110000000010100000001100101001110101111011000010111111111001101"
+ },
+ /* 26*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, "21)\0358006123456789012310102", "", 0, 1, "",
+ "01011100110010001110111111110000101010100000001100010011011111101110101111100000011011011001110000010101100000010000100011111100001010001011100000110100011001011110001011111111001110000100101110000100001110001001101000110000000010100000001100101001110101111011000010111111111001101"
+ },
+ /* 27*/ { BARCODE_DBAR_EXP_CC, -1, "[20]12", "[21]1234[8006]123456789012310102", 0, 0, "",
"001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
"001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
"001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
"001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*20*/ { BARCODE_DBAR_EXP_CC, UNICODE_MODE, "[20]12", "[21]1234[8006]123456789012310102", 0, "Input mode ignored",
+ },
+ /* 28*/ { BARCODE_DBAR_EXP_CC, -1, "^2012", "^211234^8006123456789012310102", 0, 1, "",
"001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
"001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
"001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
"001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*21*/ { BARCODE_DBAR_EXP_CC, -1, "[10]()[8006]123456789012310202", "[21]()", 0, "Parentheses in AI data",
+ },
+ /* 29*/ { BARCODE_DBAR_EXP_CC, GS1RAW_MODE, "2012", "211234\0358006123456789012310102", 0, 1, "",
+ "001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
+ "001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
+ "001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
+ "001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
+ "000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
+ "010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /* 30*/ { BARCODE_DBAR_EXP_CC, UNICODE_MODE, "[20]12", "[21]1234[8006]123456789012310102", 0, 1, "Input mode ignored",
+ "001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
+ "001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
+ "001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
+ "001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
+ "000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
+ "010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /* 31*/ { BARCODE_DBAR_EXP_CC, -1, "[10]()[8006]123456789012310202", "[21]()", 0, 0, "Parentheses in AI data",
"00110110111010100001000001000110000110001010001001110100111010111001111101100111011001000011011000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00110110110010001000111110110111101100001101001001100100111110111101110101111101000110111011001000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00110110100010111110110100000100001111011011001001100110100111001100111001000001001001111011101000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000110111001100001000000001010010101110011000001101100100000010001010000010101000100011011110001101110101110111000010100000010100101111101110010111000100010111101110100000000100001100000110011010010001100011000100111001111111101010001101110011110001111011100100101000000000110000"
+ "00000110111001100001000000001010010101110011000001101100100000010001010000010101000100011011110001101110101110111000010100000010100101111101110010111000100010111101110100000000100001100000110011010010001100011000100101001010101001010001101110011110001111011100100101000000000100000"
"01011001000110011110111111110000101010001100111110010011011111101110101111100000011011100100001110010001010001000111100011111100001010000010001101000111011101000010001011111111001110011111001100101101110011100111011000110000000010101110010001100001110000100011011010111111111001101"
- },
- /*22*/ { BARCODE_DBAR_EXP_CC, GS1PARENS_MODE, "(10)\\(\\)(8006)123456789012310202", "(21)\\(\\)", 0, "Parentheses in AI data",
+ },
+ /* 32*/ { BARCODE_DBAR_EXP_CC, GS1PARENS_MODE, "(10)\\(\\)(8006)123456789012310202", "(21)\\(\\)", 0, 1, "Parentheses in AI data",
"00110110111010100001000001000110000110001010001001110100111010111001111101100111011001000011011000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00110110110010001000111110110111101100001101001001100100111110111101110101111101000110111011001000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00110110100010111110110100000100001111011011001001100110100111001100111001000001001001111011101000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000110111001100001000000001010010101110011000001101100100000010001010000010101000100011011110001101110101110111000010100000010100101111101110010111000100010111101110100000000100001100000110011010010001100011000100111001111111101010001101110011110001111011100100101000000000110000"
+ "00000110111001100001000000001010010101110011000001101100100000010001010000010101000100011011110001101110101110111000010100000010100101111101110010111000100010111101110100000000100001100000110011010010001100011000100101001010101001010001101110011110001111011100100101000000000100000"
"01011001000110011110111111110000101010001100111110010011011111101110101111100000011011100100001110010001010001000111100011111100001010000010001101000111011101000010001011111111001110011111001100101101110011100111011000110000000010101110010001100001110000100011011010111111111001101"
- },
- /*23*/ { BARCODE_DBAR_EXPSTK, -1, "12", "", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
- /*24*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[20]12", "", 0, "Input mode ignored",
+ },
+ /* 33*/ { BARCODE_DBAR_EXPSTK, -1, "12", "", ZINT_ERROR_INVALID_DATA, 0, "GS1 data required", "" },
+ /* 34*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[20]12", "", 0, 0, "",
"010011010011100000101111111100001011000011101110010111000110110001001011111100001110001111000010101101"
"000000101100011111010000000010100100111100010001101000111001001110110100000010100001110000111101010000"
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
"000000100000000101110010000110100011000111110110010100101000000101001000001111010000000000000000000000"
"101110011111111010001101111001011100111000001001101010000111111000110111110000101001000000000000000000"
- },
- /*25*/ { BARCODE_DBAR_EXPSTK, UNICODE_MODE, "[01]12345678901231[20]12", "", 0, "Input mode ignored",
+ },
+ /* 35*/ { BARCODE_DBAR_EXPSTK, -1, "^01123456789012312012", "", 0, 1, "",
"010011010011100000101111111100001011000011101110010111000110110001001011111100001110001111000010101101"
"000000101100011111010000000010100100111100010001101000111001001110110100000010100001110000111101010000"
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
"000000100000000101110010000110100011000111110110010100101000000101001000001111010000000000000000000000"
"101110011111111010001101111001011100111000001001101010000111111000110111110000101001000000000000000000"
- },
- /*26*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[21](21)", "", 0, "Parentheses in AI data",
+ },
+ /* 36*/ { BARCODE_DBAR_EXPSTK, GS1RAW_MODE, "01123456789012312012", "", 0, 1, "",
+ "010011010011100000101111111100001011000011101110010111000110110001001011111100001110001111000010101101"
+ "000000101100011111010000000010100100111100010001101000111001001110110100000010100001110000111101010000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000100000000101110010000110100011000111110110010100101000000101001000001111010000000000000000000000"
+ "101110011111111010001101111001011100111000001001101010000111111000110111110000101001000000000000000000"
+ },
+ /* 37*/ { BARCODE_DBAR_EXPSTK, UNICODE_MODE, "[01]12345678901231[20]12", "", 0, 1, "Input mode ignored",
+ "010011010011100000101111111100001011000011101110010111000110110001001011111100001110001111000010101101"
+ "000000101100011111010000000010100100111100010001101000111001001110110100000010100001110000111101010000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000100000000101110010000110100011000111110110010100101000000101001000001111010000000000000000000000"
+ "101110011111111010001101111001011100111000001001101010000111111000110111110000101001000000000000000000"
+ },
+ /* 38*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[21](21)", "", 0, 0, "Parentheses in AI data",
"010000100011011001101111111100001010010000111011000111000110110001001011111000000110001111000010101101"
"000011011100100110010000000010100101101111000100111000111001001110110100000101010001110000111101010000"
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
@@ -174,8 +238,8 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
"000010010011100000010100001010100101011111000010100000000000000000000000000000000000000000000000000000"
"010101101100011111100011110000001010100000111101000100000000000000000000000000000000000000000000000000"
- },
- /*27*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(21)\\(21\\)", "", 0, "Parentheses in AI data",
+ },
+ /* 39*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, "(01)12345678901231(21)\\(21\\)", "", 0, 1, "Parentheses in AI data",
"010000100011011001101111111100001010010000111011000111000110110001001011111000000110001111000010101101"
"000011011100100110010000000010100101101111000100111000111001001110110100000101010001110000111101010000"
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
@@ -185,33 +249,71 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
"000010010011100000010100001010100101011111000010100000000000000000000000000000000000000000000000000000"
"010101101100011111100011110000001010100000111101000100000000000000000000000000000000000000000000000000"
- },
- /*28*/ { BARCODE_DBAR_EXPSTK_CC, -1, "12", "[21]1234", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
- /*29*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[20]12", "[21]1234[8006]123456789012310102", 0, "Input mode ignored; (same as BARCODE_DBAR_EXP_CC above)",
+ },
+ /* 40*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE, "^011234567890123121(21)", "", 0, 1, "",
+ "010000100011011001101111111100001010010000111011000111000110110001001011111000000110001111000010101101"
+ "000011011100100110010000000010100101101111000100111000111001001110110100000101010001110000111101010000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000011000011100010100001000000001011001000110110000111010011011110001001010000001010010000011110100000"
+ "101100111100011101011100111111110100110111001001111000101100100001110100001111110001101111100001010010"
+ "000011000011100010100001000000001011001000110110000111010011011110001001010000001010010000011110100000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000010010011100000010100001010100101011111000010100000000000000000000000000000000000000000000000000000"
+ "010101101100011111100011110000001010100000111101000100000000000000000000000000000000000000000000000000"
+ },
+ /* 41*/ { BARCODE_DBAR_EXPSTK, ESCAPE_MODE | GS1PARENS_MODE | GS1RAW_MODE, "011234567890123121(21)", "", 0, 1, "",
+ "010000100011011001101111111100001010010000111011000111000110110001001011111000000110001111000010101101"
+ "000011011100100110010000000010100101101111000100111000111001001110110100000101010001110000111101010000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000011000011100010100001000000001011001000110110000111010011011110001001010000001010010000011110100000"
+ "101100111100011101011100111111110100110111001001111000101100100001110100001111110001101111100001010010"
+ "000011000011100010100001000000001011001000110110000111010011011110001001010000001010010000011110100000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000010010011100000010100001010100101011111000010100000000000000000000000000000000000000000000000000000"
+ "010101101100011111100011110000001010100000111101000100000000000000000000000000000000000000000000000000"
+ },
+ /* 42*/ { BARCODE_DBAR_EXPSTK_CC, -1, "12", "[21]1234", ZINT_ERROR_INVALID_DATA, 0, "GS1 data required", "" },
+ /* 43*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[20]12", "[21]1234[8006]123456789012310102", 0, 0, "",
"001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
"001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
"001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
"001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*30*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, "(20)12", "(21)1234(8006)123456789012310102", 0, "Input mode ignored (parentheses instead of square brackets)",
+ },
+ /* 44*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, "(20)12", "(21)1234(8006)123456789012310102", 0, 1, "",
"001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
"001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
"001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
"001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*31*/ { BARCODE_DBAR_EXPSTK_CC, UNICODE_MODE, "[20]12", "[21]1234[8006]123456789012310102", 0, "Input mode ignored",
+ },
+ /* 45*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, "^2012", "^211234^8006123456789012310102", 0, 1, "",
"001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
"001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
"001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
"001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
"000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
"010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
- },
- /*32*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]1)", "[21]12)(", 0, "Parentheses in AI data",
+ },
+ /* 46*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE | GS1RAW_MODE, "2012", "211234\0358006123456789012310102", 0, 1, "",
+ "001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
+ "001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
+ "001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
+ "001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
+ "000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
+ "010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /* 47*/ { BARCODE_DBAR_EXPSTK_CC, UNICODE_MODE, "[20]12", "[21]1234[8006]123456789012310102", 0, 1, "Input mode ignored",
+ "001101001000110100001000001101001100111011000010010001101100001000001011011110111000101100111011001010"
+ "001101011000111110110100001001000111011111101010010000101101100001111001010100001111000100110011001010"
+ "001101011100100110011001111001001000001001111010110000101011011000011110010100110001111100110111001010"
+ "001101011110111100111001001101101001000011000010111000101111011100001011011010011101111000110111101010"
+ "000001111111010110010000000010100100111001100001011010000011010001110100001010101001010000011110100000"
+ "010010000000101001101111111100001011000110011110100101111100101110001011110000000010101111100001011101"
+ },
+ /* 48*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]1)", "[21]12)(", 0, 0, "Parentheses in AI data",
"001101101110110100001000001101110111011100111010011101001000010010000001010010001000010000110110001010"
"001101101100111101000010001001110000110111010010011001001101100011110001011010111000100000110010001010"
"001101101000111001111101011001011100100000011010011001101001111001000001010000011110010100111010001010"
@@ -221,8 +323,8 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
"000000011001001111100001000000001010000110111100110101111011011100001001010000001010010000011110100000"
"101011100110110000011100111111110101111001000011001010000100100011110100001111110001101111100001010010"
- },
- /*33*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, "(01)12345678901231(10)1\\)", "(21)12\\)\\(", 0, "Parentheses in AI data",
+ },
+ /* 49*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, "(01)12345678901231(10)1\\)", "(21)12\\)\\(", 0, 1, "Parentheses in AI data",
"001101101110110100001000001101110111011100111010011101001000010010000001010010001000010000110110001010"
"001101101100111101000010001001110000110111010010011001001101100011110001011010111000100000110010001010"
"001101101000111001111101011001011100100000011010011001101001111001000001010000011110010100111010001010"
@@ -232,12 +334,36 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
"000000011001001111100001000000001010000110111100110101111011011100001001010000001010010000011110100000"
"101011100110110000011100111111110101111001000011001010000100100011110100001111110001101111100001010010"
- },
+ },
+ /* 50*/ { BARCODE_DBAR_EXPSTK_CC, -1, "^0112345678901231101)", "^2112)(", 0, 0, "Parentheses in AI data",
+ "001101101110110100001000001101110111011100111010011101001000010010000001010010001000010000110110001010"
+ "001101101100111101000010001001110000110111010010011001001101100011110001011010111000100000110010001010"
+ "001101101000111001111101011001011100100000011010011001101001111001000001010000011110010100111010001010"
+ "000000111001111001010000000010100100001100110001001000111001001110110100000010100001110000111101010000"
+ "010011000110000110101111111100001011110011001110110111000110110001001011111100001110001111000010101101"
+ "000000111001111001010000000010100100001100110001001000111001001110110100000010100001110000111101010000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000011001001111100001000000001010000110111100110101111011011100001001010000001010010000011110100000"
+ "101011100110110000011100111111110101111001000011001010000100100011110100001111110001101111100001010010"
+ },
+ /* 51*/ { BARCODE_DBAR_EXPSTK_CC, GS1RAW_MODE, "0112345678901231101)", "2112)(", 0, 0, "Parentheses in AI data",
+ "001101101110110100001000001101110111011100111010011101001000010010000001010010001000010000110110001010"
+ "001101101100111101000010001001110000110111010010011001001101100011110001011010111000100000110010001010"
+ "001101101000111001111101011001011100100000011010011001101001111001000001010000011110010100111010001010"
+ "000000111001111001010000000010100100001100110001001000111001001110110100000010100001110000111101010000"
+ "010011000110000110101111111100001011110011001110110111000110110001001011111100001110001111000010101101"
+ "000000111001111001010000000010100100001100110001001000111001001110110100000010100001110000111101010000"
+ "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
+ "000000011001001111100001000000001010000110111100110101111011011100001001010000001010010000011110100000"
+ "101011100110110000011100111111110101111001000011001010000100100011110100001111110001101111100001010010"
+ },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
struct zint_symbol *symbol = NULL;
+ struct zint_symbol *previous_symbol = NULL;
+
const char *text;
char escaped[1024];
@@ -275,23 +401,27 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
const int data_len = (int) strlen(data[i].data);
const int composite_len = (int) strlen(data[i].composite);
if (data[i].ret == 0) {
- printf(" /*%2d*/ { %s, %s, \"%s\", \"%s\", %d, \"%s\",\n",
+ printf(" /*%3d*/ { %s, %s, \"%s\", \"%s\", %d, %d, \"%s\",\n",
i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode),
testUtilEscape(data[i].data, data_len, escaped, sizeof(escaped)),
testUtilEscape(data[i].composite, composite_len, escaped2, sizeof(escaped2)),
- data[i].ret, data[i].comment);
+ data[i].ret, data[i].compare_previous, data[i].comment);
testUtilModulesPrint(symbol, " ", "\n");
- printf(" },\n");
+ printf(" },\n");
} else {
- printf(" /*%2d*/ { %s, %s, \"%s\", \"%s\", %s, \"%s\", \"\" },\n",
+ printf(" /*%3d*/ { %s, %s, \"%s\", \"%s\", %s, %d, \"%s\", \"\" },\n",
i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode),
testUtilEscape(data[i].data, data_len, escaped, sizeof(escaped)),
testUtilEscape(data[i].composite, composite_len, escaped2, sizeof(escaped2)),
- testUtilErrorName(data[i].ret), data[i].comment);
+ testUtilErrorName(data[i].ret), data[i].compare_previous, data[i].comment);
}
} else {
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
+ if (p_ctx->index == -1 && data[i].compare_previous) {
+ int cmp_ret = testUtilSymbolCmp(symbol, previous_symbol);
+ assert_zero(cmp_ret, "i:%d testUtilSymbolCmp cmp_ret %d != 0\n", i, cmp_ret);
+ }
if (ret < ZINT_ERROR) {
int width, row;
@@ -299,7 +429,8 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
- if (do_bwipp && testUtilCanBwipp(i, symbol, -1, -1, -1, debug)) {
+ if (do_bwipp && testUtilCanBwipp(i, symbol, -1, -1,
+ text[0] == '^' ? ZINT_TESTUTIL_GS1CARET : -1 /*Hack indicator*/, debug)) {
ret = testUtilBwipp(i, symbol, -1, -1, -1, text, length, symbol->primary, bwipp_buf,
sizeof(bwipp_buf), NULL);
assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
@@ -313,8 +444,10 @@ static void test_gs1_reduce(const testCtx *const p_ctx) {
}
}
- ZBarcode_Delete(symbol);
+ ZBarcode_Delete(previous_symbol);
+ previous_symbol = symbol;
}
+ ZBarcode_Delete(previous_symbol);
testFinish();
}
@@ -337,67 +470,127 @@ static void test_hrt(const testCtx *const p_ctx) {
static const struct item data[] = {
/* 0*/ { BARCODE_EAN8_CC, -1, -1, "1234567", "[20]12", 0, "12345670", "" },
/* 1*/ { BARCODE_EANX_CC, -1, -1, "1234567", "[20]12", 0, "12345670", "" }, /* EAN-8 */
- /* 2*/ { BARCODE_EAN8_CC, -1, BARCODE_CONTENT_SEGS, "1234567", "[20]12", 0, "12345670", "12345670|2012" },
- /* 3*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "1234567", "[20]12", 0, "12345670", "12345670|2012" },
- /* 4*/ { BARCODE_EAN13_CC, -1, -1, "123456789012", "[20]12", 0, "1234567890128", "" },
- /* 5*/ { BARCODE_EANX_CC, -1, -1, "123456789012", "[20]12", 0, "1234567890128", "" }, /* EAN-13 */
- /* 6*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "[20]12", 0, "1234567890128", "1234567890128|2012" },
- /* 7*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "[20]12", 0, "1234567890128", "1234567890128|2012" }, /* EAN-13 */
- /* 8*/ { BARCODE_EAN13_CC, -1, -1, "123456789012", "[10]LOT123[20]12", 0, "1234567890128", "" },
- /* 9*/ { BARCODE_EANX_CC, -1, -1, "123456789012", "[10]LOT123[20]12", 0, "1234567890128", "" }, /* EAN-13 */
- /* 10*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "[10]LOT123[20]12", 0, "1234567890128", "1234567890128|10LOT123\0352012" },
- /* 11*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "[10]LOT123[20]12", 0, "1234567890128", "1234567890128|10LOT123\0352012" }, /* EAN-13 */
- /* 12*/ { BARCODE_EAN13_CC, -1, -1, "1234567890128", "[20]12", 0, "1234567890128", "" },
- /* 13*/ { BARCODE_EANX_CC, -1, -1, "1234567890128", "[20]12", 0, "1234567890128", "" },
- /* 14*/ { BARCODE_EAN13_CC, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
- /* 15*/ { BARCODE_EANX_CC, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
- /* 16*/ { BARCODE_EAN13_CC, GS1NOCHECK_MODE, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
- /* 17*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
- /* 18*/ { BARCODE_EAN13_CC, -1, -1, "1234567890128", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
- /* 19*/ { BARCODE_EANX_CC, -1, -1, "1234567890128", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
- /* 20*/ { BARCODE_EAN13_CC, GS1NOCHECK_MODE, -1, "1234567890128", "[20]1A", 0, "1234567890128", "" },
- /* 21*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, "1234567890128", "[20]1A", 0, "1234567890128", "" },
- /* 22*/ { BARCODE_EAN13_CC, -1, -1, "1234567890128+12", "[20]12", 0, "1234567890128+12", "" },
- /* 23*/ { BARCODE_EANX_CC, -1, -1, "1234567890128+12", "[20]12", 0, "1234567890128+12", "" },
- /* 24*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "1234567890128+12", "[20]12", 0, "1234567890128+12", "123456789012812|2012" },
- /* 25*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "1234567890128+12", "[20]12", 0, "1234567890128+12", "123456789012812|2012" },
- /* 26*/ { BARCODE_DBAR_OMN_CC, -1, -1, "1234567890123", "[20]12", 0, "(01)12345678901231", "" },
- /* 27*/ { BARCODE_DBAR_OMN_CC, -1, BARCODE_CONTENT_SEGS, "1234567890123", "[20]12", 0, "(01)12345678901231", "0112345678901231|2012" },
- /* 28*/ { BARCODE_DBAR_OMN_CC, -1, -1, "12345678901231", "[20]12", 0, "(01)12345678901231", "" },
- /* 29*/ { BARCODE_DBAR_OMN_CC, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
- /* 30*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
- /* 31*/ { BARCODE_DBAR_OMN_CC, -1, -1, "12345678901231", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
- /* 32*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, "12345678901231", "[20]1A", 0, "(01)12345678901231", "" },
- /* 33*/ { BARCODE_DBAR_LTD_CC, -1, -1, "1234567890123", "[20]12", 0, "(01)12345678901231", "" },
- /* 34*/ { BARCODE_DBAR_LTD_CC, -1, BARCODE_CONTENT_SEGS, "1234567890123", "[20]12", 0, "(01)12345678901231", "0112345678901231|2012" },
- /* 35*/ { BARCODE_DBAR_LTD_CC, -1, -1, "12345678901231", "[20]12", 0, "(01)12345678901231", "" },
- /* 36*/ { BARCODE_DBAR_LTD_CC, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
- /* 37*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
- /* 38*/ { BARCODE_DBAR_LTD_CC, -1, -1, "12345678901231", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
- /* 39*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, "12345678901231", "[20]1A", 0, "(01)12345678901231", "" },
- /* 40*/ { BARCODE_UPCA_CC, -1, -1, "12345678901", "[20]12", 0, "123456789012", "" },
- /* 41*/ { BARCODE_UPCA_CC, -1, BARCODE_CONTENT_SEGS, "12345678901", "[20]12", 0, "123456789012", "0123456789012|2012" },
- /* 42*/ { BARCODE_UPCA_CC, -1, -1, "123456789012", "[20]12", 0, "123456789012", "" },
- /* 43*/ { BARCODE_UPCA_CC, -1, -1, "123456789013", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
- /* 44*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, "123456789013", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
- /* 45*/ { BARCODE_UPCA_CC, -1, -1, "123456789012", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
- /* 46*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, "123456789012", "[20]1A", 0, "123456789012", "" },
- /* 47*/ { BARCODE_UPCA_CC, -1, -1, "123456789012+123", "[20]12", 0, "123456789012+00123", "" },
- /* 48*/ { BARCODE_UPCA_CC, -1, BARCODE_CONTENT_SEGS, "123456789012+123", "[20]12", 0, "123456789012+00123", "012345678901200123|2012" },
- /* 49*/ { BARCODE_UPCE_CC, -1, -1, "123456", "[20]12", 0, "01234565", "" },
- /* 50*/ { BARCODE_UPCE_CC, -1, BARCODE_CONTENT_SEGS, "123456", "[20]12", 0, "01234565", "0012345000065|2012" },
- /* 51*/ { BARCODE_UPCE_CC, -1, -1, "1234567", "[20]12", 0, "12345670", "" },
- /* 52*/ { BARCODE_UPCE_CC, -1, -1, "12345670", "[20]12", 0, "12345670", "" },
- /* 53*/ { BARCODE_UPCE_CC, -1, -1, "12345671", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
- /* 54*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, "12345671", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
- /* 55*/ { BARCODE_UPCE_CC, -1, -1, "12345670", "[20]12", 0, "12345670", "" }, /* Check digit can now be given for UPCE_CC, like UPCA_CC */
- /* 56*/ { BARCODE_UPCE_CC, -1, -1, "1234567", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
- /* 57*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, "1234567", "[20]1A", 0, "12345670", "" },
- /* 58*/ { BARCODE_UPCE_CC, -1, BARCODE_CONTENT_SEGS, "1234567+2", "[20]12", 0, "12345670+02", "012345600007002|2012" },
- /* 59*/ { BARCODE_DBAR_STK_CC, -1, -1, "12345678901231", "[20]12", 0, "", "" }, /* No HRT for stacked symbologies */
- /* 60*/ { BARCODE_DBAR_STK_CC, -1, BARCODE_CONTENT_SEGS, "12345678901231", "[20]12", 0, "", "0112345678901231|2012" }, /* But have content segs */
- /* 61*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, "12345678901231", "[20]12", 0, "", "" },
- /* 62*/ { BARCODE_DBAR_OMNSTK_CC, -1, BARCODE_CONTENT_SEGS, "12345678901231", "[20]12", 0, "", "0112345678901231|2012" },
+ /* 2*/ { BARCODE_EAN8_CC, -1, -1, "1234567", "^2012", 0, "12345670", "" },
+ /* 3*/ { BARCODE_EANX_CC, -1, -1, "1234567", "^2012", 0, "12345670", "" },
+ /* 4*/ { BARCODE_EAN8_CC, GS1RAW_MODE, -1, "1234567", "2012", 0, "12345670", "" },
+ /* 5*/ { BARCODE_EANX_CC, GS1RAW_MODE, -1, "1234567", "2012", 0, "12345670", "" },
+ /* 6*/ { BARCODE_EAN8_CC, -1, BARCODE_CONTENT_SEGS, "1234567", "[20]12", 0, "12345670", "12345670|2012" },
+ /* 7*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "1234567", "[20]12", 0, "12345670", "12345670|2012" },
+ /* 8*/ { BARCODE_EAN8_CC, -1, BARCODE_CONTENT_SEGS, "1234567", "^2012", 0, "12345670", "12345670|2012" },
+ /* 9*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "1234567", "^2012", 0, "12345670", "12345670|2012" },
+ /* 10*/ { BARCODE_EAN8_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "1234567", "2012", 0, "12345670", "12345670|2012" },
+ /* 11*/ { BARCODE_EANX_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "1234567", "2012", 0, "12345670", "12345670|2012" },
+ /* 12*/ { BARCODE_EAN13_CC, -1, -1, "123456789012", "[20]12", 0, "1234567890128", "" },
+ /* 13*/ { BARCODE_EANX_CC, -1, -1, "123456789012", "[20]12", 0, "1234567890128", "" }, /* EAN-13 */
+ /* 14*/ { BARCODE_EAN13_CC, -1, -1, "123456789012", "^2012", 0, "1234567890128", "" },
+ /* 15*/ { BARCODE_EANX_CC, -1, -1, "123456789012", "^2012", 0, "1234567890128", "" },
+ /* 16*/ { BARCODE_EAN13_CC, GS1RAW_MODE, -1, "123456789012", "2012", 0, "1234567890128", "" },
+ /* 17*/ { BARCODE_EANX_CC, GS1RAW_MODE, -1, "123456789012", "2012", 0, "1234567890128", "" },
+ /* 18*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "[20]12", 0, "1234567890128", "1234567890128|2012" },
+ /* 19*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "[20]12", 0, "1234567890128", "1234567890128|2012" },
+ /* 20*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "^2012", 0, "1234567890128", "1234567890128|2012" },
+ /* 21*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "^2012", 0, "1234567890128", "1234567890128|2012" },
+ /* 22*/ { BARCODE_EAN13_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "123456789012", "2012", 0, "1234567890128", "1234567890128|2012" },
+ /* 23*/ { BARCODE_EANX_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "123456789012", "2012", 0, "1234567890128", "1234567890128|2012" },
+ /* 24*/ { BARCODE_EAN13_CC, -1, -1, "123456789012", "[10]LOT123[20]12", 0, "1234567890128", "" },
+ /* 25*/ { BARCODE_EANX_CC, -1, -1, "123456789012", "[10]LOT123[20]12", 0, "1234567890128", "" }, /* EAN-13 */
+ /* 26*/ { BARCODE_EAN13_CC, -1, -1, "123456789012", "^10LOT123^2012", 0, "1234567890128", "" },
+ /* 27*/ { BARCODE_EANX_CC, -1, -1, "123456789012", "^10LOT123^2012", 0, "1234567890128", "" },
+ /* 28*/ { BARCODE_EAN13_CC, GS1RAW_MODE, -1, "123456789012", "10LOT123\0352012", 0, "1234567890128", "" },
+ /* 29*/ { BARCODE_EANX_CC, GS1RAW_MODE, -1, "123456789012", "10LOT123\0352012", 0, "1234567890128", "" },
+ /* 30*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "[10]LOT123[20]12", 0, "1234567890128", "1234567890128|10LOT123\0352012" },
+ /* 31*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "[10]LOT123[20]12", 0, "1234567890128", "1234567890128|10LOT123\0352012" }, /* EAN-13 */
+ /* 32*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "^10LOT123^2012", 0, "1234567890128", "1234567890128|10LOT123\0352012" },
+ /* 33*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "123456789012", "^10LOT123^2012", 0, "1234567890128", "1234567890128|10LOT123\0352012" }, /* EAN-13 */
+ /* 34*/ { BARCODE_EAN13_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "123456789012", "10LOT123\0352012", 0, "1234567890128", "1234567890128|10LOT123\0352012" },
+ /* 35*/ { BARCODE_EANX_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "123456789012", "10LOT123\0352012", 0, "1234567890128", "1234567890128|10LOT123\0352012" },
+ /* 36*/ { BARCODE_EAN13_CC, -1, -1, "1234567890128", "[20]12", 0, "1234567890128", "" },
+ /* 37*/ { BARCODE_EANX_CC, -1, -1, "1234567890128", "[20]12", 0, "1234567890128", "" },
+ /* 38*/ { BARCODE_EAN13_CC, -1, -1, "1234567890128", "^2012", 0, "1234567890128", "" },
+ /* 39*/ { BARCODE_EANX_CC, -1, -1, "1234567890128", "^2012", 0, "1234567890128", "" },
+ /* 40*/ { BARCODE_EAN13_CC, GS1RAW_MODE, -1, "1234567890128", "2012", 0, "1234567890128", "" },
+ /* 41*/ { BARCODE_EANX_CC, GS1RAW_MODE, -1, "1234567890128", "2012", 0, "1234567890128", "" },
+ /* 42*/ { BARCODE_EAN13_CC, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
+ /* 43*/ { BARCODE_EANX_CC, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
+ /* 44*/ { BARCODE_EAN13_CC, GS1NOCHECK_MODE, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
+ /* 45*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
+ /* 46*/ { BARCODE_EAN13_CC, -1, -1, "1234567890128", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
+ /* 47*/ { BARCODE_EANX_CC, -1, -1, "1234567890128", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
+ /* 48*/ { BARCODE_EAN13_CC, GS1NOCHECK_MODE, -1, "1234567890128", "[20]1A", 0, "1234567890128", "" },
+ /* 49*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, "1234567890128", "[20]1A", 0, "1234567890128", "" },
+ /* 50*/ { BARCODE_EAN13_CC, -1, -1, "1234567890128+12", "[20]12", 0, "1234567890128+12", "" },
+ /* 51*/ { BARCODE_EANX_CC, -1, -1, "1234567890128+12", "[20]12", 0, "1234567890128+12", "" },
+ /* 52*/ { BARCODE_EAN13_CC, -1, -1, "1234567890128+12", "^2012", 0, "1234567890128+12", "" },
+ /* 53*/ { BARCODE_EANX_CC, -1, -1, "1234567890128+12", "^2012", 0, "1234567890128+12", "" },
+ /* 54*/ { BARCODE_EAN13_CC, GS1RAW_MODE, -1, "1234567890128+12", "2012", 0, "1234567890128+12", "" },
+ /* 55*/ { BARCODE_EANX_CC, GS1RAW_MODE, -1, "1234567890128+12", "2012", 0, "1234567890128+12", "" },
+ /* 56*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "1234567890128+12", "[20]12", 0, "1234567890128+12", "123456789012812|2012" },
+ /* 57*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "1234567890128+12", "[20]12", 0, "1234567890128+12", "123456789012812|2012" },
+ /* 58*/ { BARCODE_EAN13_CC, -1, BARCODE_CONTENT_SEGS, "1234567890128+12", "^2012", 0, "1234567890128+12", "123456789012812|2012" },
+ /* 59*/ { BARCODE_EANX_CC, -1, BARCODE_CONTENT_SEGS, "1234567890128+12", "^2012", 0, "1234567890128+12", "123456789012812|2012" },
+ /* 60*/ { BARCODE_EAN13_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "1234567890128+12", "2012", 0, "1234567890128+12", "123456789012812|2012" },
+ /* 61*/ { BARCODE_EANX_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "1234567890128+12", "2012", 0, "1234567890128+12", "123456789012812|2012" },
+ /* 62*/ { BARCODE_DBAR_OMN_CC, -1, -1, "1234567890123", "[20]12", 0, "(01)12345678901231", "" },
+ /* 63*/ { BARCODE_DBAR_OMN_CC, -1, -1, "1234567890123", "^2012", 0, "(01)12345678901231", "" },
+ /* 64*/ { BARCODE_DBAR_OMN_CC, GS1RAW_MODE, -1, "1234567890123", "2012", 0, "(01)12345678901231", "" },
+ /* 65*/ { BARCODE_DBAR_OMN_CC, -1, BARCODE_CONTENT_SEGS, "1234567890123", "[20]12", 0, "(01)12345678901231", "0112345678901231|2012" },
+ /* 66*/ { BARCODE_DBAR_OMN_CC, -1, BARCODE_CONTENT_SEGS, "1234567890123", "^2012", 0, "(01)12345678901231", "0112345678901231|2012" },
+ /* 67*/ { BARCODE_DBAR_OMN_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "1234567890123", "2012", 0, "(01)12345678901231", "0112345678901231|2012" },
+ /* 68*/ { BARCODE_DBAR_OMN_CC, -1, -1, "12345678901231", "[20]12", 0, "(01)12345678901231", "" },
+ /* 69*/ { BARCODE_DBAR_OMN_CC, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
+ /* 70*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
+ /* 71*/ { BARCODE_DBAR_OMN_CC, -1, -1, "12345678901231", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
+ /* 72*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, "12345678901231", "[20]1A", 0, "(01)12345678901231", "" },
+ /* 73*/ { BARCODE_DBAR_LTD_CC, -1, -1, "1234567890123", "[20]12", 0, "(01)12345678901231", "" },
+ /* 74*/ { BARCODE_DBAR_LTD_CC, -1, -1, "1234567890123", "^2012", 0, "(01)12345678901231", "" },
+ /* 75*/ { BARCODE_DBAR_LTD_CC, GS1RAW_MODE, -1, "1234567890123", "2012", 0, "(01)12345678901231", "" },
+ /* 76*/ { BARCODE_DBAR_LTD_CC, -1, BARCODE_CONTENT_SEGS, "1234567890123", "[20]12", 0, "(01)12345678901231", "0112345678901231|2012" },
+ /* 77*/ { BARCODE_DBAR_LTD_CC, -1, BARCODE_CONTENT_SEGS, "1234567890123", "^2012", 0, "(01)12345678901231", "0112345678901231|2012" },
+ /* 78*/ { BARCODE_DBAR_LTD_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "1234567890123", "2012", 0, "(01)12345678901231", "0112345678901231|2012" },
+ /* 79*/ { BARCODE_DBAR_LTD_CC, -1, -1, "12345678901231", "[20]12", 0, "(01)12345678901231", "" },
+ /* 80*/ { BARCODE_DBAR_LTD_CC, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
+ /* 81*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
+ /* 82*/ { BARCODE_DBAR_LTD_CC, -1, -1, "12345678901231", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
+ /* 83*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, "12345678901231", "[20]1A", 0, "(01)12345678901231", "" },
+ /* 84*/ { BARCODE_UPCA_CC, -1, -1, "12345678901", "[20]12", 0, "123456789012", "" },
+ /* 85*/ { BARCODE_UPCA_CC, -1, -1, "12345678901", "^2012", 0, "123456789012", "" },
+ /* 86*/ { BARCODE_UPCA_CC, GS1RAW_MODE, -1, "12345678901", "2012", 0, "123456789012", "" },
+ /* 87*/ { BARCODE_UPCA_CC, -1, BARCODE_CONTENT_SEGS, "12345678901", "[20]12", 0, "123456789012", "0123456789012|2012" },
+ /* 88*/ { BARCODE_UPCA_CC, -1, BARCODE_CONTENT_SEGS, "12345678901", "^2012", 0, "123456789012", "0123456789012|2012" },
+ /* 89*/ { BARCODE_UPCA_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "12345678901", "2012", 0, "123456789012", "0123456789012|2012" },
+ /* 90*/ { BARCODE_UPCA_CC, -1, -1, "123456789012", "[20]12", 0, "123456789012", "" },
+ /* 91*/ { BARCODE_UPCA_CC, -1, -1, "123456789013", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
+ /* 92*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, "123456789013", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
+ /* 93*/ { BARCODE_UPCA_CC, -1, -1, "123456789012", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
+ /* 94*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, "123456789012", "[20]1A", 0, "123456789012", "" },
+ /* 95*/ { BARCODE_UPCA_CC, -1, -1, "123456789012+123", "[20]12", 0, "123456789012+00123", "" },
+ /* 96*/ { BARCODE_UPCA_CC, -1, BARCODE_CONTENT_SEGS, "123456789012+123", "[20]12", 0, "123456789012+00123", "012345678901200123|2012" },
+ /* 97*/ { BARCODE_UPCE_CC, -1, -1, "123456", "[20]12", 0, "01234565", "" },
+ /* 98*/ { BARCODE_UPCE_CC, -1, -1, "123456", "^2012", 0, "01234565", "" },
+ /* 99*/ { BARCODE_UPCE_CC, GS1RAW_MODE, -1, "123456", "2012", 0, "01234565", "" },
+ /*100*/ { BARCODE_UPCE_CC, -1, BARCODE_CONTENT_SEGS, "123456", "[20]12", 0, "01234565", "0012345000065|2012" },
+ /*101*/ { BARCODE_UPCE_CC, -1, BARCODE_CONTENT_SEGS, "123456", "^2012", 0, "01234565", "0012345000065|2012" },
+ /*102*/ { BARCODE_UPCE_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "123456", "2012", 0, "01234565", "0012345000065|2012" },
+ /*103*/ { BARCODE_UPCE_CC, -1, -1, "1234567", "[20]12", 0, "12345670", "" },
+ /*104*/ { BARCODE_UPCE_CC, -1, -1, "12345670", "[20]12", 0, "12345670", "" },
+ /*105*/ { BARCODE_UPCE_CC, -1, -1, "12345671", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" },
+ /*106*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, "12345671", "[20]12", ZINT_ERROR_INVALID_CHECK, "", "" }, /* Still checked */
+ /*107*/ { BARCODE_UPCE_CC, -1, -1, "12345670", "[20]12", 0, "12345670", "" }, /* Check digit can now be given for UPCE_CC, like UPCA_CC */
+ /*108*/ { BARCODE_UPCE_CC, -1, -1, "1234567", "[20]1A", ZINT_ERROR_INVALID_DATA, "", "" }, /* AI (20) should be 2 nos. */
+ /*109*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, "1234567", "[20]1A", 0, "12345670", "" },
+ /*110*/ { BARCODE_UPCE_CC, -1, BARCODE_CONTENT_SEGS, "1234567+2", "[20]12", 0, "12345670+02", "012345600007002|2012" },
+ /*111*/ { BARCODE_DBAR_STK_CC, -1, -1, "12345678901231", "[20]12", 0, "", "" }, /* No HRT for stacked symbologies */
+ /*112*/ { BARCODE_DBAR_STK_CC, -1, -1, "12345678901231", "^2012", 0, "", "" }, /* No HRT for stacked symbologies */
+ /*113*/ { BARCODE_DBAR_STK_CC, GS1RAW_MODE, -1, "12345678901231", "2012", 0, "", "" }, /* No HRT for stacked symbologies */
+ /*114*/ { BARCODE_DBAR_STK_CC, -1, BARCODE_CONTENT_SEGS, "12345678901231", "[20]12", 0, "", "0112345678901231|2012" }, /* But have content segs */
+ /*115*/ { BARCODE_DBAR_STK_CC, -1, BARCODE_CONTENT_SEGS, "12345678901231", "^2012", 0, "", "0112345678901231|2012" }, /* But have content segs */
+ /*116*/ { BARCODE_DBAR_STK_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "12345678901231", "2012", 0, "", "0112345678901231|2012" }, /* But have content segs */
+ /*117*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, "12345678901231", "[20]12", 0, "", "" },
+ /*118*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, "12345678901231", "^2012", 0, "", "" },
+ /*119*/ { BARCODE_DBAR_OMNSTK_CC, GS1RAW_MODE, -1, "12345678901231", "2012", 0, "", "" },
+ /*120*/ { BARCODE_DBAR_OMNSTK_CC, -1, BARCODE_CONTENT_SEGS, "12345678901231", "[20]12", 0, "", "0112345678901231|2012" },
+ /*121*/ { BARCODE_DBAR_OMNSTK_CC, -1, BARCODE_CONTENT_SEGS, "12345678901231", "^2012", 0, "", "0112345678901231|2012" },
+ /*122*/ { BARCODE_DBAR_OMNSTK_CC, GS1RAW_MODE, BARCODE_CONTENT_SEGS, "12345678901231", "2012", 0, "", "0112345678901231|2012" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, composite_length, ret;
@@ -465,68 +658,169 @@ static void test_gs1_verify(const testCtx *const p_ctx) {
};
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
- /* 0*/ { BARCODE_GS1_128, -1, "", ZINT_ERROR_INVALID_DATA, "", "264: Data does not start with an AI" },
- /* 1*/ { BARCODE_GS1_128, -1, "A", ZINT_ERROR_INVALID_DATA, "", "264: Data does not start with an AI" },
- /* 2*/ { BARCODE_GS1_128, -1, "[", ZINT_ERROR_INVALID_DATA, "", "268: Failed to parse AI data" },
- /* 3*/ { BARCODE_GS1_128, -1, "[]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: " },
- /* 4*/ { BARCODE_GS1_128, -1, "[1]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 1" },
- /* 5*/ { BARCODE_GS1_128, -1, "[242]123456[1]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 1" },
- /* 6*/ { BARCODE_GS1_128, -1, "[12345]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 12345" },
- /* 7*/ { BARCODE_GS1_128, -1, "[9999]1234", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 9999" },
- /* 8*/ { BARCODE_GS1_128, -1, "[[01]]1234", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: (01" },
- /* 9*/ { BARCODE_GS1_128, GS1PARENS_MODE, "((01))1234", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: (01" },
- /* 10*/ { BARCODE_GS1_128, -1, "[1A]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 1A" },
- /* 11*/ { BARCODE_GS1_128, -1, "[10]", ZINT_ERROR_INVALID_DATA, "", "268: Failed to parse AI data" },
- /* 12*/ { BARCODE_GS1_128, -1, "[90]\012", ZINT_ERROR_INVALID_DATA, "", "267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)|\\x0A|" },
- /* 13*/ { BARCODE_GS1_128, -1, "[00]123456789012345678", ZINT_ERROR_INVALID_DATA, "", "267: AI (00): The numeric check digit is incorrect. (00)12345678901234567|8|" },
- /* 14*/ { BARCODE_GS1_128, -1, "[00]123456789012345675", 0, "00123456789012345675", "" },
- /* 15*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(00)123456789012345675", 0, "00123456789012345675", "" },
- /* 16*/ { BARCODE_GS1_128, -1, "[00]12345678901234567", ZINT_ERROR_INVALID_DATA, "", "268: AI (00) value is too short" },
- /* 17*/ { BARCODE_GS1_128, -1, "[00]1234567890123456789", ZINT_ERROR_INVALID_DATA, "", "268: AI (00) value is too long" },
- /* 18*/ { BARCODE_GS1_128, -1, "[3910]123123456789012345", ZINT_ERROR_INVALID_DATA, "", "267: AI (3910): A valid ISO 4217 three-digit currency code is required. (3910)|123|" },
- /* 19*/ { BARCODE_GS1_128, -1, "[3910]997123456789012345", 0, "3910997123456789012345", "" },
- /* 20*/ { BARCODE_DBAR_EXP, -1, "[3910]997123456789012345", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (3910) are not satisfied: 8020" },
- /* 21*/ { BARCODE_GS1_128, -1, "[3910]997123456789012345[8020]REF123", 0, "3910997123456789012345\0358020REF123", "" },
- /* 22*/ { BARCODE_DBAR_EXP, -1, "[3910]997123456789012345[8020]REF123", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8020) are not satisfied: 415" },
- /* 23*/ { BARCODE_GS1_128, -1, "[3910]997123456789012345[8020]REF123[415]1234567890123", ZINT_ERROR_INVALID_DATA, "", "267: AI (415): The numeric check digit is incorrect. (415)123456789012|3|" },
- /* 24*/ { BARCODE_GS1_128, -1, "[3910]997123456789012345[8020]REF123[415]1234567890128", 0, "3910997123456789012345\0358020REF123\0354151234567890128", "" },
- /* 25*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(3910)997123456789012345(8020)REF123(415)1234567890128", 0, "3910997123456789012345\0358020REF123\0354151234567890128", "" },
- /* 26*/ { BARCODE_GS1_128, -1, "[402]13131313131313132", ZINT_ERROR_INVALID_DATA, "", "267: AI (402): The numeric check digit is incorrect. (402)1313131313131313|2|" },
- /* 27*/ { BARCODE_GS1_128, -1, "[402]13131313131313130", 0, "40213131313131313130", "" },
- /* 28*/ { BARCODE_GS1_128, -1, "[4309]1234567890123456789A", ZINT_ERROR_INVALID_DATA, "", "267: AI (4309): A non-digit character was found where a digit is expected. (4309)1234567890123456789|A|" },
- /* 29*/ { BARCODE_GS1_128, -1, "[7006]200132", ZINT_ERROR_INVALID_DATA, "", "267: AI (7006): The date contains an illegal day of the month. (7006)2001|32|" },
- /* 30*/ { BARCODE_GS1_128, -1, "[7006]200131", 0, "7006200131", "" },
- /* 31*/ { BARCODE_AZTEC, GS1_MODE, "[7006]200131", ZINT_ERROR_INVALID_DATA, "7006200131", "268: Required AIs for AI (7006) are not satisfied: 01,02" },
- /* 32*/ { BARCODE_GS1_128, -1, "[7006]200131[01]12345678901231", 0, "7006200131\0350112345678901231", "" },
- /* 33*/ { BARCODE_GS1_128, -1, "[8001]12345678901234", ZINT_ERROR_INVALID_DATA, "", "267: AI (8001): The winding direction must be either \"0\", \"1\" or \"9\". (8001)123456789012|3|" },
- /* 34*/ { BARCODE_GS1_128, -1, "[8001]12345678901294", 0, "800112345678901294", "" },
- /* 35*/ { BARCODE_QRCODE, GS1_MODE, "[8001]12345678901294", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8001) are not satisfied: 01" },
- /* 36*/ { BARCODE_GS1_128, -1, "[8001]12345678901294[01]12345678901231", 0, "800112345678901294\0350112345678901231", "" },
- /* 37*/ { BARCODE_GS1_128, -1, "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_ERROR_INVALID_DATA, "", "267: AI (8004): The GS1 Company Prefix is invalid. (8004)|a|bcdefghijklmnopqrstuvwxyz1234" },
- /* 38*/ { BARCODE_GS1_128, -1, "[8004]123", ZINT_ERROR_INVALID_DATA, "", "267: AI (8004): The component is shorter than the minimum length GS1 Company Prefix. (8004)|123|" },
- /* 39*/ { BARCODE_GS1_128, -1, "[8004]1234efghijklmnopqrstuvwxyz1234", 0, "80041234efghijklmnopqrstuvwxyz1234", "" },
- /* 40*/ { BARCODE_GS1_128, -1, "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_ERROR_INVALID_DATA, "", "267: AI (8007): The IBAN must start with a valid ISO 3166 two-character country code. (8007)|ab|cdefghijklmnopqrstuvwxyz12345678" },
- /* 41*/ { BARCODE_GS1_128, -1, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", "" },
- /* 42*/ { BARCODE_DATAMATRIX, GS1_MODE, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8007) are not satisfied: 415" },
- /* 43*/ { BARCODE_GS1_128, -1, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678[415]1234567890128", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\0354151234567890128", "" },
- /* 44*/ { BARCODE_PDF417, GS1_MODE, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678[415]1234567890128", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (415) are not satisfied: 8020" },
- /* 45*/ { BARCODE_GS1_128, -1, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678[415]1234567890128[8020]REF123", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\03541512345678901288020REF123", "" },
- /* 46*/ { BARCODE_GS1_128, -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXY^", ZINT_ERROR_INVALID_DATA, "", "268: AI (8030) contains illegal ^ character" },
- /* 47*/ { BARCODE_GS1_128, -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", "" },
- /* 48*/ { BARCODE_DBAR_EXP, -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8030) are not satisfied: 00,01+21,253,255,8003,8004,8006+21,8010+8011,8017,8018" },
- /* 49*/ { BARCODE_GS1_128, -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ[8018]123456789012345675", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ\0358018123456789012345675", "" },
- /* 50*/ { BARCODE_GS1_128, -1, "[01]12345678901234[7006]200101", ZINT_ERROR_INVALID_DATA, "", "267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
- /* 51*/ { BARCODE_GS1_128, -1, "[01]12345678901231[7006]200101", 0, "01123456789012317006200101", "" },
- /* 52*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284\0350112345678901231390112345678901234\0352012", "" },
- /* 53*/ { BARCODE_AZTEC, GS1_MODE, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (3901) are not satisfied: 255,8020" },
- /* 54*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[255]1234567890128", ZINT_ERROR_INVALID_DATA, "", "268: It is invalid to pair AI (01) with AI (255)" },
- /* 55*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[8020]REF123", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123", "" },
- /* 56*/ { BARCODE_DATAMATRIX, GS1_MODE, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[8020]REF123", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8020) are not satisfied: 415" },
- /* 57*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[8020]REF123[415]1234567890128", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123\0354151234567890128", "" },
- /* 58*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[8020]REF123[415]1234567890128[90]123", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123\035415123456789012890123", "" },
- /* 59*/ { BARCODE_GS1_128, -1, "[8001]12345678901294[01]12345678901231|[8012]VER1", 0, "800112345678901294\0350112345678901231|8012VER1", "" }, /* Composite */
- /* 60*/ { BARCODE_GS1_128, -1, "[8001]12345678901294[01]12345678901231[415]1234567890128|[8020]ABCDEFGHIJKLMNOPQRSTUVXWY", 0, "800112345678901294\03501123456789012314151234567890128|8020ABCDEFGHIJKLMNOPQRSTUVXWY", "" },
- /* 61*/ { BARCODE_GS1_128, -1, "[8001]12345678901294[01]12345678901231|[415]1234567890128[8020]ABCDEFGHIJKLMNOPQRSTUVXWY", 0, "800112345678901294\0350112345678901231|41512345678901288020ABCDEFGHIJKLMNOPQRSTUVXWY", "" },
+ /* 0*/ { BARCODE_GS1_128, -1, "", ZINT_ERROR_INVALID_DATA, "", "802: Data does not start with an AI" },
+ /* 1*/ { BARCODE_GS1_128, GS1RAW_MODE, "", ZINT_ERROR_INVALID_DATA, "", "802: Data does not start with an AI" },
+ /* 2*/ { BARCODE_GS1_128, -1, "A", ZINT_ERROR_INVALID_DATA, "", "802: Data does not start with an AI" },
+ /* 3*/ { BARCODE_GS1_128, -1, "^A", ZINT_ERROR_INVALID_DATA, "", "802: Data does not start with an AI" },
+ /* 4*/ { BARCODE_GS1_128, GS1RAW_MODE, "A", ZINT_ERROR_INVALID_DATA, "", "802: Data does not start with an AI" },
+ /* 5*/ { BARCODE_GS1_128, -1, "[", ZINT_ERROR_INVALID_DATA, "", "802: Data does not start with an AI" },
+ /* 6*/ { BARCODE_GS1_128, -1, "^", ZINT_ERROR_INVALID_DATA, "", "802: Data does not start with an AI" },
+ /* 7*/ { BARCODE_GS1_128, -1, "[]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: " },
+ /* 8*/ { BARCODE_GS1_128, -1, "^^12", ZINT_ERROR_INVALID_DATA, "", "268: No known AI is a prefix of: ^12..." },
+ /* 9*/ { BARCODE_GS1_128, -1, "[1]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 1" },
+ /* 10*/ { BARCODE_GS1_128, -1, "^1^12", ZINT_ERROR_INVALID_DATA, "", "268: No known AI is a prefix of: 1^12..." },
+ /* 11*/ { BARCODE_GS1_128, -1, "[242]123456[1]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 1" },
+ /* 12*/ { BARCODE_GS1_128, -1, "^242123456^112", ZINT_ERROR_INVALID_DATA, "", "268: AI (11) data has incorrect length" },
+ /* 13*/ { BARCODE_GS1_128, GS1RAW_MODE, "242123456\035112", ZINT_ERROR_INVALID_DATA, "", "268: AI (11) data has incorrect length" },
+ /* 14*/ { BARCODE_GS1_128, -1, "[242]123456[1]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 1" },
+ /* 15*/ { BARCODE_GS1_128, -1, "[12345]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 12345" },
+ /* 16*/ { BARCODE_GS1_128, -1, "^1234512", ZINT_ERROR_INVALID_DATA, "", "268: AI (12) data has incorrect length" },
+ /* 17*/ { BARCODE_GS1_128, GS1RAW_MODE, "1234512", ZINT_ERROR_INVALID_DATA, "", "268: AI (12) data has incorrect length" },
+ /* 18*/ { BARCODE_GS1_128, -1, "[9999]1234", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 9999" },
+ /* 19*/ { BARCODE_GS1_128, -1, "^99991234", 0, "99991234", "" },
+ /* 20*/ { BARCODE_GS1_128, GS1RAW_MODE, "99991234", 0, "99991234", "" },
+ /* 21*/ { BARCODE_GS1_128, -1, "[[01]]1234", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: (01" },
+ /* 22*/ { BARCODE_GS1_128, GS1PARENS_MODE, "((01))1234", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: (01" },
+ /* 23*/ { BARCODE_GS1_128, -1, "[1A]12", ZINT_ERROR_INVALID_DATA, "", "268: Unrecognised AI: 1A" },
+ /* 24*/ { BARCODE_GS1_128, -1, "^1A12", ZINT_ERROR_INVALID_DATA, "", "268: No known AI is a prefix of: 1A12..." },
+ /* 25*/ { BARCODE_GS1_128, GS1RAW_MODE, "1A12", ZINT_ERROR_INVALID_DATA, "", "268: No known AI is a prefix of: 1A12..." },
+ /* 26*/ { BARCODE_GS1_128, -1, "[10]", ZINT_ERROR_INVALID_DATA, "", "268: Failed to parse AI data" },
+ /* 27*/ { BARCODE_GS1_128, -1, "^10", ZINT_ERROR_INVALID_DATA, "", "268: AI (10) data is empty" },
+ /* 28*/ { BARCODE_GS1_128, GS1RAW_MODE, "10", ZINT_ERROR_INVALID_DATA, "", "268: AI (10) data is empty" },
+ /* 29*/ { BARCODE_GS1_128, -1, "[90]\012", ZINT_ERROR_INVALID_DATA, "", "267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)|\\x0A|" },
+ /* 30*/ { BARCODE_GS1_128, -1, "^90\012", ZINT_ERROR_INVALID_DATA, "", "267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)|\\x0A|" },
+ /* 31*/ { BARCODE_GS1_128, GS1RAW_MODE, "90\012", ZINT_ERROR_INVALID_DATA, "", "267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)|\\x0A|" },
+ /* 32*/ { BARCODE_GS1_128, -1, "[00]123456789012345678", ZINT_ERROR_INVALID_DATA, "", "267: AI (00): The numeric check digit is incorrect. (00)12345678901234567|8|" },
+ /* 33*/ { BARCODE_GS1_128, -1, "^00123456789012345678", ZINT_ERROR_INVALID_DATA, "", "267: AI (00): The numeric check digit is incorrect. (00)12345678901234567|8|" },
+ /* 34*/ { BARCODE_GS1_128, GS1RAW_MODE, "00123456789012345678", ZINT_ERROR_INVALID_DATA, "", "267: AI (00): The numeric check digit is incorrect. (00)12345678901234567|8|" },
+ /* 35*/ { BARCODE_GS1_128, -1, "[00]123456789012345675", 0, "00123456789012345675", "" },
+ /* 36*/ { BARCODE_GS1_128, -1, "^00123456789012345675", 0, "00123456789012345675", "" },
+ /* 37*/ { BARCODE_GS1_128, GS1RAW_MODE, "00123456789012345675", 0, "00123456789012345675", "" },
+ /* 38*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(00)123456789012345675", 0, "00123456789012345675", "" },
+ /* 39*/ { BARCODE_GS1_128, -1, "[00]12345678901234567", ZINT_ERROR_INVALID_DATA, "", "268: AI (00) value is too short" },
+ /* 40*/ { BARCODE_GS1_128, -1, "^0012345678901234567", ZINT_ERROR_INVALID_DATA, "", "268: AI (00) data has incorrect length" },
+ /* 41*/ { BARCODE_GS1_128, GS1RAW_MODE, "0012345678901234567", ZINT_ERROR_INVALID_DATA, "", "268: AI (00) data has incorrect length" },
+ /* 42*/ { BARCODE_GS1_128, -1, "[00]1234567890123456789", ZINT_ERROR_INVALID_DATA, "", "268: AI (00) value is too long" },
+ /* 43*/ { BARCODE_GS1_128, -1, "^001234567890123456789", ZINT_ERROR_INVALID_DATA, "", "267: AI (00): The numeric check digit is incorrect. (00)12345678901234567|8|" },
+ /* 44*/ { BARCODE_GS1_128, GS1RAW_MODE, "001234567890123456789", ZINT_ERROR_INVALID_DATA, "", "267: AI (00): The numeric check digit is incorrect. (00)12345678901234567|8|" },
+ /* 45*/ { BARCODE_GS1_128, -1, "[3910]123123456789012345", ZINT_ERROR_INVALID_DATA, "", "267: AI (3910): A valid ISO 4217 three-digit currency code is required. (3910)|123|" },
+ /* 46*/ { BARCODE_GS1_128, -1, "^3910123123456789012345", ZINT_ERROR_INVALID_DATA, "", "267: AI (3910): A valid ISO 4217 three-digit currency code is required. (3910)|123|" },
+ /* 47*/ { BARCODE_GS1_128, GS1RAW_MODE, "3910123123456789012345", ZINT_ERROR_INVALID_DATA, "", "267: AI (3910): A valid ISO 4217 three-digit currency code is required. (3910)|123|" },
+ /* 48*/ { BARCODE_GS1_128, -1, "[3910]997123456789012345", 0, "3910997123456789012345", "" },
+ /* 49*/ { BARCODE_GS1_128, -1, "^3910997123456789012345", 0, "3910997123456789012345", "" },
+ /* 50*/ { BARCODE_GS1_128, GS1RAW_MODE, "3910997123456789012345", 0, "3910997123456789012345", "" },
+ /* 51*/ { BARCODE_DBAR_EXP, -1, "[3910]997123456789012345", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (3910) are not satisfied: 8020" },
+ /* 52*/ { BARCODE_DBAR_EXP, -1, "^3910997123456789012345", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (3910) are not satisfied: 8020" },
+ /* 53*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, "3910997123456789012345", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (3910) are not satisfied: 8020" },
+ /* 54*/ { BARCODE_GS1_128, -1, "[3910]997123456789012345[8020]REF123", 0, "3910997123456789012345\0358020REF123", "" },
+ /* 55*/ { BARCODE_GS1_128, -1, "^3910997123456789012345^8020REF123", 0, "3910997123456789012345\0358020REF123", "" },
+ /* 56*/ { BARCODE_GS1_128, GS1RAW_MODE, "3910997123456789012345\0358020REF123", 0, "3910997123456789012345\0358020REF123", "" },
+ /* 57*/ { BARCODE_DBAR_EXP, -1, "[3910]997123456789012345[8020]REF123", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8020) are not satisfied: 415" },
+ /* 58*/ { BARCODE_DBAR_EXP, -1, "^3910997123456789012345^8020REF123", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8020) are not satisfied: 415" },
+ /* 59*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, "3910997123456789012345\0358020REF123", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8020) are not satisfied: 415" },
+ /* 60*/ { BARCODE_GS1_128, -1, "[3910]997123456789012345[8020]REF123[415]1234567890123", ZINT_ERROR_INVALID_DATA, "", "267: AI (415): The numeric check digit is incorrect. (415)123456789012|3|" },
+ /* 61*/ { BARCODE_GS1_128, -1, "^3910997123456789012345^8020REF123^4151234567890123", ZINT_ERROR_INVALID_DATA, "", "267: AI (415): The numeric check digit is incorrect. (415)123456789012|3|" },
+ /* 62*/ { BARCODE_GS1_128, GS1RAW_MODE, "3910997123456789012345\0358020REF123\0354151234567890123", ZINT_ERROR_INVALID_DATA, "", "267: AI (415): The numeric check digit is incorrect. (415)123456789012|3|" },
+ /* 63*/ { BARCODE_GS1_128, -1, "[3910]997123456789012345[8020]REF123[415]1234567890128", 0, "3910997123456789012345\0358020REF123\0354151234567890128", "" },
+ /* 64*/ { BARCODE_GS1_128, -1, "^3910997123456789012345^8020REF123^4151234567890128", 0, "3910997123456789012345\0358020REF123\0354151234567890128", "" },
+ /* 65*/ { BARCODE_GS1_128, GS1RAW_MODE, "3910997123456789012345\0358020REF123\0354151234567890128", 0, "3910997123456789012345\0358020REF123\0354151234567890128", "" },
+ /* 66*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(3910)997123456789012345(8020)REF123(415)1234567890128", 0, "3910997123456789012345\0358020REF123\0354151234567890128", "" },
+ /* 67*/ { BARCODE_GS1_128, GS1PARENS_MODE, "^3910997123456789012345^8020REF123^4151234567890128", 0, "3910997123456789012345\0358020REF123\0354151234567890128", "" },
+ /* 68*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1RAW_MODE, "3910997123456789012345\0358020REF123\0354151234567890128", 0, "3910997123456789012345\0358020REF123\0354151234567890128", "" },
+ /* 69*/ { BARCODE_GS1_128, -1, "[402]13131313131313132", ZINT_ERROR_INVALID_DATA, "", "267: AI (402): The numeric check digit is incorrect. (402)1313131313131313|2|" },
+ /* 70*/ { BARCODE_GS1_128, -1, "^40213131313131313132", ZINT_ERROR_INVALID_DATA, "", "267: AI (402): The numeric check digit is incorrect. (402)1313131313131313|2|" },
+ /* 71*/ { BARCODE_GS1_128, GS1RAW_MODE, "40213131313131313132", ZINT_ERROR_INVALID_DATA, "", "267: AI (402): The numeric check digit is incorrect. (402)1313131313131313|2|" },
+ /* 72*/ { BARCODE_GS1_128, -1, "[402]13131313131313130", 0, "40213131313131313130", "" },
+ /* 73*/ { BARCODE_GS1_128, -1, "^40213131313131313130", 0, "40213131313131313130", "" },
+ /* 74*/ { BARCODE_GS1_128, GS1RAW_MODE, "40213131313131313130", 0, "40213131313131313130", "" },
+ /* 75*/ { BARCODE_GS1_128, -1, "[4309]1234567890123456789A", ZINT_ERROR_INVALID_DATA, "", "267: AI (4309): A non-digit character was found where a digit is expected. (4309)1234567890123456789|A|" },
+ /* 76*/ { BARCODE_GS1_128, -1, "^43091234567890123456789A", ZINT_ERROR_INVALID_DATA, "", "267: AI (4309): A non-digit character was found where a digit is expected. (4309)1234567890123456789|A|" },
+ /* 77*/ { BARCODE_GS1_128, GS1RAW_MODE, "43091234567890123456789A", ZINT_ERROR_INVALID_DATA, "", "267: AI (4309): A non-digit character was found where a digit is expected. (4309)1234567890123456789|A|" },
+ /* 78*/ { BARCODE_GS1_128, -1, "[7006]200132", ZINT_ERROR_INVALID_DATA, "", "267: AI (7006): The date contains an illegal day of the month. (7006)2001|32|" },
+ /* 79*/ { BARCODE_GS1_128, -1, "^7006200132", ZINT_ERROR_INVALID_DATA, "", "267: AI (7006): The date contains an illegal day of the month. (7006)2001|32|" },
+ /* 80*/ { BARCODE_GS1_128, GS1RAW_MODE, "7006200132", ZINT_ERROR_INVALID_DATA, "", "267: AI (7006): The date contains an illegal day of the month. (7006)2001|32|" },
+ /* 81*/ { BARCODE_GS1_128, -1, "[7006]200131", 0, "7006200131", "" },
+ /* 82*/ { BARCODE_GS1_128, -1, "^7006200131", 0, "7006200131", "" },
+ /* 83*/ { BARCODE_GS1_128, GS1RAW_MODE, "7006200131", 0, "7006200131", "" },
+ /* 84*/ { BARCODE_AZTEC, GS1_MODE, "[7006]200131", ZINT_ERROR_INVALID_DATA, "7006200131", "268: Required AIs for AI (7006) are not satisfied: 01,02" },
+ /* 85*/ { BARCODE_AZTEC, GS1_MODE, "^7006200131", ZINT_ERROR_INVALID_DATA, "7006200131", "268: Required AIs for AI (7006) are not satisfied: 01,02" },
+ /* 86*/ { BARCODE_AZTEC, GS1_MODE | GS1RAW_MODE, "7006200131", ZINT_ERROR_INVALID_DATA, "7006200131", "268: Required AIs for AI (7006) are not satisfied: 01,02" },
+ /* 87*/ { BARCODE_GS1_128, -1, "[7006]200131[01]12345678901231", 0, "7006200131\0350112345678901231", "" },
+ /* 88*/ { BARCODE_GS1_128, -1, "^7006200131^0112345678901231", 0, "7006200131\0350112345678901231", "" },
+ /* 89*/ { BARCODE_GS1_128, GS1RAW_MODE, "7006200131\0350112345678901231", 0, "7006200131\0350112345678901231", "" },
+ /* 90*/ { BARCODE_GS1_128, -1, "[8001]12345678901234", ZINT_ERROR_INVALID_DATA, "", "267: AI (8001): The winding direction must be either \"0\", \"1\" or \"9\". (8001)123456789012|3|" },
+ /* 91*/ { BARCODE_GS1_128, -1, "^800112345678901234", ZINT_ERROR_INVALID_DATA, "", "267: AI (8001): The winding direction must be either \"0\", \"1\" or \"9\". (8001)123456789012|3|" },
+ /* 92*/ { BARCODE_GS1_128, GS1RAW_MODE, "800112345678901234", ZINT_ERROR_INVALID_DATA, "", "267: AI (8001): The winding direction must be either \"0\", \"1\" or \"9\". (8001)123456789012|3|" },
+ /* 93*/ { BARCODE_GS1_128, -1, "[8001]12345678901294", 0, "800112345678901294", "" },
+ /* 94*/ { BARCODE_GS1_128, -1, "^800112345678901294", 0, "800112345678901294", "" },
+ /* 95*/ { BARCODE_GS1_128, GS1RAW_MODE, "800112345678901294", 0, "800112345678901294", "" },
+ /* 96*/ { BARCODE_QRCODE, GS1_MODE, "[8001]12345678901294", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8001) are not satisfied: 01" },
+ /* 97*/ { BARCODE_QRCODE, GS1_MODE, "^800112345678901294", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8001) are not satisfied: 01" },
+ /* 98*/ { BARCODE_QRCODE, GS1_MODE | GS1RAW_MODE, "800112345678901294", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8001) are not satisfied: 01" },
+ /* 99*/ { BARCODE_GS1_128, -1, "[8001]12345678901294[01]12345678901231", 0, "800112345678901294\0350112345678901231", "" },
+ /*100*/ { BARCODE_GS1_128, -1, "^800112345678901294^0112345678901231", 0, "800112345678901294\0350112345678901231", "" },
+ /*101*/ { BARCODE_GS1_128, GS1RAW_MODE, "800112345678901294\0350112345678901231", 0, "800112345678901294\0350112345678901231", "" },
+ /*102*/ { BARCODE_GS1_128, -1, "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_ERROR_INVALID_DATA, "", "267: AI (8004): The GS1 Company Prefix is invalid. (8004)|a|bcdefghijklmnopqrstuvwxyz1234" },
+ /*103*/ { BARCODE_GS1_128, -1, "^8004abcdefghijklmnopqrstuvwxyz1234", ZINT_ERROR_INVALID_DATA, "", "267: AI (8004): The GS1 Company Prefix is invalid. (8004)|a|bcdefghijklmnopqrstuvwxyz1234" },
+ /*104*/ { BARCODE_GS1_128, GS1RAW_MODE, "8004abcdefghijklmnopqrstuvwxyz1234", ZINT_ERROR_INVALID_DATA, "", "267: AI (8004): The GS1 Company Prefix is invalid. (8004)|a|bcdefghijklmnopqrstuvwxyz1234" },
+ /*105*/ { BARCODE_GS1_128, -1, "[8004]123", ZINT_ERROR_INVALID_DATA, "", "267: AI (8004): The component is shorter than the minimum length GS1 Company Prefix. (8004)|123|" },
+ /*106*/ { BARCODE_GS1_128, -1, "^8004123", ZINT_ERROR_INVALID_DATA, "", "267: AI (8004): The component is shorter than the minimum length GS1 Company Prefix. (8004)|123|" },
+ /*107*/ { BARCODE_GS1_128, GS1RAW_MODE, "8004123", ZINT_ERROR_INVALID_DATA, "", "267: AI (8004): The component is shorter than the minimum length GS1 Company Prefix. (8004)|123|" },
+ /*108*/ { BARCODE_GS1_128, -1, "[8004]1234efghijklmnopqrstuvwxyz1234", 0, "80041234efghijklmnopqrstuvwxyz1234", "" },
+ /*109*/ { BARCODE_GS1_128, -1, "^80041234efghijklmnopqrstuvwxyz1234", 0, "80041234efghijklmnopqrstuvwxyz1234", "" },
+ /*110*/ { BARCODE_GS1_128, GS1RAW_MODE, "80041234efghijklmnopqrstuvwxyz1234", 0, "80041234efghijklmnopqrstuvwxyz1234", "" },
+ /*111*/ { BARCODE_GS1_128, -1, "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_ERROR_INVALID_DATA, "", "267: AI (8007): The IBAN must start with a valid ISO 3166 two-character country code. (8007)|ab|cdefghijklmnopqrstuvwxyz12345678" },
+ /*112*/ { BARCODE_GS1_128, -1, "^8007abcdefghijklmnopqrstuvwxyz12345678", ZINT_ERROR_INVALID_DATA, "", "267: AI (8007): The IBAN must start with a valid ISO 3166 two-character country code. (8007)|ab|cdefghijklmnopqrstuvwxyz12345678" },
+ /*113*/ { BARCODE_GS1_128, GS1RAW_MODE, "8007abcdefghijklmnopqrstuvwxyz12345678", ZINT_ERROR_INVALID_DATA, "", "267: AI (8007): The IBAN must start with a valid ISO 3166 two-character country code. (8007)|ab|cdefghijklmnopqrstuvwxyz12345678" },
+ /*114*/ { BARCODE_GS1_128, -1, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", "" },
+ /*115*/ { BARCODE_GS1_128, -1, "^8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", "" },
+ /*116*/ { BARCODE_GS1_128, GS1RAW_MODE, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", "" },
+ /*117*/ { BARCODE_DATAMATRIX, GS1_MODE, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8007) are not satisfied: 415" },
+ /*118*/ { BARCODE_DATAMATRIX, GS1_MODE, "^8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8007) are not satisfied: 415" },
+ /*119*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1RAW_MODE, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8007) are not satisfied: 415" },
+ /*120*/ { BARCODE_GS1_128, -1, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678[415]1234567890128", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\0354151234567890128", "" },
+ /*121*/ { BARCODE_GS1_128, -1, "^8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678^4151234567890128", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\0354151234567890128", "" },
+ /*122*/ { BARCODE_GS1_128, GS1RAW_MODE, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\0354151234567890128", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\0354151234567890128", "" },
+ /*123*/ { BARCODE_GS1_128, -1, "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678[415]1234567890128[8020]REF123", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\03541512345678901288020REF123", "" },
+ /*124*/ { BARCODE_GS1_128, -1, "^8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678^41512345678901288020REF123", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\03541512345678901288020REF123", "" },
+ /*125*/ { BARCODE_GS1_128, GS1RAW_MODE, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\03541512345678901288020REF123", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678\03541512345678901288020REF123", "" },
+ /*126*/ { BARCODE_GS1_128, -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXY^", ZINT_ERROR_INVALID_DATA, "", "268: AI (8030) contains illegal ^ character" },
+ /*127*/ { BARCODE_GS1_128, -1, "^8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXY^", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXY\035", "" }, /* (Redundant) caret at end encoded */
+ /*128*/ { BARCODE_GS1_128, GS1RAW_MODE, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXY^", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXY\035", "" }, /* Caret at end encoded as GS */
+ /*129*/ { BARCODE_GS1_128, -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", "" },
+ /*130*/ { BARCODE_GS1_128, -1, "^8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", "" },
+ /*131*/ { BARCODE_GS1_128, GS1RAW_MODE, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", "" },
+ /*132*/ { BARCODE_DBAR_EXP, -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8030) are not satisfied: 00,01+21,253,255,8003,8004,8006+21,8010+8011,8017,8018" },
+ /*133*/ { BARCODE_DBAR_EXP, -1, "^8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8030) are not satisfied: 00,01+21,253,255,8003,8004,8006+21,8010+8011,8017,8018" },
+ /*134*/ { BARCODE_DBAR_EXP, GS1RAW_MODE, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8030) are not satisfied: 00,01+21,253,255,8003,8004,8006+21,8010+8011,8017,8018" },
+ /*135*/ { BARCODE_GS1_128, -1, "[8030]-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ[8018]123456789012345675", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ\0358018123456789012345675", "" },
+ /*136*/ { BARCODE_GS1_128, -1, "^8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ^8018123456789012345675", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ\0358018123456789012345675", "" },
+ /*137*/ { BARCODE_GS1_128, GS1RAW_MODE, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ\0358018123456789012345675", 0, "8030-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ\0358018123456789012345675", "" },
+ /*138*/ { BARCODE_GS1_128, -1, "[01]12345678901234[7006]200101", ZINT_ERROR_INVALID_DATA, "", "267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*139*/ { BARCODE_GS1_128, -1, "^01123456789012347006200101", ZINT_ERROR_INVALID_DATA, "", "267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*140*/ { BARCODE_GS1_128, GS1RAW_MODE, "01123456789012347006200101", ZINT_ERROR_INVALID_DATA, "", "267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*141*/ { BARCODE_GS1_128, -1, "[01]12345678901231[7006]200101", 0, "01123456789012317006200101", "" },
+ /*142*/ { BARCODE_GS1_128, -1, "^01123456789012317006200101", 0, "01123456789012317006200101", "" },
+ /*143*/ { BARCODE_GS1_128, GS1RAW_MODE, "01123456789012317006200101", 0, "01123456789012317006200101", "" },
+ /*144*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284\0350112345678901231390112345678901234\0352012", "" },
+ /*145*/ { BARCODE_GS1_128, -1, "^25312345678901284^0112345678901231390112345678901234^2012", 0, "25312345678901284\0350112345678901231390112345678901234\0352012", "" },
+ /*146*/ { BARCODE_GS1_128, GS1RAW_MODE, "25312345678901284\0350112345678901231390112345678901234\0352012", 0, "25312345678901284\0350112345678901231390112345678901234\0352012", "" },
+ /*147*/ { BARCODE_AZTEC, GS1_MODE, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (3901) are not satisfied: 255,8020" },
+ /*148*/ { BARCODE_AZTEC, GS1_MODE, "^25312345678901284^0112345678901231390112345678901234^2012", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (3901) are not satisfied: 255,8020" },
+ /*149*/ { BARCODE_AZTEC, GS1_MODE | GS1RAW_MODE, "25312345678901284\0350112345678901231390112345678901234\0352012", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (3901) are not satisfied: 255,8020" },
+ /*150*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[255]1234567890128", ZINT_ERROR_INVALID_DATA, "", "268: It is invalid to pair AI (01) with AI (255)" },
+ /*151*/ { BARCODE_GS1_128, -1, "^25312345678901284^0112345678901231390112345678901234^20122551234567890128", ZINT_ERROR_INVALID_DATA, "", "268: It is invalid to pair AI (01) with AI (255)" },
+ /*152*/ { BARCODE_GS1_128, GS1RAW_MODE, "25312345678901284\0350112345678901231390112345678901234\03520122551234567890128", ZINT_ERROR_INVALID_DATA, "", "268: It is invalid to pair AI (01) with AI (255)" },
+ /*153*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[8020]REF123", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123", "" },
+ /*154*/ { BARCODE_GS1_128, -1, "^25312345678901284^0112345678901231390112345678901234^20128020REF123", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123", "" },
+ /*155*/ { BARCODE_GS1_128, GS1RAW_MODE, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123", "" },
+ /*156*/ { BARCODE_DATAMATRIX, GS1_MODE, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[8020]REF123", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8020) are not satisfied: 415" },
+ /*157*/ { BARCODE_DATAMATRIX, GS1_MODE, "^25312345678901284^0112345678901231390112345678901234^20128020REF123", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8020) are not satisfied: 415" },
+ /*158*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1RAW_MODE, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123", ZINT_ERROR_INVALID_DATA, "", "268: Required AIs for AI (8020) are not satisfied: 415" },
+ /*159*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[8020]REF123[415]1234567890128", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123\0354151234567890128", "" },
+ /*160*/ { BARCODE_GS1_128, -1, "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12[8020]REF123[415]1234567890128[90]123", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123\035415123456789012890123", "" },
+ /*161*/ { BARCODE_GS1_128, -1, "^25312345678901284^0112345678901231390112345678901234^20128020REF123^415123456789012890123", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123\035415123456789012890123", "" },
+ /*162*/ { BARCODE_GS1_128, GS1RAW_MODE, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123\035415123456789012890123", 0, "25312345678901284\0350112345678901231390112345678901234\03520128020REF123\035415123456789012890123", "" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -551,7 +845,7 @@ static void test_gs1_verify(const testCtx *const p_ctx) {
data[i].data, -1, debug);
symbol->input_mode |= GS1SYNTAXENGINE_MODE;
- ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, ZUCP(reduced), &reduced_length);
+ ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, ZUCP(reduced), &reduced_length, 0 /*set_hrt*/);
if (p_ctx->generate) {
printf(" /*%3d*/ { %s, %s, \"%s\", %s, \"%s\", \"%s\" },\n",
@@ -592,29 +886,52 @@ static void test_gs1_digital_link(const testCtx *const p_ctx) {
};
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
- /* 53*/ { -1, "https://", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
- /* 54*/ { -1, "HTTPS://", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
- /* 55*/ { -1, "http://", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
- /* 56*/ { -1, "HTTP://", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
- /* 57*/ { -1, "Https://", ZINT_ERROR_INVALID_DATA, "", "265: Data does not start with an AI or a Digital Link URI" },
- /* 58*/ { -1, "http:/", ZINT_ERROR_INVALID_DATA, "", "265: Data does not start with an AI or a Digital Link URI" },
- /* 59*/ { -1, "https://example.com/123", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
- /* 60*/ { -1, "https://example.com/01/12345678901231", 0, "https://example.com/01/12345678901231", "" },
- /* 61*/ { -1, "https://example.com/gtin/12345678901231", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
- /* 62*/ { -1, "https://example.com/gtin/01/12345678901231", 0, "https://example.com/gtin/01/12345678901231", "" },
- /* 63*/ { -1, "https://example.com/01/12345678901231/90/123", ZINT_ERROR_INVALID_DATA, "", "268: The AIs in the path are not a valid key-qualifier sequence for the key" },
- /* 64*/ { -1, "https://example.com/01/12345678901231/10/123", 0, "https://example.com/01/12345678901231/10/123", "" },
- /* 65*/ { -1, "https://example.com/01/12345678901231/10/12+3", 0, "https://example.com/01/12345678901231/10/12+3", "" },
- /* 66*/ { -1, "https://example.com/01/12345678901231/10/12%2B3", 0, "https://example.com/01/12345678901231/10/12%2B3", "" },
- /* 67*/ { -1, "http://example.com/01/09520123456788/22/2A?linkType=gs1:traceability", 0, "http://example.com/01/09520123456788/22/2A?linkType=gs1:traceability", "" },
- /* 68*/ { -1, "https://example.com/01/12345678901231/10/12?3", 0, "https://example.com/01/12345678901231/10/12?3", "" },
- /* 69*/ { -1, "https://example.com/01/12345678901231/10/12=3", 0, "https://example.com/01/12345678901231/10/12=3", "" },
- /* 70*/ { -1, "https://example.com/01/12345678901231/10/1?2=3", ZINT_ERROR_INVALID_DATA, "", "268: Unknown AI (2) in query parameters" },
- /* 71*/ { -1, "https://example.com/01/12345678901231/10/1%3F2=3", 0, "https://example.com/01/12345678901231/10/1%3F2=3", "" },
- /* 72*/ { -1, "https://example.com/01/12345678901231?3103=000195", 0, "https://example.com/01/12345678901231?3103=000195", "" },
- /* 73*/ { -1, "https://example.com/01/12345678901231|(20)12", ZINT_ERROR_INVALID_DATA, "", "268: URI contains illegal characters" },
- /* 74*/ { -1, "https://example.com/01/12345678901231|", ZINT_ERROR_INVALID_DATA, "", "268: URI contains illegal characters" },
- /* 75*/ { -1, "https://example.com/01/12345678901231(", ZINT_ERROR_INVALID_DATA, "", "268: AI (01) value is too long" },
+ /* 0*/ { -1, "https://", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
+ /* 1*/ { -1, "HTTPS://", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
+ /* 2*/ { -1, "http://", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
+ /* 3*/ { -1, "HTTP://", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
+ /* 4*/ { -1, "Https://", ZINT_ERROR_INVALID_DATA, "", "268: Failed to parse AI data" },
+ /* 5*/ { -1, "https:/", ZINT_ERROR_INVALID_DATA, "", "268: Failed to parse AI data" },
+ /* 6*/ { -1, "http:/", ZINT_ERROR_INVALID_DATA, "", "268: Failed to parse AI data" },
+ /* 7*/ { -1, "http://1", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
+ /* 8*/ { -1, "http:///", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
+ /* 9*/ { -1, "http:///01", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
+ /* 10*/ { -1, "http:///01/", ZINT_ERROR_INVALID_DATA, "", "268: URI must contain a domain and path info" },
+ /* 11*/ { -1, "http://01/", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 12*/ { -1, "http://01/1", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 13*/ { -1, "http://1/", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 14*/ { -1, "http://1/1/", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 15*/ { -1, "http://1/1/1", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 16*/ { -1, "http://1/01/", ZINT_ERROR_INVALID_DATA, "", "268: AI (01) value path element is empty" },
+ /* 17*/ { -1, "http://1/04/", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 18*/ { -1, "http://1/04/1", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 19*/ { -1, "http://1/01/1", ZINT_ERROR_INVALID_DATA, "http://1/01/1234567890123", "268: AI (01) value is too short" },
+ /* 20*/ { -1, "http://1/01/1234567890123", ZINT_ERROR_INVALID_DATA, "", "268: AI (01) value is too short" },
+ /* 21*/ { -1, "http://1/01/12345678901231", 0, "http://1/01/12345678901231", "" },
+ /* 22*/ { -1, "https://example.com/123", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 23*/ { -1, "https://example.com/01/12345678901231", 0, "https://example.com/01/12345678901231", "" },
+ /* 24*/ { -1, "https://example.com/gtin/12345678901231", ZINT_ERROR_INVALID_DATA, "", "268: No GS1 DL keys found in path info" },
+ /* 25*/ { -1, "https://example.com/gtin/01/12345678901231", 0, "https://example.com/gtin/01/12345678901231", "" },
+ /* 26*/ { -1, "https://example.com/01/12345678901231/90/123", ZINT_ERROR_INVALID_DATA, "", "268: The AIs in the path are not a valid key-qualifier sequence for the key" },
+ /* 27*/ { -1, "https://example.com/01/12345678901231?90=123", 0, "https://example.com/01/12345678901231?90=123", "" },
+ /* 28*/ { -1, "https://example.com/01/12345678901231?987=123", ZINT_ERROR_INVALID_DATA, "", "268: Unknown AI (987) in query parameters" },
+ /* 29*/ { -1, "https://example.com/01/12345678901231?12345=123", ZINT_ERROR_INVALID_DATA, "", "268: Unknown AI (12345) in query parameters" },
+ /* 30*/ { -1, "https://example.com/01/12345678901231?mutualParameter=123", 0, "https://example.com/01/12345678901231?mutualParameter=123", "" },
+ /* 31*/ { -1, "https://example.com/01/12345678901231?mutualParamete=123", 0, "https://example.com/01/12345678901231?mutualParamete=123", "" },
+ /* 32*/ { -1, "https://example.com/01/12345678901231?m=123", 0, "https://example.com/01/12345678901231?m=123", "" },
+ /* 33*/ { -1, "https://example.com/01/12345678901231?zyx=123", 0, "https://example.com/01/12345678901231?zyx=123", "" },
+ /* 34*/ { -1, "https://example.com/01/12345678901231/10/123", 0, "https://example.com/01/12345678901231/10/123", "" },
+ /* 35*/ { -1, "https://example.com/01/12345678901231/10/12+3", 0, "https://example.com/01/12345678901231/10/12+3", "" },
+ /* 36*/ { -1, "https://example.com/01/12345678901231/10/12%2B3", 0, "https://example.com/01/12345678901231/10/12%2B3", "" },
+ /* 37*/ { -1, "http://example.com/01/09520123456788/22/2A?linkType=gs1:traceability", 0, "http://example.com/01/09520123456788/22/2A?linkType=gs1:traceability", "" },
+ /* 38*/ { -1, "https://example.com/01/12345678901231/10/12?3", 0, "https://example.com/01/12345678901231/10/12?3", "" },
+ /* 39*/ { -1, "https://example.com/01/12345678901231/10/12=3", 0, "https://example.com/01/12345678901231/10/12=3", "" },
+ /* 40*/ { -1, "https://example.com/01/12345678901231/10/1?2=3", ZINT_ERROR_INVALID_DATA, "", "268: Unknown AI (2) in query parameters" },
+ /* 41*/ { -1, "https://example.com/01/12345678901231/10/1%3F2=3", 0, "https://example.com/01/12345678901231/10/1%3F2=3", "" },
+ /* 42*/ { -1, "https://example.com/01/12345678901231?3103=000195", 0, "https://example.com/01/12345678901231?3103=000195", "" },
+ /* 43*/ { -1, "https://example.com/01/12345678901231|(20)12", ZINT_ERROR_INVALID_DATA, "", "268: URI contains illegal characters" },
+ /* 44*/ { -1, "https://example.com/01/12345678901231|", ZINT_ERROR_INVALID_DATA, "", "268: URI contains illegal characters" },
+ /* 45*/ { -1, "https://example.com/01/12345678901231(", ZINT_ERROR_INVALID_DATA, "", "268: AI (01) value is too long" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -641,7 +958,7 @@ static void test_gs1_digital_link(const testCtx *const p_ctx) {
symbol->input_mode |= data[i].input_mode;
}
- ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, ZUCP(reduced), &reduced_length);
+ ret = zint_gs1_verify(symbol, ZUCP(data[i].data), length, ZUCP(reduced), &reduced_length, 0 /*set_hrt*/);
if (p_ctx->generate) {
printf(" /*%3d*/ { %s, \"%s\", %s, \"%s\", \"%s\" },\n",
@@ -676,133 +993,214 @@ static void test_non_forced(const testCtx *const p_ctx) {
struct item {
int symbology;
- const char *data;
int input_mode;
int output_options;
+ const char *data;
int ret;
+ const char *expected_errtxt;
};
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
- /* 0*/ { BARCODE_AZTEC, "[01]12345678901231", GS1_MODE, -1, 0 },
- /* 1*/ { BARCODE_AZTEC, "(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 2*/ { BARCODE_AZTEC, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 3*/ { BARCODE_AZTEC, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 4*/ { BARCODE_AZTEC, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 5*/ { BARCODE_AZTEC, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 6*/ { BARCODE_AZTEC, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 7*/ { BARCODE_AZTEC, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 8*/ { BARCODE_AZTEC, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 9*/ { BARCODE_AZTEC, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 10*/ { BARCODE_AZTEC, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 11*/ { BARCODE_AZTEC, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 12*/ { BARCODE_AZTEC, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION },
- /* 13*/ { BARCODE_AZTEC, "[01]12345678901231[10]()", GS1_MODE, -1, 0 },
- /* 14*/ { BARCODE_AZTEC, "(01)12345678901231(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 15*/ { BARCODE_AZTEC, "(01)12345678901231(10)\\(\\)", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 16*/ { BARCODE_AZTEC, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 17*/ { BARCODE_AZTEC, "1234", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, ZINT_ERROR_INVALID_DATA }, /* Must still begin with AI */
- /* 18*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION }, /* Codablock-F does not support GS1 */
- /* 19*/ { BARCODE_CODABLOCKF, "[01]12345678901231", GS1_MODE | GS1NOCHECK_MODE, -1, ZINT_ERROR_INVALID_OPTION },
- /* 20*/ { BARCODE_CODABLOCKF, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION },
- /* 21*/ { BARCODE_CODEONE, "[01]12345678901231", GS1_MODE, -1, 0 },
- /* 22*/ { BARCODE_CODEONE, "(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 23*/ { BARCODE_CODEONE, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 24*/ { BARCODE_CODEONE, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 25*/ { BARCODE_CODEONE, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 26*/ { BARCODE_CODEONE, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 27*/ { BARCODE_CODEONE, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 28*/ { BARCODE_CODEONE, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 29*/ { BARCODE_CODEONE, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 30*/ { BARCODE_CODEONE, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 31*/ { BARCODE_CODEONE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 32*/ { BARCODE_CODEONE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 33*/ { BARCODE_CODEONE, "[10]()[01]12345678901231", GS1_MODE, -1, 0 },
- /* 34*/ { BARCODE_CODEONE, "(10)()(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 35*/ { BARCODE_CODEONE, "(10)\\(\\)(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 36*/ { BARCODE_CODEONE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 37*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE, -1, 0 },
- /* 38*/ { BARCODE_CODE16K, "(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 39*/ { BARCODE_CODE16K, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 40*/ { BARCODE_CODE16K, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 41*/ { BARCODE_CODE16K, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 42*/ { BARCODE_CODE16K, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 43*/ { BARCODE_CODE16K, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 44*/ { BARCODE_CODE16K, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 45*/ { BARCODE_CODE16K, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 46*/ { BARCODE_CODE16K, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 47*/ { BARCODE_CODE16K, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 48*/ { BARCODE_CODE16K, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 49*/ { BARCODE_CODE16K, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION },
- /* 50*/ { BARCODE_CODE16K, "[01]12345678901231[10]()", GS1_MODE, -1, 0 },
- /* 51*/ { BARCODE_CODE16K, "(01)12345678901231(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 52*/ { BARCODE_CODE16K, "(01)12345678901231(10)\\(\\)", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 53*/ { BARCODE_CODE16K, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 54*/ { BARCODE_CODE49, "[01]12345678901231", GS1_MODE, -1, 0 },
- /* 55*/ { BARCODE_CODE49, "(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 56*/ { BARCODE_CODE49, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 57*/ { BARCODE_CODE49, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 58*/ { BARCODE_CODE49, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 59*/ { BARCODE_CODE49, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 60*/ { BARCODE_CODE49, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 61*/ { BARCODE_CODE49, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 62*/ { BARCODE_CODE49, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 63*/ { BARCODE_CODE49, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 64*/ { BARCODE_CODE49, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 65*/ { BARCODE_CODE49, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 66*/ { BARCODE_CODE49, "[01]12345678901231[10]()", GS1_MODE, -1, 0 },
- /* 67*/ { BARCODE_CODE49, "(01)12345678901231(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 68*/ { BARCODE_CODE49, "(01)12345678901231(10)\\(\\)", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 69*/ { BARCODE_CODE49, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 70*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE, -1, 0 },
- /* 71*/ { BARCODE_DATAMATRIX, "(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 72*/ { BARCODE_DATAMATRIX, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 73*/ { BARCODE_DATAMATRIX, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 74*/ { BARCODE_DATAMATRIX, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 75*/ { BARCODE_DATAMATRIX, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 76*/ { BARCODE_DATAMATRIX, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 77*/ { BARCODE_DATAMATRIX, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 78*/ { BARCODE_DATAMATRIX, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 79*/ { BARCODE_DATAMATRIX, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 80*/ { BARCODE_DATAMATRIX, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 81*/ { BARCODE_DATAMATRIX, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 82*/ { BARCODE_DATAMATRIX, "[01]12345678901231", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION },
- /* 83*/ { BARCODE_DATAMATRIX, "[01]12345678901231[10]()", GS1_MODE, -1, 0 },
- /* 84*/ { BARCODE_DATAMATRIX, "(01)12345678901231(10)()", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 85*/ { BARCODE_DATAMATRIX, "(01)12345678901231(10)\\(\\)", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 86*/ { BARCODE_DATAMATRIX, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 87*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE, -1, 0 },
- /* 88*/ { BARCODE_DOTCODE, "(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /* 89*/ { BARCODE_DOTCODE, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 90*/ { BARCODE_DOTCODE, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 91*/ { BARCODE_DOTCODE, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 92*/ { BARCODE_DOTCODE, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 93*/ { BARCODE_DOTCODE, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 94*/ { BARCODE_DOTCODE, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 95*/ { BARCODE_DOTCODE, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 96*/ { BARCODE_DOTCODE, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 97*/ { BARCODE_DOTCODE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /* 98*/ { BARCODE_DOTCODE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0 },
- /* 99*/ { BARCODE_DOTCODE, "[01]12345678901231", GS1_MODE, READER_INIT, 0 }, /* Reader Init permissible with default GS1 mode */
- /*100*/ { BARCODE_DOTCODE, "[10]()[01]12345678901231", GS1_MODE, -1, 0 },
- /*101*/ { BARCODE_DOTCODE, "(10)()(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /*102*/ { BARCODE_DOTCODE, "(10)\\(\\)(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /*103*/ { BARCODE_DOTCODE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /*104*/ { BARCODE_QRCODE, "[01]12345678901231", GS1_MODE, -1, 0 },
- /*105*/ { BARCODE_QRCODE, "(01)12345678901231", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /*106*/ { BARCODE_QRCODE, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /*107*/ { BARCODE_QRCODE, "(01)12345678901234", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /*108*/ { BARCODE_QRCODE, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /*109*/ { BARCODE_QRCODE, "(01)123456789012345", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /*110*/ { BARCODE_QRCODE, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /*111*/ { BARCODE_QRCODE, "(01)12345678901234A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /*112*/ { BARCODE_QRCODE, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /*113*/ { BARCODE_QRCODE, "(01)1234567890123A", GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, 0 },
- /*114*/ { BARCODE_QRCODE, "[01]1234567890123", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /*115*/ { BARCODE_QRCODE, "[01]1234567890123", GS1_MODE | GS1NOCHECK_MODE, -1, 0 },
- /*116*/ { BARCODE_QRCODE, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", GS1_MODE, -1, 0 },
- /*117*/ { BARCODE_QRCODE, "(02)12345678901231(10)()(37)12345678(00)123456789012345675", GS1_MODE | GS1PARENS_MODE, -1, ZINT_ERROR_INVALID_DATA },
- /*118*/ { BARCODE_QRCODE, "(02)12345678901231(10)\\(\\)(37)12345678(00)123456789012345675", GS1_MODE | GS1PARENS_MODE, -1, 0 },
- /*119*/ { BARCODE_QRCODE, "1234", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA },
+ /* 0*/ { BARCODE_AZTEC, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /* 1*/ { BARCODE_AZTEC, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /* 2*/ { BARCODE_AZTEC, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /* 3*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231", 0, "" },
+ /* 4*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 5*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234", 0, "" },
+ /* 6*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE, -1, "(01)123456789012345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 7*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)123456789012345", 0, "" },
+ /* 8*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234A", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 9*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234A", 0, "" },
+ /* 10*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE, -1, "(01)1234567890123A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /* 11*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)1234567890123A", 0, "" },
+ /* 12*/ { BARCODE_AZTEC, GS1_MODE, -1, "[01]1234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 13*/ { BARCODE_AZTEC, GS1_MODE, -1, "^011234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data has incorrect length" },
+ /* 14*/ { BARCODE_AZTEC, GS1_MODE | GS1RAW_MODE, -1, "011234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data has incorrect length" },
+ /* 15*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]1234567890123", 0, "" },
+ /* 16*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE, -1, "^011234567890123", 0, "" },
+ /* 17*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE | GS1RAW_MODE, -1, "011234567890123", 0, "" },
+ /* 18*/ { BARCODE_AZTEC, GS1_MODE, READER_INIT, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 501: Cannot use Reader Initialisation in GS1 mode" },
+ /* 19*/ { BARCODE_AZTEC, GS1_MODE, -1, "[01]12345678901231[10]()", 0, "" },
+ /* 20*/ { BARCODE_AZTEC, GS1_MODE, -1, "^011234567890123110()", 0, "" },
+ /* 21*/ { BARCODE_AZTEC, GS1_MODE | GS1RAW_MODE, -1, "011234567890123110()", 0, "" },
+ /* 22*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)()", ZINT_ERROR_INVALID_DATA, "Error 268: AI (10) value is too short" },
+ /* 23*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)\\(\\)", 0, "" },
+ /* 24*/ { BARCODE_AZTEC, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 25*/ { BARCODE_AZTEC, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "1234", ZINT_ERROR_INVALID_DATA, "Error 855: Data does not start with an AI or Digital Link URI" }, /* Must still begin with AI */
+ /* 26*/ { BARCODE_AZTEC, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /* 27*/ { BARCODE_AZTEC, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /* 28*/ { BARCODE_AZTEC, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /* 29*/ { BARCODE_AZTEC, GS1_MODE, -1, "[02]12345678901231[10]()[37]1234567A[00]123456789012345675", ZINT_ERROR_INVALID_DATA, "Error 267: AI (37): A non-digit character was found where a digit is expected. (37)1234567|A|" },
+ /* 30*/ { BARCODE_AZTEC, GS1_MODE, -1, "^021234567890123110()^371234567A^00123456789012345675", ZINT_ERROR_INVALID_DATA, "Error 267: AI (37): A non-digit character was found where a digit is expected. (37)1234567|A|" },
+ /* 31*/ { BARCODE_AZTEC, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\035371234567A\03500123456789012345675", ZINT_ERROR_INVALID_DATA, "Error 267: AI (37): A non-digit character was found where a digit is expected. (37)1234567|A|" },
+ /* 32*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /* 33*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /* 34*/ { BARCODE_AZTEC, GS1_MODE | GS1NOCHECK_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /* 35*/ { BARCODE_CODABLOCKF, GS1_MODE, -1, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" }, /* Codablock-F does not support GS1 */
+ /* 36*/ { BARCODE_CODABLOCKF, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" },
+ /* 37*/ { BARCODE_CODABLOCKF, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_OPTION, "Error 220: Selected symbology does not support GS1 mode" },
+ /* 38*/ { BARCODE_CODEONE, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /* 39*/ { BARCODE_CODEONE, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /* 40*/ { BARCODE_CODEONE, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /* 41*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231", 0, "" },
+ /* 42*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 43*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234", 0, "" },
+ /* 44*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE, -1, "(01)123456789012345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 45*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)123456789012345", 0, "" },
+ /* 46*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234A", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 47*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234A", 0, "" },
+ /* 48*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE, -1, "(01)1234567890123A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /* 49*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)1234567890123A", 0, "" },
+ /* 50*/ { BARCODE_CODEONE, GS1_MODE, -1, "[01]1234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 51*/ { BARCODE_CODEONE, GS1_MODE, -1, "^011234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data has incorrect length" },
+ /* 52*/ { BARCODE_CODEONE, GS1_MODE | GS1RAW_MODE, -1, "011234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data has incorrect length" },
+ /* 53*/ { BARCODE_CODEONE, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]1234567890123", 0, "" },
+ /* 54*/ { BARCODE_CODEONE, GS1_MODE, -1, "[10]()[01]12345678901231", 0, "" },
+ /* 55*/ { BARCODE_CODEONE, GS1_MODE, -1, "^10()^0112345678901231", 0, "" },
+ /* 56*/ { BARCODE_CODEONE, GS1_MODE | GS1RAW_MODE, -1, "10()\0350112345678901231", 0, "" },
+ /* 57*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE, -1, "(10)()(01)12345678901231", ZINT_ERROR_INVALID_DATA, "Error 268: AI (10) value is too short" },
+ /* 58*/ { BARCODE_CODEONE, GS1_MODE | GS1PARENS_MODE, -1, "(10)\\(\\)(01)12345678901231", 0, "" },
+ /* 59*/ { BARCODE_CODEONE, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 60*/ { BARCODE_CODEONE, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /* 61*/ { BARCODE_CODEONE, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /* 62*/ { BARCODE_CODEONE, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /* 63*/ { BARCODE_CODE16K, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /* 64*/ { BARCODE_CODE16K, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /* 65*/ { BARCODE_CODE16K, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /* 66*/ { BARCODE_CODE16K, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /* 67*/ { BARCODE_CODE16K, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /* 68*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231", 0, "" },
+ /* 69*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 70*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234", 0, "" },
+ /* 71*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE, -1, "(01)123456789012345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 72*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)123456789012345", 0, "" },
+ /* 73*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234A", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 74*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234A", 0, "" },
+ /* 75*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE, -1, "(01)1234567890123A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /* 76*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)1234567890123A", 0, "" },
+ /* 77*/ { BARCODE_CODE16K, GS1_MODE, -1, "[01]1234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 78*/ { BARCODE_CODE16K, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]1234567890123", 0, "" },
+ /* 79*/ { BARCODE_CODE16K, GS1_MODE, READER_INIT, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 422: Cannot use Reader Initialisation in GS1 mode" },
+ /* 80*/ { BARCODE_CODE16K, GS1_MODE, -1, "[01]12345678901231[10]()", 0, "" },
+ /* 81*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)()", ZINT_ERROR_INVALID_DATA, "Error 268: AI (10) value is too short" },
+ /* 82*/ { BARCODE_CODE16K, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)\\(\\)", 0, "" },
+ /* 83*/ { BARCODE_CODE16K, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 84*/ { BARCODE_CODE16K, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /* 85*/ { BARCODE_CODE16K, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /* 86*/ { BARCODE_CODE16K, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /* 87*/ { BARCODE_CODE49, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /* 88*/ { BARCODE_CODE49, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /* 89*/ { BARCODE_CODE49, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /* 90*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231", 0, "" },
+ /* 91*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 92*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234", 0, "" },
+ /* 93*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE, -1, "(01)123456789012345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 94*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)123456789012345", 0, "" },
+ /* 95*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234A", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 96*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234A", 0, "" },
+ /* 97*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE, -1, "(01)1234567890123A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /* 98*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)1234567890123A", 0, "" },
+ /* 99*/ { BARCODE_CODE49, GS1_MODE, -1, "[01]1234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /*100*/ { BARCODE_CODE49, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]1234567890123", 0, "" },
+ /*101*/ { BARCODE_CODE49, GS1_MODE, -1, "[01]12345678901231[10]()", 0, "" },
+ /*102*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)()", ZINT_ERROR_INVALID_DATA, "Error 268: AI (10) value is too short" },
+ /*103*/ { BARCODE_CODE49, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)\\(\\)", 0, "" },
+ /*104*/ { BARCODE_CODE49, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /*105*/ { BARCODE_CODE49, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /*106*/ { BARCODE_CODE49, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /*107*/ { BARCODE_CODE49, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /*108*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /*109*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /*110*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /*111*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231", 0, "" },
+ /*112*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "[01]12345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*113*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]12345678901234", 0, "" },
+ /*114*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*115*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234", 0, "" },
+ /*116*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "^0112345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*117*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE, -1, "^0112345678901234", 0, "" },
+ /*118*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1RAW_MODE, -1, "0112345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*119*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE | GS1RAW_MODE, -1, "0112345678901234", 0, "" },
+ /*120*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /*121*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]123456789012315", 0, "" },
+ /*122*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, "(01)123456789012315", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /*123*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)123456789012315", 0, "" },
+ /*124*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "^01123456789012315", ZINT_ERROR_INVALID_DATA, "Error 268: No known AI is a prefix of: 5..." }, /* Raw/caret require underlong data lengths to work */
+ /*125*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE, -1, "^01123456789012315", ZINT_ERROR_INVALID_DATA, "Error 859: Invalid data length for AI (01) at position 2" },
+ /*126*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1RAW_MODE, -1, "01123456789012315", ZINT_ERROR_INVALID_DATA, "Error 268: No known AI is a prefix of: 5..." }, /* Raw/caret require underlong data lengths to work */
+ /*127*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE | GS1RAW_MODE, -1, "01123456789012315", ZINT_ERROR_INVALID_DATA, "Error 859: Invalid data length for AI (01) at position 1" },
+ /*128*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "^01123456789012345", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" }, /* Raw/caret lint checks occur before length check */
+ /*129*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE, -1, "^01123456789012345", ZINT_ERROR_INVALID_DATA, "Error 859: Invalid data length for AI (01) at position 2" },
+ /*130*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1RAW_MODE, -1, "01123456789012345", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*131*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE | GS1RAW_MODE, -1, "01123456789012345", ZINT_ERROR_INVALID_DATA, "Error 859: Invalid data length for AI (01) at position 1" },
+ /*132*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231A", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /*133*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901231A", 0, "" },
+ /*134*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, "(01)1234567890123A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /*135*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)1234567890123A", 0, "" },
+ /*136*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "[01]1234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /*137*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]1234567890123", 0, "" },
+ /*138*/ { BARCODE_DATAMATRIX, GS1_MODE, READER_INIT, "[01]12345678901231", ZINT_ERROR_INVALID_OPTION, "Error 521: Cannot use Reader Initialisation in GS1 mode" },
+ /*139*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "[01]12345678901231[10]()", 0, "" },
+ /*140*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)()", ZINT_ERROR_INVALID_DATA, "Error 268: AI (10) value is too short" },
+ /*141*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231(10)\\(\\)", 0, "" },
+ /*142*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /*143*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /*144*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /*145*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /*146*/ { BARCODE_DOTCODE, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /*147*/ { BARCODE_DOTCODE, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /*148*/ { BARCODE_DOTCODE, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /*149*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231", 0, "" },
+ /*150*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*151*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234", 0, "" },
+ /*152*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)123456789012345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /*153*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)123456789012345", 0, "" },
+ /*154*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234A", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /*155*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234A", 0, "" },
+ /*156*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)1234567890123A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /*157*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)1234567890123A", 0, "" },
+ /*158*/ { BARCODE_DOTCODE, GS1_MODE, -1, "[01]1234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /*159*/ { BARCODE_DOTCODE, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]1234567890123", 0, "" },
+ /*160*/ { BARCODE_DOTCODE, GS1_MODE, READER_INIT, "[01]12345678901231", 0, "" }, /* Reader Init permissible with default GS1 mode */
+ /*161*/ { BARCODE_DOTCODE, GS1_MODE, -1, "[10]()[01]12345678901231", 0, "" },
+ /*162*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE, -1, "(10)()(01)12345678901231", ZINT_ERROR_INVALID_DATA, "Error 268: AI (10) value is too short" },
+ /*163*/ { BARCODE_DOTCODE, GS1_MODE | GS1PARENS_MODE, -1, "(10)\\(\\)(01)12345678901231", 0, "" },
+ /*164*/ { BARCODE_DOTCODE, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /*165*/ { BARCODE_DOTCODE, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /*166*/ { BARCODE_DOTCODE, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /*167*/ { BARCODE_DOTCODE, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /*168*/ { BARCODE_QRCODE, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /*169*/ { BARCODE_QRCODE, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /*170*/ { BARCODE_QRCODE, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /*171*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901231", 0, "" },
+ /*172*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /*173*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234", 0, "" },
+ /*174*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)123456789012345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /*175*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)123456789012345", 0, "" },
+ /*176*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)12345678901234A", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /*177*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)12345678901234A", 0, "" },
+ /*178*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE, -1, "(01)1234567890123A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /*179*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "(01)1234567890123A", 0, "" },
+ /*180*/ { BARCODE_QRCODE, GS1_MODE, -1, "[01]1234567890123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /*181*/ { BARCODE_QRCODE, GS1_MODE | GS1NOCHECK_MODE, -1, "[01]1234567890123", 0, "" },
+ /*182*/ { BARCODE_QRCODE, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /*183*/ { BARCODE_QRCODE, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /*184*/ { BARCODE_QRCODE, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /*185*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE, -1, "(02)12345678901231(10)()(37)12345678(00)123456789012345675", ZINT_ERROR_INVALID_DATA, "Error 268: AI (10) value is too short" },
+ /*186*/ { BARCODE_QRCODE, GS1_MODE | GS1PARENS_MODE, -1, "(02)12345678901231(10)\\(\\)(37)12345678(00)123456789012345675", 0, "" },
+ /*187*/ { BARCODE_QRCODE, GS1_MODE, -1, "1234", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /*188*/ { BARCODE_RMQR, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /*189*/ { BARCODE_RMQR, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /*190*/ { BARCODE_RMQR, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /*191*/ { BARCODE_RMQR, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /*192*/ { BARCODE_RMQR, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /*193*/ { BARCODE_RMQR, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
+ /*194*/ { BARCODE_ULTRA, GS1_MODE, -1, "[01]12345678901231", 0, "" },
+ /*195*/ { BARCODE_ULTRA, GS1_MODE, -1, "^0112345678901231", 0, "" },
+ /*196*/ { BARCODE_ULTRA, GS1_MODE | GS1RAW_MODE, -1, "0112345678901231", 0, "" },
+ /*197*/ { BARCODE_ULTRA, GS1_MODE, -1, "[02]12345678901231[10]()[37]12345678[00]123456789012345675", 0, "" },
+ /*198*/ { BARCODE_ULTRA, GS1_MODE, -1, "^021234567890123110()^3712345678^00123456789012345675", 0, "" },
+ /*199*/ { BARCODE_ULTRA, GS1_MODE | GS1RAW_MODE, -1, "021234567890123110()\0353712345678\03500123456789012345675", 0, "" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -826,6 +1224,8 @@ static void test_non_forced(const testCtx *const p_ctx) {
ret = ZBarcode_Encode(symbol, TCU(data[i].data), length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
+ assert_zero(strcmp(symbol->errtxt, data[i].expected_errtxt), "i:%d strcmp(%s, %s) != 0\n",
+ i, symbol->errtxt, data[i].expected_errtxt);
ZBarcode_Delete(symbol);
}
@@ -848,79 +1248,117 @@ static void test_gs1_128_dbar_exp(const testCtx *const p_ctx) {
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
/* 0*/ { BARCODE_GS1_128, -1, "[01]12345678901231", "", 0, "" },
- /* 1*/ { BARCODE_GS1_128, -1, "[01]12345678901234", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
- /* 2*/ { BARCODE_GS1_128, -1, "[01]123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
- /* 3*/ { BARCODE_GS1_128, -1, "[01]1234567890123", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
- /* 4*/ { BARCODE_GS1_128, -1, "[01]12345678901231[20]1", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (20) value is too short" },
- /* 5*/ { BARCODE_GS1_128, -1, "[04]1234[05]12345[06]123456", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 04" },
- /* 6*/ { BARCODE_GS1_128, -1, "[01]1234567890123A", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
- /* 7*/ { BARCODE_GS1_128, -1, "[01]1234567890123.", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|.|" },
- /* 8*/ { BARCODE_GS1_128, -1, "[01]1234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|\\x7F|" },
- /* 9*/ { BARCODE_GS1_128, -1, "[01]1234567890123\200", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|\\x80|" },
- /* 10*/ { BARCODE_GS1_128, -1, "0112345678901231", "", ZINT_ERROR_INVALID_DATA, "Error 264: Data does not start with an AI" },
- /* 11*/ { BARCODE_GS1_128, -1, "[01]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
- /* 12*/ { BARCODE_GS1_128, -1, "[01][20]12", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
- /* 13*/ { BARCODE_GS1_128, -1, "[0]123", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 0" },
- /* 14*/ { BARCODE_GS1_128, -1, "[0]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 0" },
- /* 15*/ { BARCODE_GS1_128, -1, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
- /* 16*/ { BARCODE_GS1_128, -1, "[01]12345678901231[]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
- /* 17*/ { BARCODE_GS1_128, -1, "[123456789012345]123", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 123456789012345" },
- /* 18*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(91)AB[", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (91): A non-CSET 82 character was found where a CSET 82 character is expected. (91)AB|[|" },
- /* 19*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(91)12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789[", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (91): A non-CSET 82 character was found where a CSET 82 character is expected." },
- /* 20*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]12", 0, "" },
- /* 21*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901234", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
- /* 22*/ { BARCODE_GS1_128_CC, -1, "[01]123456789012345", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
- /* 23*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (20) value is too long" },
- /* 24*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]1A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (20): A non-digit character was found where a digit is expected. (20)1|A|" },
- /* 25*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
- /* 26*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[2]12", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
- /* 27*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
- /* 28*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[90]12[34", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
- /* 29*/ { BARCODE_GS1_128_CC, -1, "https://example.com/01/12345678901231", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 264: Data does not start with an AI" },
- /* 30*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231", "", 0, "" },
- /* 31*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]12345", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (11) value is too short" },
- /* 32*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]12345A", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (11): A non-digit character was found where a digit is expected. (11)12345|A|" },
- /* 33*/ { BARCODE_DBAR_EXP, -1, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 264: Data does not start with an AI" },
- /* 34*/ { BARCODE_DBAR_EXP, -1, "[10]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
- /* 35*/ { BARCODE_DBAR_EXP, -1, "[2]1", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 2" },
- /* 36*/ { BARCODE_DBAR_EXP, -1, "[]1", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
- /* 37*/ { BARCODE_DBAR_EXP, -1, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
- /* 38*/ { BARCODE_DBAR_EXP, -1, "[20]12[]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
- /* 39*/ { BARCODE_DBAR_EXP, -1, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
- /* 40*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
- /* 41*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (11) value is too short" },
- /* 42*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 267: AI (11): The date contains an illegal month of the year. (11)12|34|56" },
- /* 43*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", ZINT_ERROR_INVALID_DATA, "Error 268: AI (30) value is too long" },
- /* 44*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (30): A non-digit character was found where a digit is expected. (30)1234567|A|" },
- /* 45*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121\177", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890121|\\x7F|" },
- /* 46*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 267: AI (20): A non-digit character was found where a digit is expected. (20)1|\\x7F|" },
- /* 47*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
- /* 48*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "2012", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
- /* 49*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[10]", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
- /* 50*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[10]", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
- /* 51*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[2]1", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 2" },
- /* 52*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[]12", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
- /* 53*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[]", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
- /* 54*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
- /* 55*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231", "", 0, "" },
- /* 56*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]1234", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (11) value is too short" },
- /* 57*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]12345A", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (11): A non-digit character was found where a digit is expected. (11)12345|A|" },
- /* 58*/ { BARCODE_DBAR_EXPSTK, -1, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890121|\\x7F|" },
- /* 59*/ { BARCODE_DBAR_EXPSTK, -1, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890121|\\x80|" },
- /* 60*/ { BARCODE_DBAR_EXPSTK, -1, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 264: Data does not start with an AI" },
- /* 61*/ { BARCODE_DBAR_EXPSTK, -1, "[01]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
- /* 62*/ { BARCODE_DBAR_EXPSTK, -1, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
- /* 63*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
- /* 64*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (11) value is too short" },
- /* 65*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 267: AI (11): The date contains an illegal month of the year. (11)12|34|56" },
- /* 66*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", ZINT_ERROR_INVALID_DATA, "Error 268: AI (30) value is too long" },
- /* 67*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (30): A non-digit character was found where a digit is expected. (30)1234567|A|" },
- /* 68*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
- /* 69*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 267: AI (20): A non-digit character was found where a digit is expected. (20)1|\\x80|" },
- /* 70*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231", "2012", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
- /* 71*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[235]", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
- /* 72*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231", "[235]", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
- /* 73*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
+ /* 1*/ { BARCODE_GS1_128, -1, "^0112345678901231", "", 0, "" },
+ /* 2*/ { BARCODE_GS1_128, GS1RAW_MODE, "0112345678901231", "", 0, "" },
+ /* 3*/ { BARCODE_GS1_128, GS1RAW_MODE, "\0350112345678901231", "", 0, "" }, /* Tolerate initial GS */
+ /* 4*/ { BARCODE_GS1_128, -1, "[01]12345678901234", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 5*/ { BARCODE_GS1_128, -1, "^0112345678901234", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 6*/ { BARCODE_GS1_128, GS1RAW_MODE, "0112345678901234", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 7*/ { BARCODE_GS1_128, GS1RAW_MODE, "\0350112345678901234", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 8*/ { BARCODE_GS1_128, -1, "[01]123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 9*/ { BARCODE_GS1_128, -1, "^01123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 10*/ { BARCODE_GS1_128, GS1RAW_MODE, "01123456789012345", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 11*/ { BARCODE_GS1_128, -1, "[01]1234567890123", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 12*/ { BARCODE_GS1_128, -1, "^011234567890123", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data has incorrect length" },
+ /* 13*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data has incorrect length" },
+ /* 14*/ { BARCODE_GS1_128, -1, "[01]12345678901231[20]1", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (20) value is too short" },
+ /* 15*/ { BARCODE_GS1_128, -1, "^0112345678901231201", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (20) data has incorrect length" },
+ /* 16*/ { BARCODE_GS1_128, GS1RAW_MODE, "0112345678901231201", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (20) data has incorrect length" },
+ /* 17*/ { BARCODE_GS1_128, -1, "[04]1234[05]12345[06]123456", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 04" },
+ /* 18*/ { BARCODE_GS1_128, -1, "^041234^0512345^06123456", "", ZINT_ERROR_INVALID_DATA, "Error 268: No known AI is a prefix of: 0412..." },
+ /* 19*/ { BARCODE_GS1_128, GS1RAW_MODE, "041234\0350512345\03506123456", "", ZINT_ERROR_INVALID_DATA, "Error 268: No known AI is a prefix of: 0412..." },
+ /* 20*/ { BARCODE_GS1_128, -1, "[01]1234567890123A", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /* 21*/ { BARCODE_GS1_128, -1, "^011234567890123A", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /* 22*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123A", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|A|" },
+ /* 23*/ { BARCODE_GS1_128, -1, "[01]1234567890123.", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|.|" },
+ /* 24*/ { BARCODE_GS1_128, -1, "^011234567890123.", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|.|" },
+ /* 25*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123.", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|.|" },
+ /* 26*/ { BARCODE_GS1_128, -1, "[01]1234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|\\x7F|" },
+ /* 27*/ { BARCODE_GS1_128, -1, "^011234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|\\x7F|" },
+ /* 28*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123\177", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|\\x7F|" },
+ /* 29*/ { BARCODE_GS1_128, -1, "[01]1234567890123\200", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|\\x80|" },
+ /* 30*/ { BARCODE_GS1_128, -1, "^011234567890123\200", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|\\x80|" },
+ /* 31*/ { BARCODE_GS1_128, GS1RAW_MODE, "011234567890123\200", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890123|\\x80|" },
+ /* 32*/ { BARCODE_GS1_128, -1, "0112345678901231", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 33*/ { BARCODE_GS1_128, -1, "[01]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 34*/ { BARCODE_GS1_128, -1, "^01", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data is empty" },
+ /* 35*/ { BARCODE_GS1_128, GS1RAW_MODE, "01", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data is empty" },
+ /* 36*/ { BARCODE_GS1_128, -1, "[01][20]12", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 37*/ { BARCODE_GS1_128, -1, "^012012", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data has incorrect length" },
+ /* 38*/ { BARCODE_GS1_128, GS1RAW_MODE, "012012", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) data has incorrect length" },
+ /* 39*/ { BARCODE_GS1_128, -1, "[0]123", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 0" },
+ /* 40*/ { BARCODE_GS1_128, -1, "^0", "", ZINT_ERROR_INVALID_DATA, "Error 802: Data does not start with an AI" },
+ /* 41*/ { BARCODE_GS1_128, GS1RAW_MODE, "0", "", ZINT_ERROR_INVALID_DATA, "Error 802: Data does not start with an AI" },
+ /* 42*/ { BARCODE_GS1_128, -1, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
+ /* 43*/ { BARCODE_GS1_128, -1, "[01]12345678901231[]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
+ /* 44*/ { BARCODE_GS1_128, -1, "[123456789012345]123", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 123456789012345" },
+ /* 45*/ { BARCODE_GS1_128, -1, "^123456789012345123", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (12): The date contains an illegal month of the year. (12)34|56|78" },
+ /* 46*/ { BARCODE_GS1_128, GS1RAW_MODE, "123456789012345123", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (12): The date contains an illegal month of the year. (12)34|56|78" },
+ /* 47*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(91)AB[", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (91): A non-CSET 82 character was found where a CSET 82 character is expected. (91)AB|[|" },
+ /* 48*/ { BARCODE_GS1_128, GS1PARENS_MODE, "^91AB[", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (91): A non-CSET 82 character was found where a CSET 82 character is expected. (91)AB|[|" },
+ /* 49*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1RAW_MODE, "91AB[", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (91): A non-CSET 82 character was found where a CSET 82 character is expected. (91)AB|[|" },
+ /* 50*/ { BARCODE_GS1_128, GS1PARENS_MODE, "(91)12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789[", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (91): A non-CSET 82 character was found where a CSET 82 character is expected." },
+ /* 51*/ { BARCODE_GS1_128, GS1PARENS_MODE, "^9112345678901234567890123456789012345678901234567890123456789012345678901234567890123456789[", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (91): A non-CSET 82 character was found where a CSET 82 character is expected." },
+ /* 52*/ { BARCODE_GS1_128, GS1PARENS_MODE | GS1RAW_MODE, "9112345678901234567890123456789012345678901234567890123456789012345678901234567890123456789[", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (91): A non-CSET 82 character was found where a CSET 82 character is expected." },
+ /* 53*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]12", 0, "" },
+ /* 54*/ { BARCODE_GS1_128_CC, -1, "^0112345678901231", "^2012", 0, "" },
+ /* 55*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, "0112345678901231", "2012", 0, "" },
+ /* 56*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, "\0350112345678901231", "2012", 0, "" },
+ /* 57*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, "0112345678901231", "\0352012", 0, "" },
+ /* 58*/ { BARCODE_GS1_128_CC, GS1RAW_MODE, "\0350112345678901231", "\0352012", 0, "" },
+ /* 59*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901234", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): The numeric check digit is incorrect. (01)1234567890123|4|" },
+ /* 60*/ { BARCODE_GS1_128_CC, -1, "[01]123456789012345", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too long" },
+ /* 61*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]123", ZINT_ERROR_INVALID_DATA, "Error 268: AI (20) value is too long" },
+ /* 62*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[20]1A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (20): A non-digit character was found where a digit is expected. (20)1|A|" },
+ /* 63*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[20]", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 64*/ { BARCODE_GS1_128_CC, -1, "[01]1234567890121", "[2]12", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 65*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
+ /* 66*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[90]12[34", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 67*/ { BARCODE_GS1_128_CC, -1, "https://example.com/01/12345678901231", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 68*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231", "", 0, "" },
+ /* 69*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]12345", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (11) value is too short" },
+ /* 70*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231[10]123[11]12345A", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (11): A non-digit character was found where a digit is expected. (11)12345|A|" },
+ /* 71*/ { BARCODE_DBAR_EXP, -1, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 72*/ { BARCODE_DBAR_EXP, -1, "[10]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 73*/ { BARCODE_DBAR_EXP, -1, "[2]1", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 2" },
+ /* 74*/ { BARCODE_DBAR_EXP, -1, "[]1", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
+ /* 75*/ { BARCODE_DBAR_EXP, -1, "[]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
+ /* 76*/ { BARCODE_DBAR_EXP, -1, "[20]12[]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
+ /* 77*/ { BARCODE_DBAR_EXP, -1, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
+ /* 78*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
+ /* 79*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (11) value is too short" },
+ /* 80*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 267: AI (11): The date contains an illegal month of the year. (11)12|34|56" },
+ /* 81*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", ZINT_ERROR_INVALID_DATA, "Error 268: AI (30) value is too long" },
+ /* 82*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (30): A non-digit character was found where a digit is expected. (30)1234567|A|" },
+ /* 83*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121\177", "[20]12", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890121|\\x7F|" },
+ /* 84*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 267: AI (20): A non-digit character was found where a digit is expected. (20)1|\\x7F|" },
+ /* 85*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "2012", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 86*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "2012", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 87*/ { BARCODE_DBAR_EXP_CC, -1, "[01]1234567890121", "[10]", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /* 88*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[10]", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 89*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[2]1", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: 2" },
+ /* 90*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[]12", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
+ /* 91*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[]", ZINT_ERROR_INVALID_DATA, "Error 268: Unrecognised AI: " },
+ /* 92*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
+ /* 93*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231", "", 0, "" },
+ /* 94*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]1234", "", ZINT_ERROR_INVALID_DATA, "Error 268: AI (11) value is too short" },
+ /* 95*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231[10]123[11]12345A", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (11): A non-digit character was found where a digit is expected. (11)12345|A|" },
+ /* 96*/ { BARCODE_DBAR_EXPSTK, -1, "[01]1234567890121\177", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890121|\\x7F|" },
+ /* 97*/ { BARCODE_DBAR_EXPSTK, -1, "[01]1234567890121\200", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (01): A non-digit character was found where a digit is expected. (01)1234567890121|\\x80|" },
+ /* 98*/ { BARCODE_DBAR_EXPSTK, -1, "011234567890121", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /* 99*/ { BARCODE_DBAR_EXPSTK, -1, "[01]", "", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /*100*/ { BARCODE_DBAR_EXPSTK, -1, "[90]12]34", "", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
+ /*101*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345", 0, "" },
+ /*102*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]1234", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 268: AI (11) value is too short" },
+ /*103*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]123456", "[21]ABC123[22]12345", ZINT_ERROR_INVALID_DATA, "Error 267: AI (11): The date contains an illegal month of the year. (11)12|34|56" },
+ /*104*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]123456789", ZINT_ERROR_INVALID_DATA, "Error 268: AI (30) value is too long" },
+ /*105*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[10]123[11]121212", "[21]ABC123[22]12345[30]1234567A", ZINT_ERROR_INVALID_DATA, "Error 267: AI (30): A non-digit character was found where a digit is expected. (30)1234567|A|" },
+ /*106*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[20]1\177", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /*107*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231", "[20]1\200", ZINT_ERROR_INVALID_DATA, "Error 267: AI (20): A non-digit character was found where a digit is expected. (20)1|\\x80|" },
+ /*108*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231", "2012", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /*109*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]1234567890121", "[235]", ZINT_ERROR_INVALID_DATA, "Error 268: AI (01) value is too short" },
+ /*110*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231", "[235]", ZINT_ERROR_INVALID_DATA, "Error 268: Failed to parse AI data" },
+ /*111*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231", "[90]12]34", ZINT_ERROR_INVALID_DATA, "Error 267: AI (90): A non-CSET 82 character was found where a CSET 82 character is expected. (90)12|]|34" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
diff --git a/backend/tests/test_library.c b/backend/tests/test_library.c
index 28262330..26d8fe77 100644
--- a/backend/tests/test_library.c
+++ b/backend/tests/test_library.c
@@ -195,15 +195,15 @@ static void test_checks(const testCtx *const p_ctx) {
/*131*/ { BARCODE_CODE128, -1, "\\o200", -1, UNICODE_MODE | ESCAPE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input", -1 },
/*132*/ { BARCODE_MAXICODE, -1, "\200", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input", -1 },
/*133*/ { BARCODE_MAXICODE, -1, "\\o200", -1, UNICODE_MODE | ESCAPE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input", -1 },
- /*134*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 },
- /*135*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 },
+ /*134*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1'", -1 },
+ /*135*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) data position 14: Bad checksum '4', expected '1'", -1 },
/*136*/ { BARCODE_QRCODE, -1, "ก", -1, UNICODE_MODE, 13, 0, 0, 0, 0, -1, -1, 0, -1, -1, 0, "", -1 },
/*137*/ { BARCODE_QRCODE, -1, "ก", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_WARN_USES_ECI, "Warning 222: Encoded data includes ECI 13", -1 },
/*138*/ { BARCODE_QRCODE, -1, "ก", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_USES_ECI, "Error 222: Encoded data includes ECI 13", -1 },
/*139*/ { BARCODE_CODEONE, -1, "[01]12345678901231", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 512: ECI ignored for GS1 mode", -1 },
/*140*/ { BARCODE_CODEONE, -1, "[01]12345678901231", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 512: ECI ignored for GS1 mode", -1 },
/*141*/ { BARCODE_CODEONE, -1, "[01]12345678901234", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 512: ECI ignored for GS1 mode", -1 }, /* Warning in encoder overrides library warnings */
- /*142*/ { BARCODE_CODEONE, -1, "[01]12345678901234", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) position 14: Bad checksum '4', expected '1'", -1 }, /* But not errors */
+ /*142*/ { BARCODE_CODEONE, -1, "[01]12345678901234", -1, GS1_MODE, 3, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) data position 14: Bad checksum '4', expected '1'", -1 }, /* But not errors */
/*143*/ { BARCODE_AZTEC, -1, "ก", -1, UNICODE_MODE, 13, 0, 0, 0, 0, -1, -1, 0, -1, -1, 0, "", -1 },
/*144*/ { BARCODE_AZTEC, -1, "ก", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_WARN_USES_ECI, "Warning 222: Encoded data includes ECI 13", -1 },
/*145*/ { BARCODE_AZTEC, -1, "ก", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_USES_ECI, "Error 222: Encoded data includes ECI 13", -1 },
@@ -2105,7 +2105,7 @@ static int test_prev_ZBarcode_BarcodeName(int symbol_id, char name[32]) {
static void test_barcode_name(const testCtx *const p_ctx) {
int ret;
- char name[32] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char name[32] ZINT_TESTUTIL_SANITIZEM_INIT;
int symbol_id;
(void)p_ctx;
@@ -2810,8 +2810,8 @@ static void test_utf8_to_eci(const testCtx *const p_ctx) {
for (i = 0; i < data_size; i++) {
int ret_dest;
- unsigned char dest[1024];
- int dest_length;
+ unsigned char dest[1024] ZINT_TESTUTIL_SANITIZEM_INIT;
+ int dest_length ZINT_TESTUTIL_SANITIZEM_INIT;
if (testContinue(p_ctx, i)) continue;
diff --git a/backend/tests/test_mailmark.c b/backend/tests/test_mailmark.c
index f75be13b..d58bd23e 100644
--- a/backend/tests/test_mailmark.c
+++ b/backend/tests/test_mailmark.c
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2019-2025 Robin Stuart
+ Copyright (C) 2019-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -648,7 +648,7 @@ static void test_2d_encode(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[8192];
- char cmp_buf[32768];
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
diff --git a/backend/tests/test_qr.c b/backend/tests/test_qr.c
index 575af7c3..78be2097 100644
--- a/backend/tests/test_qr.c
+++ b/backend/tests/test_qr.c
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2019-2025 Robin Stuart
+ Copyright (C) 2019-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -70,10 +70,10 @@ static void test_qr_large(const testCtx *const p_ctx) {
int i, length, ret;
struct zint_symbol *symbol = NULL;
- char data_buf[ZINT_MAX_DATA_LEN];
+ char data_buf[ZINT_MAX_DATA_LEN] ZINT_TESTUTIL_SANITIZEM_INIT;
- char escaped[ZINT_MAX_DATA_LEN] = {0}; /* Suppress clang -fsanitize=memory false positive */
- char cmp_buf[177 * 177 + 1] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char escaped[ZINT_MAX_DATA_LEN] ZINT_TESTUTIL_SANITIZEM_INIT;
+ char cmp_buf[177 * 177 + 1] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
@@ -489,7 +489,7 @@ static void test_qr_input(const testCtx *const p_ctx) {
char escaped[4096];
char escaped2[4096];
char ret_buf[4096];
- char cmp_buf[32768] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
@@ -856,7 +856,7 @@ static void test_qr_optimize(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[4096];
- char cmp_buf[32768] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
@@ -4740,7 +4740,7 @@ static void test_qr_encode_segs(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[4096];
- char cmp_buf[32768];
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
@@ -7369,7 +7369,7 @@ static void test_upnqr_encode(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[4096];
- char cmp_buf[32768];
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
#if 0 /* Need to add "force binary mode" to BWIPP for this to work */
@@ -8078,7 +8078,7 @@ static void test_rmqr_large(const testCtx *const p_ctx) {
char data_buf[ZINT_MAX_DATA_LEN];
char escaped[4096];
- char cmp_buf[32768];
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do ZXing-C++ test if asked, too slow otherwise */
@@ -9397,7 +9397,7 @@ static void test_rmqr_encode_segs(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[4096];
- char cmp_buf[32768] = {0}; /* Suppress clang -fsanitize=memory false positive */
+ char cmp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
diff --git a/backend/tests/test_rss.c b/backend/tests/test_rss.c
index 86c7fbb6..b898cf92 100644
--- a/backend/tests/test_rss.c
+++ b/backend/tests/test_rss.c
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2019-2025 Robin Stuart
+ Copyright (C) 2019-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -790,7 +790,7 @@ static void test_examples(const testCtx *const p_ctx) {
"00000100010110000110100000001010101010111100111101110010110001110011101000000000100010000011010010000100011110111011001000101010101010011101111111010000000000000000000000000000000000000000000000000000"
"00100011101001111001001111110000010101000011000010001101001110001100010111111111001101111100101101111011100001000100110011000000000101100010000000101010000000000000000000000000000000000000000000000000"
},
- /* 90*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]106141416543213500110000310123196000", 0, 5, 200, 1, "NACAG Figure 1 (& Appendix C: Example 6) specifying max rows",
+ /* 90*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]106141416543213500110000310123196000", 0, 5, 200, 0, "NACAG Figure 1 (& Appendix C: Example 6) specifying max rows; BWIPP need segments arg, see above",
"01001100101110001110111111110000101000001101000001010111100110111000101111100000011011010001000000110000111100001010100011111100001010000010101111000111010000011001101011111111001110000001101101000101"
"00000011010001110001000000001010010111110010111110101000011001000111010000010101000100101110111111001111000011110101010100000010100101111101010000111000101111100110010100000000100001111110010010110000"
"00000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
@@ -804,7 +804,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000001000100001011010000000010000111001101101100001100111100100100010100001010100100001101011111000000000000000000000000000000000000000000000000000000"
"1011110111011110100101111111100111000110010010011110011000011011011100011110000001011110010100000100100000000000000000000000000000000000000000000000000"
},
- /* 92*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]10614141011111275110111", 0, 5, 151, 1, "NACAG Figure 3 specifying max rows",
+ /* 92*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]10614141011111275110111", 0, 5, 151, 0, "NACAG Figure 3 specifying max rows; BWIPP need segments arg, see above",
"0101011110011100001011111111000010100000110100000101011110011011100010111110000001101101000100000011000011100001101010001111110000101010000011000111010"
"0000100001100011110100000000101001011111001011111010100001100100011101000001010100010010111011111100111100011110010101010000001010010101111100111000000"
"0000010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010100000"
@@ -818,7 +818,7 @@ static void test_examples(const testCtx *const p_ctx) {
"0000011010011011100010100101010100100111000100000101010000111000110010100000101010001111000101110100011001110001101000100000001010101011011110000111010111110001101011101000000000100011110100100010000110101100111000001000101010101000000000000000000000000000000000000000000000000000000000000000000000"
"0010000101100100011100011000000001011000111011111010101111000111001101011111000000110000111010001011100110001110010111001111110000010100100001111000101000001110010100010111111111001100001011011101111001010011000111110011000000000101000000000000000000000000000000000000000000000000000000000000000000"
},
- /* 94*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]106141410222223100110222111101231023456721104561045678991201", 0, 5, 298, 1, "NACAG Figure 4, specifying max rows",
+ /* 94*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]106141410222223100110222111101231023456721104561045678991201", 0, 5, 298, 0, "NACAG Figure 4, specifying max rows; BWIPP need segments arg, see above",
"0100101111101001111011111111000010110010000011001101011110011011100010111100000000101101000100000011000011100001101010001111110000101011000011100001010111000011011110101111000000111010011111000101110001110110011001100011110000001011100110000101000110101111110111001011111111001110011010011100001101"
"0000010000010110000100000000101001001101111100110010100001100100011101000010101010010010111011111100111100011110010101010000001010010100111100011110101000111100100001010000101010000101100000111010001110001001100110010100001010100100011001111010111001010000001000110100000000100001100101100011110000"
"0000010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
@@ -832,7 +832,7 @@ static void test_examples(const testCtx *const p_ctx) {
"000001110000100101101000000101000011110100100011100111100001001101001010010101010010011111110101101100010010110011111010000010101000111101010000010001110001001100110010001010101010100011000111001011000010011010000010100000000010000000000000000000000"
"101110001111011010010111111000011100001011011100011000011110110010110001100000000101100000001010010011101101001100000101111100000011000010101111101110001110110011001100110000000001011100111000110100111101100101111101011111111100110100000000000000000"
},
- /* 96*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]1061414165432131501101201211014092110256100126663101231", 0, 5, 249, 1, "NACAG Appendix C: Example 1, specifying max row",
+ /* 96*/ { BARCODE_DBAR_EXPSTK, -1, -1, 2, "[8110]1061414165432131501101201211014092110256100126663101231", 0, 5, 249, 0, "NACAG Appendix C: Example 1, specifying max row; BWIPP need segments arg, see above",
"010111101100011011101111111100001011001000001100110101111001101110001011110000000010110100010000001100001111000010101000111111000010100000101011110001110100000110011010111100000011101001111000101111000111011001001110001111000000101011001000001110010"
"000000010011100100010000000010100100110111110011001010000110010001110100001010101001001011101111110011110000111101010101000000101001011111010100001110001011111001100101000010101000010110000111010000111000100110110001010000101010010100110111110000000"
"000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010100000"
@@ -872,8 +872,8 @@ static void test_examples(const testCtx *const p_ctx) {
int i, length, ret;
struct zint_symbol *symbol = NULL;
- char escaped[4096] = {0}; /* Suppress clang -fsanitize=memory false positive */
- char cmp_buf[16384];
+ char escaped[4096] ZINT_TESTUTIL_SANITIZEM_INIT;
+ char cmp_buf[16384] ZINT_TESTUTIL_SANITIZEM_INIT;
char cmp_msg[1024];
/* Only do BWIPP/ZXing-C++ tests if asked, too slow otherwise */
@@ -1332,12 +1332,14 @@ static void test_hrt(const testCtx *const p_ctx) {
/* 9*/ { BARCODE_DBAR_LTD, BARCODE_CONTENT_SEGS, "13410567901384", 0, "(01)13410567901384", "0113410567901384" },
/* 10*/ { BARCODE_DBAR_EXP, -1, "[01]12345678901231", 0, "(01)12345678901231", "" }, /* See test_hrt() in "test_gs1.c" for full HRT tests */
/* 11*/ { BARCODE_DBAR_EXP, BARCODE_CONTENT_SEGS, "[01]12345678901231", 0, "(01)12345678901231", "0112345678901231" },
- /* 12*/ { BARCODE_DBAR_STK, -1, "12345678901231", 0, "", "" }, /* No HRT for stacked */
- /* 13*/ { BARCODE_DBAR_STK, BARCODE_CONTENT_SEGS, "12345678901231", 0, "", "0112345678901231" }, /* But have content segs */
- /* 14*/ { BARCODE_DBAR_OMNSTK, -1, "10000000000090", 0, "", "" },
- /* 15*/ { BARCODE_DBAR_OMNSTK, BARCODE_CONTENT_SEGS, "10000000000090", 0, "", "0110000000000090" },
- /* 16*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231", 0, "", "" },
- /* 17*/ { BARCODE_DBAR_EXPSTK, BARCODE_CONTENT_SEGS, "[01]12345678901231", 0, "", "0112345678901231" },
+ /* 12*/ { BARCODE_DBAR_EXP, -1, "^0112345678901231", 0, "(01)12345678901231", "" },
+ /* 13*/ { BARCODE_DBAR_EXP, BARCODE_CONTENT_SEGS, "^0112345678901231", 0, "(01)12345678901231", "0112345678901231" },
+ /* 14*/ { BARCODE_DBAR_STK, -1, "12345678901231", 0, "", "" }, /* No HRT for stacked */
+ /* 15*/ { BARCODE_DBAR_STK, BARCODE_CONTENT_SEGS, "12345678901231", 0, "", "0112345678901231" }, /* But have content segs */
+ /* 16*/ { BARCODE_DBAR_OMNSTK, -1, "10000000000090", 0, "", "" },
+ /* 17*/ { BARCODE_DBAR_OMNSTK, BARCODE_CONTENT_SEGS, "10000000000090", 0, "", "0110000000000090" },
+ /* 18*/ { BARCODE_DBAR_EXPSTK, -1, "[01]12345678901231", 0, "", "" },
+ /* 19*/ { BARCODE_DBAR_EXPSTK, BARCODE_CONTENT_SEGS, "[01]12345678901231", 0, "", "0112345678901231" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -1441,16 +1443,16 @@ static void test_input(const testCtx *const p_ctx) {
/* 34*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[01)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 18 too long (maximum 14)", 0, 0 },
/* 35*/ { BARCODE_DBAR_LTD, -1, -1, -1, "[10]12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 18 too long (maximum 14)", 0, 0 },
/* 36*/ { BARCODE_DBAR_LTD, GS1NOCHECK_MODE, -1, -1, "22345678901238", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 384: Input value out of range (0 to 1999999999999)", 0, 0 },
- /* 37*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 0, 0 },
+ /* 37*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1'", 0, 0 },
/* 38*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 1, 134, "", 0, 0 },
/* 39*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231", 0, 1, 134, "", 0, 0 },
/* 40*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 },
/* 41*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 },
- /* 42*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01)", 0, 0 },
+ /* 42*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01) at position 1", 0, 0 },
/* 43*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 1, 151, "", 0, 0 },
- /* 44*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 0, 0 },
+ /* 44*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 1, 134, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1'", 0, 0 },
/* 45*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 1, 134, "", 0, 0 },
- /* 46*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", ZINT_WARN_NONCOMPLIANT, 1, 526, "Warning 261: AI (91) position 21: Invalid CSET 82 character ' '", 0, 0 }, /* ISOIEC punc */
+ /* 46*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", ZINT_WARN_NONCOMPLIANT, 1, 526, "Warning 261: AI (91) data position 21: Invalid CSET 82 character ' '", 0, 0 }, /* ISOIEC punc */
/* 47*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_ ", 0, 1, 526, "", 0, 0 },
/* 48*/ { BARCODE_DBAR_EXP, -1, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "", 0, 0 }, /* ISOIEC punc less space */
/* 49*/ { BARCODE_DBAR_EXP, GS1NOCHECK_MODE, -1, -1, "[01]12345678901231[91]!\"%&'()*+,-./:;<=>?_", 0, 1, 494, "", 0, 0 },
@@ -1486,12 +1488,12 @@ static void test_input(const testCtx *const p_ctx) {
/* 79*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(01)12345678901231", 0, 5, 50, "", 0, 0 }, /* Allow '(01)' prefix if check digit given */
/* 80*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(01)1234567890123", 0, 5, 50, "", 0, 0 }, /* Or not */
/* 81*/ { BARCODE_DBAR_OMNSTK, -1, -1, -1, "(00)12345678901231", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 18 too long (maximum 14)", 0, 0 },
- /* 82*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 102, "Warning 261: AI (01) position 14: Bad checksum '4', expected '1'", 2, 0 },
+ /* 82*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 102, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1'", 2, 0 },
/* 83*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]12345678901234", 0, 5, 102, "", 2, 0 },
/* 84*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]12345678901231", 0, 5, 102, "", 2, 0 },
/* 85*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]1234567890123A", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 385: Invalid character in Compressed Field data (digits only)", 0, 0 },
/* 86*/ { 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)", 0, 0 },
- /* 87*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01)", 0, 0 },
+ /* 87*/ { BARCODE_DBAR_EXPSTK, -1, -1, -1, "[01]123456789012315", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 259: Invalid data length for AI (01) at position 1", 0, 0 },
/* 88*/ { BARCODE_DBAR_EXPSTK, GS1NOCHECK_MODE, -1, -1, "[01]123456789012315", 0, 5, 102, "", 2, 0 },
/* 89*/ { BARCODE_DBAR_EXPSTK, -1, 12, -1, "[01]12345678901231", 0, 5, 102, "", 2, 0 }, /* Cols > 11 ignored */
/* 90*/ { BARCODE_DBAR_EXPSTK, -1, -1, 12, "[01]12345678901231", 0, 5, 102, "", 2, 0 }, /* Rows > 11 ignored */
diff --git a/backend/tests/test_ultra.c b/backend/tests/test_ultra.c
index 452fdd03..f9714acb 100644
--- a/backend/tests/test_ultra.c
+++ b/backend/tests/test_ultra.c
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2020-2025 Robin Stuart
+ Copyright (C) 2020-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -810,7 +810,7 @@ static void test_encode(const testCtx *const p_ctx) {
struct zint_symbol *symbol = NULL;
char escaped[1024];
- char bwipp_buf[32768];
+ char bwipp_buf[32768] ZINT_TESTUTIL_SANITIZEM_INIT;
char bwipp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
diff --git a/backend/tests/testcommon.c b/backend/tests/testcommon.c
index 600e0d12..df499aa7 100644
--- a/backend/tests/testcommon.c
+++ b/backend/tests/testcommon.c
@@ -570,6 +570,7 @@ const char *testUtilInputModeName(int input_mode) {
{ "FAST_MODE", FAST_MODE, 0x0080 },
{ "EXTRA_ESCAPE_MODE", EXTRA_ESCAPE_MODE, 0x0100 },
{ "GS1SYNTAXENGINE_MODE", GS1SYNTAXENGINE_MODE, 0x0200 },
+ { "GS1RAW_MODE", GS1RAW_MODE, 0x0400 },
};
const int data_size = ARRAY_SIZE(data);
int set, i;
@@ -2296,7 +2297,7 @@ int testUtilVerifyTiffInfo(const char *filename, int debug) {
/* Map Zint symbology to BWIPP routine */
static const char *testUtilBwippName(int index, const struct zint_symbol *symbol, int option_1, int option_2,
- int option_3, int debug, int *linear_row_height, int *gs1_cvt) {
+ int option_3, int debug, int *p_linear_row_height, int *p_gs1_cvt) {
struct item {
const char *name;
int define;
@@ -2324,7 +2325,7 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "ean13", BARCODE_EANX, 13, 0, 1, 0, 0, 1 /*gs1_cvt*/, },
{ "ean13", BARCODE_EANX_CHK, 14, 0, 1, 0, 0, 1, },
{ "ean13", BARCODE_EAN13, 15, 0, 1, 0, 0, 1, },
- { "gs1-128", BARCODE_GS1_128, 16, 0, 0, 0, 0, 1 /*gs1_cvt*/, },
+ { "gs1-128", BARCODE_GS1_128, 16, 0, 0, 1 /*GS1CARET*/, 0, 1 /*gs1_cvt*/, },
{ "", -1, 17, 0, 0, 0, 0, 0, },
{ "rationalizedCodabar", BARCODE_CODABAR, 18, 0, 1, 0, 0, 0, },
{ "", -1, 19, 0, 0, 0, 0, 0, },
@@ -2339,7 +2340,7 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "flattermarken", BARCODE_FLAT, 28, 0, 0, 0, 0, 0, },
{ "databaromni", BARCODE_DBAR_OMN, 29, 0, 0, 0, 0, 1 /*gs1_cvt*/, },
{ "databarlimited", BARCODE_DBAR_LTD, 30, 0, 0, 0, 0, 1, },
- { "databarexpanded", BARCODE_DBAR_EXP, 31, 0, 1, 0, 1 /*linear_row_height*/, 1, },
+ { "databarexpanded", BARCODE_DBAR_EXP, 31, 0, 1, 1 /*GS1CARET*/, 1 /*linear_row_height*/, 1, },
{ "telepen", BARCODE_TELEPEN, 32, 0, 0, 0, 0, 0, },
{ "", -1, 33, 0, 0, 0, 0, 0, },
{ "upca", BARCODE_UPCA, 34, 0, 1, 0, 0, 1 /*gs1_cvt*/, },
@@ -2380,7 +2381,7 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "isbn", BARCODE_ISBNX, 69, 0, 1, 0, 0, 1 /*gs1_cvt*/, },
{ "royalmail", BARCODE_RM4SCC, 70, 0, 0, 0, 0, 0, },
{ "datamatrix", BARCODE_DATAMATRIX, 71, 0, 1, 1, 1, 0, },
- { "ean14", BARCODE_EAN14, 72, 0, 0, 0, 0, 1 /*gs1_cvt*/, },
+ { "ean14", BARCODE_EAN14, 72, 0, 0, 1 /*GS1CARET*/, 0, 1 /*gs1_cvt*/, },
{ "code39", BARCODE_VIN, 73, 0, 0, 0, 0, 0, },
{ "codablockf", BARCODE_CODABLOCKF, 74, 1, 1, 0, 10 /*linear_row_height*/, 0, },
{ "sscc18", BARCODE_NVE18, 75, 0, 0, 0, 0, 1 /*gs1_cvt*/, },
@@ -2389,7 +2390,7 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "", -1, 78, 0, 0, 0, 0, 0, },
{ "databarstacked", BARCODE_DBAR_STK, 79, 0, 0, 0, 0, 1 /*gs1_cvt*/, },
{ "databarstackedomni", BARCODE_DBAR_OMNSTK, 80, 0, 0, 0, 33 /*linear_row_height*/, 1, },
- { "databarexpandedstacked", BARCODE_DBAR_EXPSTK, 81, 0, 1, 0, 34 /*linear_row_height*/, 1, },
+ { "databarexpandedstacked", BARCODE_DBAR_EXPSTK, 81, 0, 1, 1 /*GS1CARET*/, 34 /*linear_row_height*/, 1, },
{ "planet", BARCODE_PLANET, 82, 0, 0, 0, 0, 0, },
{ "", -1, 83, 0, 0, 0, 0, 0, },
{ "micropdf417", BARCODE_MICROPDF417, 84, 0, 1, 0, 0, 0, },
@@ -2439,15 +2440,15 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "aztecrune", BARCODE_AZRUNE, 128, 0, 0, 0, 0, 0, },
{ "code32", BARCODE_CODE32, 129, 0, 0, 0, 0, 0, },
{ "ean13composite", BARCODE_EANX_CC, 130, 1, 1, 0, 72 /*linear_row_height*/, 1 /*gs1_cvt*/, },
- { "gs1-128composite", BARCODE_GS1_128_CC, 131, 1, 0, 0, 36, 1, },
+ { "gs1-128composite", BARCODE_GS1_128_CC, 131, 1, 0, 1 /*GS1CARET*/, 36, 1, },
{ "databaromnicomposite", BARCODE_DBAR_OMN_CC, 132, 1, 0, 0, 33, 1, },
{ "databarlimitedcomposite", BARCODE_DBAR_LTD_CC, 133, 1, 0, 0, 10 /*linear_row_height*/, 1, },
- { "databarexpandedcomposite", BARCODE_DBAR_EXP_CC, 134, 1, 1, 0, 34 /*linear_row_height*/, 1, },
+ { "databarexpandedcomposite", BARCODE_DBAR_EXP_CC, 134, 1, 1, 1 /*GS1CARET*/, 34 /*linear_row_height*/, 1, },
{ "upcacomposite", BARCODE_UPCA_CC, 135, 1, 1, 0, 72, 1, },
{ "upcecomposite", BARCODE_UPCE_CC, 136, 1, 1, 0, 72, 1, },
{ "databarstackedcomposite", BARCODE_DBAR_STK_CC, 137, 1, 0, 0, 0, 1, },
{ "databarstackedomnicomposite", BARCODE_DBAR_OMNSTK_CC, 138, 1, 0, 0, 33 /*linear_row_height*/, 1, },
- { "databarexpandedstackedcomposite", BARCODE_DBAR_EXPSTK_CC, 139, 1, 1, 0, 34 /*linear_row_height*/, 1, },
+ { "databarexpandedstackedcomposite", BARCODE_DBAR_EXPSTK_CC, 139, 1, 1, 1 /*GS1CARET*/, 34 /*lin_r_h*/, 1, },
{ "channelcode", BARCODE_CHANNEL, 140, 0, 0, 0, 0, 0, },
{ "codeone", BARCODE_CODEONE, 141, 0, 1, 0, 0, 0, },
{ "", BARCODE_GRIDMATRIX, 142, 0, 0, 0, 0, 0, },
@@ -2462,7 +2463,9 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
const int data_size = ARRAY_SIZE(data);
const int symbology = symbol->symbology;
- const int gs1 = (symbol->input_mode & 0x07) == GS1_MODE;
+ const int gs1raw_mode = !!(symbol->input_mode & GS1RAW_MODE);
+ const int gs1_caret = option_3 != -1 && !!(option_3 & ZINT_TESTUTIL_GS1CARET); /* Hack indicator */
+ const int gs1 = (symbol->input_mode & 0x07) == GS1_MODE || gs1raw_mode || gs1_caret;
if (symbology < 0 || symbology >= data_size) {
fprintf(stderr, "testUtilBwippName: unknown symbology (%d)\n", symbology);
@@ -2544,16 +2547,30 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
}
}
- if (linear_row_height) {
- *linear_row_height = data[symbology].linear_row_height;
+ if (p_linear_row_height) {
+ *p_linear_row_height = data[symbology].linear_row_height;
}
- if (gs1_cvt) {
- *gs1_cvt = data[symbology].gs1_cvt;
+ if (p_gs1_cvt) {
+ *p_gs1_cvt = data[symbology].gs1_cvt;
}
if (gs1) {
+ if (gs1raw_mode) {
+ if (debug & ZINT_DEBUG_TEST_PRINT) {
+ printf("i:%d %s not BWIPP compatible, GS1RAW_MODE not supported\n",
+ index, testUtilBarcodeName(symbology));
+ }
+ return NULL;
+ }
+ if (gs1_caret) {
+ if (debug & ZINT_DEBUG_TEST_PRINT) {
+ printf("i:%d %s not BWIPP compatible, GS1 Syntax Engine caret input not supported\n",
+ index, testUtilBarcodeName(symbology));
+ }
+ return NULL;
+ }
if (symbology == BARCODE_DATAMATRIX) {
- if (gs1_cvt) {
- *gs1_cvt = 1;
+ if (p_gs1_cvt) {
+ *p_gs1_cvt = 1;
}
return "gs1datamatrix";
} else if (symbology == BARCODE_AZTEC || symbology == BARCODE_CODE16K || symbology == BARCODE_ULTRA
@@ -2564,13 +2581,13 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
}
return NULL;
} else if (symbology == BARCODE_QRCODE) {
- if (gs1_cvt) {
- *gs1_cvt = 1;
+ if (p_gs1_cvt) {
+ *p_gs1_cvt = 1;
}
return "gs1qrcode";
} else if (symbology == BARCODE_DOTCODE) {
- if (gs1_cvt) {
- *gs1_cvt = 1;
+ if (p_gs1_cvt) {
+ *p_gs1_cvt = 1;
}
return "gs1dotcode";
}
@@ -3876,8 +3893,8 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym
{ "", -1, 5, },
{ "", BARCODE_C25LOGIC, 6, },
{ "", BARCODE_C25IND, 7, },
- { "Code39", BARCODE_CODE39, 8, },
- { "Code39", BARCODE_EXCODE39, 9, }, /* TODO: Code39 with specially encoded chars */
+ { "Code39Std", BARCODE_CODE39, 8, },
+ { "Code39", BARCODE_EXCODE39, 9, },
{ "EAN8", BARCODE_EAN8, 10, },
{ "", BARCODE_EAN_2ADDON, 11, },
{ "", BARCODE_EAN_5ADDON, 12, },
@@ -3918,9 +3935,9 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym
{ "", BARCODE_MSI_PLESSEY, 47, },
{ "", -1, 48, },
{ "", BARCODE_FIM, 49, },
- { "Code39", BARCODE_LOGMARS, 50, },
+ { "Code39Std", BARCODE_LOGMARS, 50, },
{ "", BARCODE_PHARMA, 51, },
- { "Code39", BARCODE_PZN, 52, },
+ { "Code39Std", BARCODE_PZN, 52, },
{ "", BARCODE_PHARMA_TWO, 53, },
{ "", -1, 54, },
{ "PDF417", BARCODE_PDF417, 55, },
@@ -3941,7 +3958,7 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym
{ "", BARCODE_RM4SCC, 70, },
{ "DataMatrix", BARCODE_DATAMATRIX, 71, },
{ "Code128", BARCODE_EAN14, 72, },
- { "Code39", BARCODE_VIN, 73, },
+ { "Code39Std", BARCODE_VIN, 73, },
{ "CodablockF", BARCODE_CODABLOCKF, 74, },
{ "Code128", BARCODE_NVE18, 75, },
{ "", BARCODE_JAPANPOST, 76, },
@@ -3967,7 +3984,7 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym
{ "Code128", BARCODE_DPD, 96, },
{ "MicroQRCode", BARCODE_MICROQR, 97, },
{ "Code128", BARCODE_HIBC_128, 98, },
- { "Code39", BARCODE_HIBC_39, 99, },
+ { "Code39Std", BARCODE_HIBC_39, 99, },
{ "", -1, 100, },
{ "", -1, 101, },
{ "DataMatrix", BARCODE_HIBC_DM, 102, },
@@ -4127,12 +4144,12 @@ int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source,
if (symbology == BARCODE_EXCODE39) {
if (symbol->option_2 == 1) {
- opts = "tryCode39ExtendedMode,validateCode39CheckSum";
+ opts = "tryCode39ExtendedMode,validateOptionalChecksum";
} else {
opts = "tryCode39ExtendedMode";
}
} else if ((symbology == BARCODE_CODE39 || symbology == BARCODE_LOGMARS) && symbol->option_2 == 1) {
- opts = "validateCode39CheckSum";
+ opts = "validateOptionalChecksum";
}
if (zxingcpp_cmp > 1 && symbol->eci == 0) {
@@ -4283,8 +4300,8 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in
const int is_extra_escaped = (symbol->input_mode & EXTRA_ESCAPE_MODE) && symbol->symbology == BARCODE_CODE128;
const int is_escaped = (symbol->input_mode & ESCAPE_MODE) || is_extra_escaped;
const int is_hibc = symbology >= BARCODE_HIBC_128 && symbology <= BARCODE_HIBC_AZTEC;
- const int have_c25checkdigit = symbol->option_2 == 1 || symbol->option_2 == 2;
- const int have_c25inter = (symbology == BARCODE_C25INTER && ((expected_len & 1) || have_c25checkdigit))
+ const int have_ccheckdigit = symbol->option_2 == 1 || symbol->option_2 == 2; /* Good for C25, CODE39, CODABAR */
+ const int have_c25inter = (symbology == BARCODE_C25INTER && ((expected_len & 1) || have_ccheckdigit))
|| symbology == BARCODE_ITF14 || symbology == BARCODE_DPLEIT
|| symbology == BARCODE_DPIDENT;
const int is_upcean = (ZBarcode_Cap(symbology, ZINT_CAP_EANUPC) & ZINT_CAP_EANUPC) == ZINT_CAP_EANUPC;
@@ -4362,7 +4379,7 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in
expected = escaped;
}
if (gs1 && symbology != BARCODE_EAN14 && symbology != BARCODE_NVE18) {
- ret = zint_gs1_verify(symbol, ZUCP(expected), expected_len, ZUCP(reduced), &expected_len);
+ ret = zint_gs1_verify(symbol, ZUCP(expected), expected_len, ZUCP(reduced), &expected_len, 0 /*set_hrt*/);
if (ret >= ZINT_ERROR) {
sprintf(msg, "zint_gs1_verify %d != 0", ret);
return 3;
@@ -4441,7 +4458,7 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in
cmp_len -= 2;
expected++;
expected_len -= 2;
- if (symbol->option_2 == 1 || symbol->option_2 == 2) {
+ if (have_ccheckdigit) {
cmp_len--; /* Too messy to calc the check digit so ignore */
}
} else if (is_vin_international) {
@@ -4451,15 +4468,15 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in
expected = vin;
} else if (have_c25inter) {
if (symbology == BARCODE_C25INTER) {
- if ((expected_len & 1) || have_c25checkdigit) {
- if (((expected_len & 1) && !have_c25checkdigit) || (!(expected_len & 1) && have_c25checkdigit)) {
+ if ((expected_len & 1) || have_ccheckdigit) {
+ if (((expected_len & 1) && !have_ccheckdigit) || (!(expected_len & 1) && have_ccheckdigit)) {
c25inter[0] = '0';
memcpy(c25inter + 1, expected, expected_len);
expected_len++;
} else {
memcpy(c25inter, expected, expected_len);
}
- if (have_c25checkdigit) {
+ if (have_ccheckdigit) {
c25inter[expected_len] = zint_gs1_check_digit((const unsigned char *) c25inter, expected_len);
expected_len++;
}
@@ -4652,6 +4669,9 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in
expected = azrune;
expected_len = 3;
}
+ } else if ((symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39 || symbology == BARCODE_LOGMARS)
+ && have_ccheckdigit) {
+ cmp_len--; /* Too tedious to calculate so ignore */
}
if (ret_buf) {
diff --git a/backend/tests/testcommon.h b/backend/tests/testcommon.h
index 5264f2f0..a8e23d09 100644
--- a/backend/tests/testcommon.h
+++ b/backend/tests/testcommon.h
@@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
- Copyright (C) 2019-2025 Robin Stuart
+ Copyright (C) 2019-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -49,6 +49,17 @@ extern "C" {
#define ZINT_DEBUG_TEST_ZXINGCPP 512
#define ZINT_DEBUG_TEST_BWIPP_ZXINGCPP 1024
+#ifdef ZINT_SANITIZEM /* Suppress clang -fsanitize=memory false positives */
+#define ZINT_TESTUTIL_SANITIZEM_INIT = {0}
+#define ZINT_TESTUTIL_SANITIZEM_INIT_2D = {{0}}
+#else
+#define ZINT_TESTUTIL_SANITIZEM_INIT
+#define ZINT_TESTUTIL_SANITIZEM_INIT_2D
+#endif
+
+/* Hack `option_3` flag to indicate GS1 Syntax Engine caret input */
+#define ZINT_TESTUTIL_GS1CARET (1 << 24)
+
#include
#include
#include "../common.h"
diff --git a/backend/tests/tools/bwipp_dump.ps.tar.xz b/backend/tests/tools/bwipp_dump.ps.tar.xz
index ff7f1368..2ca128fc 100644
Binary files a/backend/tests/tools/bwipp_dump.ps.tar.xz and b/backend/tests/tools/bwipp_dump.ps.tar.xz differ
diff --git a/backend/tools/gen_gs1_lint.php b/backend/tools/gen_gs1_lint.php
index c38315d1..f8ff13ac 100644
--- a/backend/tools/gen_gs1_lint.php
+++ b/backend/tools/gen_gs1_lint.php
@@ -2,7 +2,7 @@
/* Generate GS1 verify include "backend/gs1_lint.h" for "backend/gs1.c" */
/*
libzint - the open source barcode library
- Copyright (C) 2021-2025
+ Copyright (C) 2021-2026
*/
/* SPDX-License-Identifier: BSD-3-Clause */
@@ -76,8 +76,8 @@ foreach ($lines as $line) {
}
if (($hyphen = strpos($ai, '-')) !== false) {
- if ($fixed !== '') {
- $fixed_ais[substr($ai, 0, 2)] = true;
+ if ($fixed) {
+ $fixed_ais[substr($ai, 0, 2)] = strlen(substr($ai, 0, $hyphen));
}
$ai_s = (int) substr($ai, 0, $hyphen);
$ai_e = (int) substr($ai, $hyphen + 1);
@@ -98,8 +98,8 @@ foreach ($lines as $line) {
}
}
} else {
- if ($fixed !== '') {
- $fixed_ais[substr($ai, 0, 2)] = true;
+ if ($fixed) {
+ $fixed_ais[substr($ai, 0, 2)] = strlen($ai);
}
$ai = (int) $ai;
$ais[] = $ai;
@@ -243,7 +243,7 @@ if ($print_copyright) {
print <<<'EOD'
/*
libzint - the open source barcode library
- Copyright (C) 2021-2025 Robin Stuart
+ Copyright (C) 2021-2026 Robin Stuart
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -365,6 +365,7 @@ $tab$tab{$tab}char err_msg[50]) {
$tab/* Assume data length failure */
$tab*p_err_no = 2;
+$tab*p_err_posn = 1;
EOD;
@@ -477,6 +478,237 @@ $tab}
EOD;
+print <<= length || !z_isdigit(source[position]) || !z_isdigit(source[position + 1])) {
+$tab{$tab}return 0;
+{$tab}}
+{$tab}ai2 = z_to_int(source + position, 2);
+{$tab}if (position + 3 < length && z_isdigit(source[position + 2])) {
+$tab{$tab}ai3 = z_to_int(source + position, 3);
+$tab{$tab}if (position + 4 < length && z_isdigit(source[position + 3])) {
+$tab$tab{$tab}ai4 = z_to_int(source + position, 4);
+$tab{$tab}}
+{$tab}}
+
+EOD;
+
+$not_first_batch = false;
+$last_batch_e = -1;
+$big_batch = 2;
+foreach ($batches as $batch => $batch_specs) {
+ if (empty($batch_specs)) {
+ continue;
+ }
+ $batch_s = $batch * 100;
+ $batch_e = $batch_s + 100;
+ $n = $batch_s < 100 ? 2 : ($batch_s < 1000 ? 3 : 4);
+ $first_tab = $n == 2 ? "" : $tab . $tab;
+ if ($n == 2) {
+ print "\n{$first_tab}{$tab}ai = ai2;\n";
+ } else {
+ if ($n != $big_batch) {
+ if ($n == 3) {
+ print "\n{$tab}if (max == 0 && ai3 != -1) {\n";
+ } else {
+ print "{$first_tab}}\n\n{$tab}}\n\n{$tab}if (max == 0 && ai4 != -1) {\n";
+ }
+ $not_first_batch = false;
+ }
+ if ($not_first_batch) {
+ print "\n$first_tab} else if (ai" . $n. " < $batch_e) {\n{$first_tab}{$tab}ai = ai" . $n . ";\n";
+ } else {
+ print "\n{$first_tab}if (ai" . $n . " < $batch_e) {\n{$first_tab}{$tab}ai = ai" . $n . ";\n";
+ $not_first_batch = true;
+ }
+ }
+ $not_first_spec = false;
+ foreach ($batch_specs as $spec) {
+ $total_min = $spec_ais[$spec][0];
+ $total_max = $spec_ais[$spec][1];
+ $ais = $spec_ais[$spec][2];
+
+ if ($not_first_spec) {
+ $str = "$first_tab{$tab}} else if (";
+ } else {
+ $str = "$first_tab{$tab}if (";
+ $not_first_spec = true;
+ }
+ print $str;
+ $width = strlen($str);
+
+ // Count the applicable AIs
+ $ais_cnt = 0;
+ foreach ($ais as $ai) {
+ if (is_array($ai)) {
+ if ($ai[1] < $batch_s || $ai[0] >= $batch_e) {
+ continue;
+ }
+ } else {
+ if ($ai < $batch_s || $ai >= $batch_e) {
+ continue;
+ }
+ }
+ $ais_cnt++;
+ }
+
+ // Output
+ $not_first_ai = false;
+ foreach ($ais as $ai) {
+ if (is_array($ai)) {
+ if ($ai[1] < $batch_s || $ai[0] >= $batch_e) {
+ continue;
+ }
+ } else {
+ if ($ai < $batch_s || $ai >= $batch_e) {
+ continue;
+ }
+ }
+
+ $str = '';
+ if ($not_first_ai) {
+ $str .= " || ";
+ } else {
+ $not_first_ai = true;
+ }
+ if (is_array($ai)) {
+ if ($ai[0] === $last_batch_e) { // Don't need 1st element of range if excluded by previous batch
+ $str .= "ai <= " . $ai[1];
+ } else if ($ai[1] + 1 == $batch_e) { // Don't need 2nd element of range if excluded by this batch
+ $str .= "ai >= " . $ai[0];
+ } else {
+ if ($ais_cnt > 1) {
+ $str .= "(ai >= " . $ai[0] . " && ai <= " . $ai[1] . ")";
+ } else {
+ $str .= "ai >= " . $ai[0] . " && ai <= " . $ai[1];
+ }
+ }
+ } else {
+ $str .= "ai == " . $ai;
+ }
+ if ($width + strlen($str) > 118) {
+ print "\n";
+ $str2 = "$first_tab$tab$tab ";
+ print $str2;
+ $width = strlen($str2);
+ }
+ print $str;
+ $width += strlen($str);
+ }
+ list($min, $max) = $spec_ais[$spec];
+ $str = "$first_tab$tab{$tab}min = $min, max = $max;";
+ print ") {\n$str\n";
+ print <<= 0 && ai <= 9999);
+{$tab}assert(min >= 1);
+{$tab}assert(max >= min);
+
+{$tab}*p_ai = ai;
+{$tab}if (p_min) {
+$tab{$tab}*p_min = min;
+{$tab}}
+{$tab}if (p_max) {
+$tab{$tab}*p_max = max;
+{$tab}}
+{$tab}return 1;
+}
+
+/* Parse non-bracketed input */
+static int gs1_lint_parse_raw_caret(const unsigned char source[], const int length,
+$tab$tab{$tab}const int ai_max, int *ai_vals, int *ai_locs, int *data_locs, int *data_lens, int *p_ai_count,
+$tab$tab{$tab}int *p_err_no, int *p_err_posn) {
+{$tab}int i, j;
+{$tab}const int gs1_caret = source[0] == '^';
+{$tab}const unsigned char separator = gs1_caret ? '^' : '\\x1D';
+{$tab}int ai, max;
+{$tab}int ai_count = 0, ai_len;
+{$tab}#ifdef NDEBUG
+{$tab}(void)ai_max;
+{$tab}#endif
+
+{$tab}i = gs1_caret || source[0] == '\\x1D'; /* Allow GS at start also */
+
+{$tab}if (i >= length) {
+$tab{$tab}*p_ai_count = 0; /* For feedback */
+$tab{$tab}ai_vals[0] = -1;
+$tab{$tab}ai_locs[0] = i - 1;
+$tab{$tab}*p_err_no = 1;
+$tab{$tab}*p_err_posn = i;
+$tab{$tab}return 0;
+{$tab}}
+
+{$tab}while (i < length) {
+$tab{$tab}int data_start, data_max, on_separator;
+$tab{$tab}assert(ai_count < ai_max);
+$tab{$tab}ai_locs[ai_count] = i;
+$tab{$tab}if (!gs1_lint_parse_ai(source, length, i, &ai, NULL /*min*/, &max)) {
+$tab$tab{$tab}*p_ai_count = ai_count; /* For feedback */
+$tab$tab{$tab}ai_vals[ai_count] = ai; /* May be -1 */
+$tab$tab{$tab}*p_err_no = 1;
+$tab$tab{$tab}*p_err_posn = i + 1; /* Position 1-base */
+$tab$tab{$tab}return 0;
+$tab{$tab}}
+$tab{$tab}ai_vals[ai_count] = ai;
+$tab{$tab}ai_len = ai < 100 ? 2 : ai < 1000 ? 3 : 4;
+
+$tab{$tab}/* Following GS1 Syntax Engine tolerating superfluous FNC1s at end of AI data
+$tab{$tab} (for both final AI and AIs with predefined length) */
+$tab{$tab}data_start = i + ai_len;
+$tab{$tab}data_max = data_start + max;
+$tab{$tab}for (j = data_start; j < length && j < data_max; j++) {
+$tab$tab{$tab}if (source[j] == separator) {
+$tab$tab$tab{$tab}break;
+$tab$tab{$tab}}
+$tab{$tab}}
+$tab{$tab}data_locs[ai_count] = data_start;
+$tab{$tab}/* Only checking that have at least one char, and haven't exceeded max */
+$tab{$tab}on_separator = j < length && source[j] == separator;
+$tab{$tab}if (j == data_start || (j + 1 == length && length > data_max && !on_separator)) {
+$tab$tab{$tab}*p_ai_count = ai_count; /* For feedback */
+$tab$tab{$tab}data_lens[ai_count] = j - data_start;
+$tab$tab{$tab}*p_err_no = 2;
+$tab$tab{$tab}*p_err_posn = i + 1; /* Position 1-base */
+$tab$tab{$tab}return 0;
+$tab{$tab}}
+$tab{$tab}data_lens[ai_count] = j - data_locs[ai_count];
+$tab{$tab}ai_count++;
+$tab{$tab}i = j + on_separator;
+{$tab}}
+
+{$tab}*p_ai_count = ai_count;
+{$tab}return 1;
+}
+
+EOD;
+
if ($print_h_guard) {
print <<<'EOD'
diff --git a/backend/zint.h b/backend/zint.h
index f0a52afe..a4974159 100644
--- a/backend/zint.h
+++ b/backend/zint.h
@@ -326,6 +326,7 @@ extern "C" {
#define EXTRA_ESCAPE_MODE 0x0100 /* Process special symbology-specific escape sequences as well as others */
/* Note: currently Code 128 only */
#define GS1SYNTAXENGINE_MODE 0x0200 /* Use the GS1 Syntax Engine (if available) to strictly validate GS1 input */
+#define GS1RAW_MODE 0x0400 /* Process GS1 data literally (no AI delimiters), parsing GSs as FNC1s */
/* Aztec Code specific options (`symbol->option_3`) */
#define ZINT_AZTEC_FULL 128 /* Only consider Full versions on automatic symbol size selection */
diff --git a/backend_qt/qzint.cpp b/backend_qt/qzint.cpp
index b612fbf5..7e9da102 100644
--- a/backend_qt/qzint.cpp
+++ b/backend_qt/qzint.cpp
@@ -199,7 +199,7 @@ namespace Zint {
m_compliant_height(false),
m_rotate_angle(0),
m_eci(0),
- m_gs1parens(false), m_gs1nocheck(false), m_gs1syntaxengine(false),
+ m_gs1parens(false), m_gs1nocheck(false), m_gs1raw(false), m_gs1syntaxengine(false),
m_reader_init(false),
m_guard_whitespace(false),
m_embed_vector_font(false),
@@ -278,6 +278,9 @@ namespace Zint {
if (m_gs1nocheck) {
m_zintSymbol->input_mode |= GS1NOCHECK_MODE;
}
+ if (m_gs1raw) {
+ m_zintSymbol->input_mode |= GS1RAW_MODE;
+ }
if (m_gs1syntaxengine) {
m_zintSymbol->input_mode |= GS1SYNTAXENGINE_MODE;
}
@@ -741,6 +744,15 @@ namespace Zint {
m_gs1nocheck = gs1NoCheck;
}
+ /* Process as raw GS1 input (no brackets/parentheses), with separator GS for FNC1 */
+ bool QZint::gs1Raw() const {
+ return m_gs1raw;
+ }
+
+ void QZint::setGS1Raw(bool gs1Raw) {
+ m_gs1raw = gs1Raw;
+ }
+
/* Use GS1 Syntax Engine to validate GS1 data */
bool QZint::gs1SyntaxEngine() const {
return m_gs1syntaxengine;
@@ -1394,12 +1406,16 @@ namespace Zint {
if (supportsGS1()) {
bool gs1_implied = false;
+ if (gs1NoCheck() || (inputMode() & GS1NOCHECK_MODE)) {
+ arg_bool(cmd, "--gs1nocheck", (gs1_implied = true));
+ }
if (gs1Parens() || (inputMode() & GS1PARENS_MODE)) {
arg_bool(cmd, "--gs1parens", (gs1_implied = true));
}
- if (gs1NoCheck() || (inputMode() & GS1NOCHECK_MODE)) {
- arg_bool(cmd, "--gs1nocheck", (gs1_implied = true));
- } else if (gs1SyntaxEngine() || (inputMode() & GS1SYNTAXENGINE_MODE)) {
+ if (gs1Raw() || (inputMode() & GS1RAW_MODE)) {
+ arg_bool(cmd, "--gs1raw", (gs1_implied = true));
+ }
+ if (gs1SyntaxEngine() || (inputMode() & GS1SYNTAXENGINE_MODE)) {
arg_bool(cmd, "--gs1strict", (gs1_implied = true));
}
arg_bool(cmd, "--gs1", (inputMode() & 0x07) == GS1_MODE && !gs1_implied);
diff --git a/backend_qt/qzint.h b/backend_qt/qzint.h
index 08768061..294b0363 100644
--- a/backend_qt/qzint.h
+++ b/backend_qt/qzint.h
@@ -1,7 +1,7 @@
/***************************************************************************
* Copyright (C) 2008 by BogDan Vatra *
* bogdan@licentia.eu *
- * Copyright (C) 2010-2025 Robin Stuart *
+ * Copyright (C) 2010-2026 Robin Stuart *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -208,6 +208,10 @@ public:
bool gs1NoCheck() const; // `symbol->input_mode | GS1NOCHECK_MODE`
void setGS1NoCheck(bool gs1NoCheck);
+ /* Process as raw GS1 input (no brackets/parentheses), with separator GS for FNC1 */
+ bool gs1Raw() const; // `symbol->input_mode | GS1RAW_MODE`
+ void setGS1Raw(bool gs1Raw);
+
/* Use GS1 Syntax Engine to validate GS1 data */
bool gs1SyntaxEngine() const; // `symbol->input_mode | GS1SYNTAXENGINE_MODE`
void setGS1SyntaxEngine(bool gs1SyntaxEngine);
@@ -402,6 +406,7 @@ private:
int m_eci;
bool m_gs1parens;
bool m_gs1nocheck;
+ bool m_gs1raw;
bool m_gs1syntaxengine;
bool m_reader_init;
bool m_guard_whitespace;
diff --git a/backend_qt/tests/test_qzint.cpp b/backend_qt/tests/test_qzint.cpp
index 08e74f31..8071af15 100644
--- a/backend_qt/tests/test_qzint.cpp
+++ b/backend_qt/tests/test_qzint.cpp
@@ -288,6 +288,10 @@ private slots:
bc.setGS1NoCheck(gs1NoCheck);
QCOMPARE(bc.gs1NoCheck(), gs1NoCheck);
+ bool gs1Raw = true;
+ bc.setGS1Raw(gs1Raw);
+ QCOMPARE(bc.gs1Raw(), gs1Raw);
+
bool gs1SyntaxEngine = true;
bc.setGS1SyntaxEngine(gs1SyntaxEngine);
QCOMPARE(bc.gs1SyntaxEngine(), gs1SyntaxEngine);
@@ -656,6 +660,7 @@ private slots:
QTest::addColumn("option2");
QTest::addColumn("option3");
QTest::addColumn("scale");
+
QTest::addColumn("dpmm");
QTest::addColumn("dotty");
QTest::addColumn("dotSize");
@@ -688,7 +693,9 @@ private slots:
QTest::addColumn("eci");
QTest::addColumn("gs1Parens");
QTest::addColumn("gs1NoCheck");
+ QTest::addColumn("gs1Raw");
QTest::addColumn("gs1SyntaxEngine");
+
QTest::addColumn("readerInit");
QTest::addColumn("guardWhitespace");
QTest::addColumn("embedVectorFont");
@@ -712,12 +719,14 @@ private slots:
QTest::newRow("BARCODE_AUSPOST") << true << 0.0f << ""
<< BARCODE_AUSPOST << DATA_MODE // symbology-inputMode
<< "12345678" << "" // text-primary
- << 30.0f << -1 << 0 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 30.0f << -1 << 0 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 63 --binary --compliantheight -d '12345678'"
<< "zint.exe -b 63 --binary --compliantheight -d \"12345678\""
@@ -729,12 +738,14 @@ private slots:
QTest::newRow("BARCODE_AZTEC") << false << 0.0f << ""
<< BARCODE_AZTEC << UNICODE_MODE // symbology-inputMode
<< "12345678Ж0%var%" << "" // text-primary
- << 0.0f << 1 << 0 << ZINT_AZTEC_FULL << 4.0f << 0.0f << true << 0.9f << 1.0f // height-textGap
+ << 0.0f << 1 << 0 << ZINT_AZTEC_FULL << 4.0f // height-scale
+ << 0.0f << true << 0.9f << 1.0f // dpmm-textGap
<< 5.0f << 2 << 1 << "as\"dfa'sdf" // guardDescent-structAppID
<< "" << "" << QColor(Qt::blue) << QColor(Qt::white) << true // fgStr-cmyk
<< 0 << 0 << 2 << 3 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << false << 0 // showText-rotateAngle
- << 7 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 7 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 92 --azfull --cmyk --eci=7 -d '12345678Ж0%var%' --dotsize=0.9 --dotty --fg=0000FF"
" --scale=4 --secure=1 --structapp='1,2,as\"dfa'\\''sdf' --vwhitesp=3 -w 2"
@@ -745,12 +756,14 @@ private slots:
QTest::newRow("BARCODE_AZTEC (bgStr CMYK, fgStr CMYK)") << false << 0.0f << ""
<< BARCODE_AZTEC << UNICODE_MODE // symbology-inputMode
<< "12345678Ж0%var%" << "" // text-primary
- << 0.0f << 1 << 0 << 0 << 4.0f << 0.0f << true << 0.9f << 1.0f // height-textGap
+ << 0.0f << 1 << 0 << 0 << 4.0f // height-scale
+ << 0.0f << true << 0.9f << 1.0f // dpmm-textGap
<< 5.0f << 2 << 1 << "as\"dfa'sdf" // guardDescent-structAppID
<< "71,0,40,44" << "0,0,0,0" << QColor(Qt::black) << QColor(Qt::white) << true // fgStr-cmyk
<< 0 << 0 << 2 << 3 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << false << 0 // showText-rotateAngle
- << 7 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 7 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 92 --bg=0,0,0,0 --cmyk --eci=7 -d '12345678Ж0%var%' --dotsize=0.9 --dotty --fg=71,0,40,44 --scale=4"
" --secure=1 --structapp='1,2,as\"dfa'\\''sdf' --vwhitesp=3 -w 2"
@@ -761,12 +774,14 @@ private slots:
QTest::newRow("BARCODE_C25INTER") << true << 0.0f << ""
<< BARCODE_C25INTER << UNICODE_MODE // symbology-inputMode
<< "12345" << "" // text-primary
- << 0.0f << -1 << 2 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << 2 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << SMALL_TEXT // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 3 --compliantheight -d '12345' --small --vers=2"
<< "zint.exe -b 3 --compliantheight -d \"12345\" --small --vers=2"
@@ -775,12 +790,14 @@ private slots:
QTest::newRow("BARCODE_CHANNEL") << false << 0.0f << ""
<< BARCODE_CHANNEL << UNICODE_MODE // symbology-inputMode
<< "453678" << "" // text-primary
- << 19.7f << -1 << 7 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 19.7f << -1 << 7 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(255, 255, 255, 0) << false // fgStr-cmyk
<< 1 << 2 << 0 << 0 << BOLD_TEXT // borderTypeIndex-fontSetting
<< true << false << true << false << false << 90 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << true // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << true // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 140 --bind --bold --border=2 -d '453678' --height=19.7 --nobackground --quietzones"
" --rotate=90 --verbose --vers=7"
@@ -791,12 +808,14 @@ private slots:
QTest::newRow("BARCODE_CHANNEL (bgStr FFFFFF00)") << false << 0.0f << ""
<< BARCODE_CHANNEL << UNICODE_MODE // symbology-inputMode
<< "453678" << "" // text-primary
- << 19.7f << -1 << 7 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 19.7f << -1 << 7 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "FFFFFF00" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 1 << 2 << 0 << 0 << BOLD_TEXT // borderTypeIndex-fontSetting
<< true << false << true << false << false << 90 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << true // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << true // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 140 --bind --bold --border=2 -d '453678' --height=19.7 --nobackground --quietzones"
" --rotate=90 --verbose --vers=7"
@@ -807,12 +826,14 @@ private slots:
QTest::newRow("BARCODE_CHANNEL (bgStr 12345600)") << false << 0.0f << ""
<< BARCODE_CHANNEL << UNICODE_MODE // symbology-inputMode
<< "453678" << "" // text-primary
- << 19.7f << -1 << 7 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 19.7f << -1 << 7 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "12345600" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 1 << 2 << 0 << 0 << BOLD_TEXT // borderTypeIndex-fontSetting
<< true << false << true << false << false << 90 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << true // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << true // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 140 --bind --bold --border=2 -d '453678' --height=19.7 --nobackground --quietzones"
" --rotate=90 --verbose --vers=7"
@@ -823,12 +844,14 @@ private slots:
QTest::newRow("BARCODE_CODE128") << false << 0.0f << ""
<< BARCODE_CODE128 << (UNICODE_MODE | EXTRA_ESCAPE_MODE) // symbology-inputMode
<< "1234\\^A56" << "" // text-primary
- << 0.0f << -1 << 0 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< false << false << true << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 20 -d '1234\\^A56' --extraesc --notext --quietzones"
<< "zint.exe -b 20 -d \"1234\\^A56\" --extraesc --notext --quietzones"
@@ -837,12 +860,14 @@ private slots:
QTest::newRow("BARCODE_GS1_128_CC") << false << 0.0f << ""
<< BARCODE_GS1_128_CC << UNICODE_MODE // symbology-inputMode
<< "[01]12345678901231[15]121212" << "[11]901222[99]ABCDE" // text-primary
- << 71.142f << 3 << 0 << 0 << 3.5f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 71.142f << 3 << 0 << 0 << 3.5f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< false << false << true << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 131 --compliantheight -d '[11]901222[99]ABCDE' --height=71.142 --mode=3 --notext"
" --primary='[01]12345678901231[15]121212' --quietzones --scale=3.5"
@@ -853,12 +878,14 @@ private slots:
QTest::newRow("BARCODE_CODE16K") << false << 11.7f << ""
<< BARCODE_CODE16K << (UNICODE_MODE | HEIGHTPERROW_MODE) // symbology-inputMode
<< "12345678901234567890123456789012" << "" // text-primary
- << 0.0f << 4 << 0 << 2 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 0.0f << 4 << 0 << 2 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 1 << 1 << 0 << 0 << SMALL_TEXT // borderTypeIndex-fontSetting
<< true << false << false << true << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 23 --compliantheight -d '12345678901234567890123456789012'"
" --height=11.7 --heightperrow --noquietzones --rows=4 --separator=2 --small"
@@ -869,12 +896,14 @@ private slots:
QTest::newRow("BARCODE_CODE49") << true << 0.0f << ""
<< BARCODE_CODE49 << UNICODE_MODE // symbology-inputMode
<< "12345678901234567890" << "" // text-primary
- << 30.0f << -1 << 0 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 30.0f << -1 << 0 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 24 --compliantheight -d '12345678901234567890'"
<< "zint.exe -b 24 --compliantheight -d \"12345678901234567890\""
@@ -883,12 +912,14 @@ private slots:
QTest::newRow("BARCODE_CODABLOCKF") << true << 0.0f << ""
<< BARCODE_CODABLOCKF << (DATA_MODE | ESCAPE_MODE) // symbology-inputMode
<< "T\\n\\xA0t\\\"" << "" // text-primary
- << 0.0f << 2 << 5 << 3 << 3.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 0.0f << 2 << 5 << 3 << 3.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 2 << 4 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << true << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << true << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 74 --binary --border=4 --box --cols=5 --compliantheight -d 'T\\n\\xA0t\\\"' --esc --init"
" --rows=2 --scale=3 --separator=3"
@@ -899,12 +930,14 @@ private slots:
QTest::newRow("BARCODE_DAFT") << false << 0.0f << ""
<< BARCODE_DAFT << UNICODE_MODE // symbology-inputMode
<< "daft" << "" // text-primary
- << 9.2f << -1 << 251 << 0 << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 9.2f << -1 << 251 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(0x30, 0x31, 0x32, 0x33) << QColor(0xBF, 0xBE, 0xBD, 0xBC) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 93 --bg=BFBEBDBC -d 'daft' --fg=30313233 --height=9.2 --vers=251"
<< "zint.exe -b 93 --bg=BFBEBDBC -d \"daft\" --fg=30313233 --height=9.2 --vers=251"
@@ -913,68 +946,94 @@ private slots:
QTest::newRow("BARCODE_DATAMATRIX (GS1)") << true << 0.0f << ""
<< BARCODE_DATAMATRIX << GS1_MODE // symbology-inputMode
<< "[20]12" << "" // text-primary
- << 0.0f << -1 << 0 << DM_SQUARE << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << DM_SQUARE << 1.0f // height-scale
+ << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << true << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 71 -d '[20]12' --gs1 --gssep --square"
<< "zint.exe -b 71 -d \"[20]12\" --gs1 --gssep --square"
<< "" << "" << "" << "";
- QTest::newRow("BARCODE_DATAMATRIX (GS1Parens + Strict)") << true << 0.0f << ""
+ QTest::newRow("BARCODE_DATAMATRIX (GS1Parens + GS1SyntaxEngine)") << true << 0.0f << ""
<< BARCODE_DATAMATRIX << GS1_MODE // symbology-inputMode
<< "[20]12" << "" // text-primary
- << 0.0f << -1 << 0 << DM_SQUARE << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << DM_SQUARE << 1.0f // height-scale
+ << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << true << false << false << true << 0 // showText-rotateAngle
- << 0 << true << false << true << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << true << false << false << true // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 71 -d '[20]12' --gs1parens --gs1strict --gssep --square"
<< "zint.exe -b 71 -d \"[20]12\" --gs1parens --gs1strict --gssep --square"
<< "" << "" << "" << "";
- QTest::newRow("BARCODE_DATAMATRIX (GS1Strict)") << true << 0.0f << ""
+ QTest::newRow("BARCODE_DATAMATRIX (GS1SyntaxEngine)") << true << 0.0f << ""
<< BARCODE_DATAMATRIX << GS1_MODE // symbology-inputMode
<< "[20]12" << "" // text-primary
- << 0.0f << -1 << 0 << DM_SQUARE << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << DM_SQUARE << 1.0f // height-scale
+ << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << true << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << true << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << true // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 71 -d '[20]12' --gs1strict --gssep --square"
<< "zint.exe -b 71 -d \"[20]12\" --gs1strict --gssep --square"
<< "" << "" << "" << "";
- QTest::newRow("BARCODE_DATAMATRIX (GS1NoCheck + Strict (ignored))") << true << 0.0f << ""
+ QTest::newRow("BARCODE_DATAMATRIX (GS1NoCheck + GS1SyntaxEngine)") << true << 0.0f << ""
<< BARCODE_DATAMATRIX << GS1_MODE // symbology-inputMode
<< "[20]12" << "" // text-primary
- << 0.0f << -1 << 0 << DM_SQUARE << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << DM_SQUARE << 1.0f // height-scale
+ << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << true << false << false << true << 0 // showText-rotateAngle
- << 0 << false << true << true << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << true << false << true // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
- << "zint -b 71 -d '[20]12' --gs1nocheck --gssep --square"
- << "zint.exe -b 71 -d \"[20]12\" --gs1nocheck --gssep --square"
+ << "zint -b 71 -d '[20]12' --gs1nocheck --gs1strict --gssep --square"
+ << "zint.exe -b 71 -d \"[20]12\" --gs1nocheck --gs1strict --gssep --square"
+ << "" << "" << "" << "";
+
+ QTest::newRow("BARCODE_DATAMATRIX (GS1Raw + GS1SyntaxEngine)") << true << 0.0f << ""
+ << BARCODE_DATAMATRIX << (GS1_MODE | ESCAPE_MODE) // symbology-inputMode
+ << "010952012345678810BATCH4\\G2107" << "" // text-primary
+ << 0.0f << -1 << 0 << DM_SQUARE << 1.0f // height-scale
+ << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
+ << 5.0f << 0 << 0 << "" // guardDescent-structAppID
+ << "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
+ << 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
+ << true << true << false << false << true << 0 // showText-rotateAngle
+ << 0 << false << false << true << true // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
+ << 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
+ << "zint -b 71 -d '010952012345678810BATCH4\\G2107' --esc --gs1raw --gs1strict --gssep --square"
+ << "zint.exe -b 71 -d \"010952012345678810BATCH4\\G2107\" --esc --gs1raw --gs1strict --gssep --square"
<< "" << "" << "" << "";
QTest::newRow("BARCODE_DATAMATRIX") << false << 0.0f << ""
<< BARCODE_DATAMATRIX << (DATA_MODE | ESCAPE_MODE | FAST_MODE) // symbology-inputMode
<< "ABCDEFGH\\x01I" << "" // text-primary
- << 0.0f << -1 << 0 << DM_ISO_144 << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << DM_ISO_144 << 1.0f // height-scale
+ << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 71 --binary -d 'ABCDEFGH\\x01I' --dmiso144 --esc --fast"
<< "zint.exe -b 71 --binary -d \"ABCDEFGH\\x01I\" --dmiso144 --esc --fast"
@@ -983,12 +1042,14 @@ private slots:
QTest::newRow("BARCODE_DBAR_EXPSTK_CC") << false << 40.8f << ""
<< BARCODE_DBAR_EXPSTK_CC << (DATA_MODE | HEIGHTPERROW_MODE) // symbology-inputMode
<< "[91]ABCDEFGHIJKL" << "[11]901222[99]ABCDE" // text-primary
- << 0.0f << -1 << 0 << 2 << 1.0f << 0.0f << true << 0.9f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << 2 << 1.0f // height-scale
+ << 0.0f << true << 0.9f << 1.0f // dpmm-textGap
<< 3.0f << 2 << 1 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 139 --binary --compliantheight -d '[11]901222[99]ABCDE' --height=40.8 --heightperrow"
" --primary='[91]ABCDEFGHIJKL' --rows=2"
@@ -999,26 +1060,30 @@ private slots:
QTest::newRow("BARCODE_DOTCODE") << false << 1.0f << ""
<< BARCODE_DOTCODE << GS1_MODE // symbology-inputMode
<< "[20]01" << "" // text-primary
- << 30.0f << -1 << 8 << ((0 + 1) << 8) << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 30.0f << -1 << 8 << ((0 + 1) // height-scale
+ << 8) << 1.0f << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 0.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 115 --cols=8 -d '[20]01' --dotsize=0.7 --gs1 --mask=0"
<< "zint.exe -b 115 --cols=8 -d \"[20]01\" --dotsize=0.7 --gs1 --mask=0"
<< "" << "" << "" << "";
- QTest::newRow("BARCODE_DOTCODE (GS1Strict") << false << 1.0f << ""
+ QTest::newRow("BARCODE_DOTCODE (GS1SyntaxEngine") << false << 1.0f << ""
<< BARCODE_DOTCODE << (GS1_MODE | GS1SYNTAXENGINE_MODE) // symbology-inputMode
<< "[20]01" << "" // text-primary
- << 30.0f << -1 << 8 << ((0 + 1) << 8) << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 30.0f << -1 << 8 << ((0 + 1) // height-scale
+ << 8) << 1.0f << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 0.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 115 --cols=8 -d '[20]01' --dotsize=0.7 --gs1strict --mask=0"
<< "zint.exe -b 115 --cols=8 -d \"[20]01\" --dotsize=0.7 --gs1strict --mask=0"
@@ -1027,12 +1092,14 @@ private slots:
QTest::newRow("BARCODE_DPD") << true << 0.0f << ""
<< BARCODE_DPD << UNICODE_MODE // symbology-inputMode
<< "1234567890123456789012345678" << "" // text-primary
- << 0.0f << -1 << 0 << 0 << 4.5f << 24.0f << true << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << 0 << 4.5f // height-scale
+ << 24.0f << true << 0.8f << 1.0f // dpmm-textGap
<< 0.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.375 << 0 << 600 << 1 << 0 << 0 // xdimdp
<< "zint -b 96 --compliantheight -d '1234567890123456789012345678' --scalexdimdp=0.375,24"
<< "zint.exe -b 96 --compliantheight -d \"1234567890123456789012345678\" --scalexdimdp=0.375,24"
@@ -1042,12 +1109,14 @@ private slots:
QTest::newRow("BARCODE_EAN13") << true << 0.0f << ""
<< BARCODE_EAN13 << UNICODE_MODE // symbology-inputMode
<< "123456789012+12" << "" // text-primary
- << 0.0f << -1 << 8 << 0 << 1.0f << 0.0f << true << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << 8 << 0 << 1.0f // height-scale
+ << 0.0f << true << 0.8f << 1.0f // dpmm-textGap
<< 0.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 15 --addongap=8 --compliantheight -d '123456789012+12' --guarddescent=0"
<< "zint.exe -b 15 --addongap=8 --compliantheight -d \"123456789012+12\" --guarddescent=0"
@@ -1056,12 +1125,14 @@ private slots:
QTest::newRow("BARCODE_EANX") << true << 0.0f << ""
<< BARCODE_EANX << UNICODE_MODE // symbology-inputMode
<< "123456789012+12" << "" // text-primary
- << 0.0f << -1 << 8 << 0 << 1.0f << 0.0f << true << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << 8 << 0 << 1.0f // height-scale
+ << 0.0f << true << 0.8f << 1.0f // dpmm-textGap
<< 0.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 13 --addongap=8 --compliantheight -d '123456789012+12' --guarddescent=0"
<< "zint.exe -b 13 --addongap=8 --compliantheight -d \"123456789012+12\" --guarddescent=0"
@@ -1070,12 +1141,14 @@ private slots:
QTest::newRow("BARCODE_EAN13 (guardWhitespace/embedVectorFont") << true << 0.0f << ""
<< BARCODE_EAN13 << UNICODE_MODE // symbology-inputMode
<< "123456789012+12" << "" // text-primary
- << 0.0f << -1 << 8 << 0 << 1.0f << 0.0f << true << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << 8 << 0 << 1.0f // height-scale
+ << 0.0f << true << 0.8f << 1.0f // dpmm-textGap
<< 0.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << true << true << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << true << true << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 15 --addongap=8 --compliantheight -d '123456789012+12' --embedfont --guarddescent=0 --guardwhitespace"
<< "zint.exe -b 15 --addongap=8 --compliantheight -d \"123456789012+12\" --embedfont --guarddescent=0 --guardwhitespace"
@@ -1084,12 +1157,14 @@ private slots:
QTest::newRow("BARCODE_EANX (guardWhitespace/embedVectorFont") << true << 0.0f << ""
<< BARCODE_EANX << UNICODE_MODE // symbology-inputMode
<< "123456789012+12" << "" // text-primary
- << 0.0f << -1 << 8 << 0 << 1.0f << 0.0f << true << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << 8 << 0 << 1.0f // height-scale
+ << 0.0f << true << 0.8f << 1.0f // dpmm-textGap
<< 0.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << true << true << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << true << true << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 13 --addongap=8 --compliantheight -d '123456789012+12' --embedfont --guarddescent=0 --guardwhitespace"
<< "zint.exe -b 13 --addongap=8 --compliantheight -d \"123456789012+12\" --embedfont --guarddescent=0 --guardwhitespace"
@@ -1098,12 +1173,14 @@ private slots:
QTest::newRow("BARCODE_GRIDMATRIX") << false << 0.0f << ""
<< BARCODE_GRIDMATRIX << UNICODE_MODE // symbology-inputMode
<< "Your Data Here!" << "" // text-primary
- << 0.0f << 1 << 5 << 0 << 0.5f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 0.0f << 1 << 5 << 0 << 0.5f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << true << false << true << 270 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 142 -d 'Your Data Here!' --quietzones --rotate=270 --scale=0.5 --secure=1 --vers=5"
<< "zint.exe -b 142 -d \"Your Data Here!\" --quietzones --rotate=270 --scale=0.5 --secure=1 --vers=5"
@@ -1112,12 +1189,14 @@ private slots:
QTest::newRow("BARCODE_HANXIN") << false << 0.0f << ""
<< BARCODE_HANXIN << (UNICODE_MODE | ESCAPE_MODE) // symbology-inputMode
<< "éβÿ啊\\e\"'" << "" // text-primary
- << 30.0f << 2 << 5 << ((0 + 1) << 8) << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 30.0f << 2 << 5 << ((0 + 1) // height-scale
+ << 8) << 1.0f << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 29 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 29 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 116 --eci=29 -d 'éβÿ啊\\e\"'\\''' --esc --mask=0 --secure=2 --vers=5"
<< "zint.exe -b 116 --eci=29 -d \"éβÿ啊\\e\\\"'\" --esc --mask=0 --secure=2 --vers=5"
@@ -1126,12 +1205,14 @@ private slots:
QTest::newRow("BARCODE_HIBC_DM") << false << 10.0f << ""
<< BARCODE_HIBC_DM << UNICODE_MODE // symbology-inputMode
<< "1234" << "" // text-primary
- << 0.0f << -1 << 8 << DM_DMRE << 1.0f << 0.0f << false << 0.7f << 1.0f // height-textGap
+ << 0.0f << -1 << 8 << DM_DMRE << 1.0f // height-scale
+ << 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << true << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 102 -d '1234' --dmre --vers=8"
<< "zint.exe -b 102 -d \"1234\" --dmre --vers=8"
@@ -1140,12 +1221,14 @@ private slots:
QTest::newRow("BARCODE_HIBC_PDF") << false << 0.0f << ""
<< BARCODE_HIBC_PDF << (DATA_MODE | HEIGHTPERROW_MODE) // symbology-inputMode
<< "TEXT" << "" // text-primary
- << 3.5f << 3 << 4 << 10 << 10.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 3.5f << 3 << 4 << 10 << 10.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 2 << 1 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << true << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 106 --binary --cols=4 -d 'TEXT' --height=3.5 --heightperrow --quietzones"
" --rows=10 --scale=10 --secure=3 --structapp=1,2"
@@ -1156,12 +1239,14 @@ private slots:
QTest::newRow("BARCODE_ITF14") << true << 0.0f << ""
<< BARCODE_ITF14 << UNICODE_MODE // symbology-inputMode
<< "9212320967145" << "" // text-primary
- << 30.0f << -1 << 0 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 30.0f << -1 << 0 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 89 --compliantheight -d '9212320967145'"
<< "zint.exe -b 89 --compliantheight -d \"9212320967145\""
@@ -1170,12 +1255,14 @@ private slots:
QTest::newRow("BARCODE_ITF14 (border)") << true << 0.0f << ""
<< BARCODE_ITF14 << UNICODE_MODE // symbology-inputMode
<< "9212320967145" << "" // text-primary
- << 30.0f << -1 << 0 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 30.0f << -1 << 0 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 1 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 89 --border=1 --compliantheight -d '9212320967145'"
<< "zint.exe -b 89 --border=1 --compliantheight -d \"9212320967145\""
@@ -1185,12 +1272,14 @@ private slots:
<< BARCODE_MAXICODE << (UNICODE_MODE | ESCAPE_MODE) // symbology-inputMode
<< "152382802840001"
<< "1Z00004951\\GUPSN\\G06X610\\G159\\G1234567\\G1/1\\G\\GY\\G1 MAIN ST\\GTOWN\\GNY\\R\\E" // text-primary
- << 0.0f << -1 << (96 + 1) << 0 << 2.5f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << (96 + 1) << 0 // height-scale
+ << 2.5f << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << true << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 57 -d '1Z00004951\\GUPSN\\G06X610\\G159\\G1234567\\G1/1\\G\\GY\\G1 MAIN ST\\GTOWN\\GNY\\R\\E'"
" --esc --primary='152382802840001' --quietzones --scale=2.5 --scmvv=96"
@@ -1201,12 +1290,14 @@ private slots:
QTest::newRow("BARCODE_MICROQR") << false << 0.0f << ""
<< BARCODE_MICROQR << UNICODE_MODE // symbology-inputMode
<< "1234" << "" // text-primary
- << 30.0f << 2 << 3 << (ZINT_FULL_MULTIBYTE | (3 + 1) << 8) << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 30.0f << 2 << 3 << (ZINT_FULL_MULTIBYTE | (3 // height-scale
+ + 1) << 8) << 1.0f << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 97 -d '1234' --fullmultibyte --mask=3 --secure=2 --vers=3"
<< "zint.exe -b 97 -d \"1234\" --fullmultibyte --mask=3 --secure=2 --vers=3"
@@ -1215,28 +1306,32 @@ private slots:
QTest::newRow("BARCODE_QRCODE") << true << 0.0f << ""
<< BARCODE_QRCODE << GS1_MODE // symbology-inputMode
<< "(01)12" << "" // text-primary
- << 0.0f << 1 << 5 << (ZINT_FULL_MULTIBYTE | (0 + 1) << 8) << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 0.0f << 1 << 5 << (ZINT_FULL_MULTIBYTE | (0 // height-scale
+ + 1) << 8) << 1.0f << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << true << false << true << 0 // showText-rotateAngle
- << 0 << true << true << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << true << true << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
- << "zint -b 58 -d '(01)12' --fullmultibyte --gs1parens --gs1nocheck --mask=0 --quietzones"
+ << "zint -b 58 -d '(01)12' --fullmultibyte --gs1nocheck --gs1parens --mask=0 --quietzones"
" --secure=1 --vers=5"
- << "zint.exe -b 58 -d \"(01)12\" --fullmultibyte --gs1parens --gs1nocheck --mask=0 --quietzones"
+ << "zint.exe -b 58 -d \"(01)12\" --fullmultibyte --gs1nocheck --gs1parens --mask=0 --quietzones"
" --secure=1 --vers=5"
<< "" << "" << "" << "";
QTest::newRow("BARCODE_RMQR") << true << 0.0f << ""
<< BARCODE_RMQR << UNICODE_MODE // symbology-inputMode
<< "テ" << "" // text-primary
- << 30.0f << -1 << 8 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 30.0f << -1 << 8 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 180 // showText-rotateAngle
- << 20 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 20 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 145 --eci=20 -d 'テ' --rotate=180 --vers=8"
<< "zint.exe -b 145 --eci=20 -d \"テ\" --rotate=180 --vers=8"
@@ -1245,26 +1340,30 @@ private slots:
QTest::newRow("BARCODE_ULTRA") << false << 0.0f << ""
<< BARCODE_ULTRA << (GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE) // symbology-inputMode
<< "(01)1" << "" // text-primary
- << 0.0f << 6 << 2 << 0 << 1.0f << 0.0f << true << 0.8f << 1.0f // height-textGap
+ << 0.0f << 6 << 2 << 0 << 1.0f // height-scale
+ << 0.0f << true << 0.8f << 1.0f // dpmm-textGap
<< 5.0f << 2 << 1 << "4" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
- << "zint -b 144 -d '(01)1' --gs1parens --gs1nocheck --secure=6 --structapp='1,2,4' --vers=2"
- << "zint.exe -b 144 -d \"(01)1\" --gs1parens --gs1nocheck --secure=6 --structapp=\"1,2,4\" --vers=2"
+ << "zint -b 144 -d '(01)1' --gs1nocheck --gs1parens --secure=6 --structapp='1,2,4' --vers=2"
+ << "zint.exe -b 144 -d \"(01)1\" --gs1nocheck --gs1parens --secure=6 --structapp=\"1,2,4\" --vers=2"
<< "" << "" << "" << "";
QTest::newRow("BARCODE_UPCE_CC") << true << 0.0f << "out.svg"
<< BARCODE_UPCE_CC << UNICODE_MODE // symbology-inputMode
<< "12345670+1234" << "[11]901222[99]ABCDE" // text-primary
- << 0.0f << -1 << 0 << 0 << 1.0f << 0.0f << false << 0.8f << 1.0f // height-textGap
+ << 0.0f << -1 << 0 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
<< 6.5f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(0xEF, 0x29, 0x29) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << (BOLD_TEXT | SMALL_TEXT) // borderTypeIndex-fontSetting
<< true << false << false << true << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_FAIL_ALL << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_FAIL_ALL << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 136 --compliantheight -d '[11]901222[99]ABCDE' --fg=EF2929 --guarddescent=6.5"
" --noquietzones -o 'out.svg' --primary='12345670+1234' --small --werror"
@@ -1278,15 +1377,35 @@ private slots:
" --noquietzones -o \"out.svg\" --primary=\"12345670+1234\" --small --werror"
<< "";
+ QTest::newRow("BARCODE_UPCE_CC (GS1NoCheck + GS1Raw + GS1SyntaxEngine)") << true << 0.0f << "out.svg"
+ << BARCODE_UPCE_CC << UNICODE_MODE // symbology-inputMode
+ << "12345670+1234" << "1190122299ABCDE" // text-primary
+ << 0.0f << -1 << 0 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.0f // dpmm-textGap
+ << 6.5f << 0 << 0 << "" // guardDescent-structAppID
+ << "" << "" << QColor(0xEF, 0x29, 0x29) << QColor(Qt::white) << false // fgStr-cmyk
+ << 0 << 0 << 0 << 0 << (BOLD_TEXT | SMALL_TEXT) // borderTypeIndex-fontSetting
+ << true << false << false << true << true << 0 // showText-rotateAngle
+ << 0 << false << true << true << true // eci-gs1SyntaxEngine
+ << false << false << false << WARN_FAIL_ALL << false // readerInit-debug
+ << 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
+ << "zint -b 136 --compliantheight -d '1190122299ABCDE' --fg=EF2929 --gs1nocheck --gs1raw --gs1strict --guarddescent=6.5"
+ " --noquietzones -o 'out.svg' --primary='12345670+1234' --small --werror"
+ << "zint.exe -b 136 --compliantheight -d \"1190122299ABCDE\" --fg=EF2929 --gs1nocheck --gs1raw --gs1strict --guarddescent=6.5"
+ " --noquietzones -o \"out.svg\" --primary=\"12345670+1234\" --small --werror"
+ << "" << "" << "" << "";
+
QTest::newRow("BARCODE_VIN") << false << 2.0f << ""
<< BARCODE_VIN << UNICODE_MODE // symbology-inputMode
<< "12345678701234567" << "" // text-primary
- << 20.0f << -1 << 1 << 0 << 1.0f << 0.0f << false << 0.8f << 1.2f // height-textGap
+ << 20.0f << -1 << 1 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.2f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << (BOLD_TEXT | SMALL_TEXT) // borderTypeIndex-fontSetting
<< true << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 73 --bold -d '12345678701234567' --height=20 --small --textgap=1.2 --vers=1"
<< "zint.exe -b 73 --bold -d \"12345678701234567\" --height=20 --small --textgap=1.2 --vers=1"
@@ -1295,12 +1414,14 @@ private slots:
QTest::newRow("BARCODE_VIN (notext)") << false << 2.0f << ""
<< BARCODE_VIN << UNICODE_MODE // symbology-inputMode
<< "12345678701234567" << "" // text-primary
- << 20.0f << -1 << 1 << 0 << 1.0f << 0.0f << false << 0.8f << 1.2f // height-textGap
+ << 20.0f << -1 << 1 << 0 << 1.0f // height-scale
+ << 0.0f << false << 0.8f << 1.2f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << (BOLD_TEXT | SMALL_TEXT) // borderTypeIndex-fontSetting
<< false << false << false << false << true << 0 // showText-rotateAngle
- << 0 << false << false << false << false << false << false << WARN_DEFAULT << false // eci-debug
+ << 0 << false << false << false << false // eci-gs1SyntaxEngine
+ << false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 73 -d '12345678701234567' --height=20 --notext --vers=1"
<< "zint.exe -b 73 -d \"12345678701234567\" --height=20 --notext --vers=1"
@@ -1353,6 +1474,7 @@ private slots:
QFETCH(int, eci);
QFETCH(bool, gs1Parens);
QFETCH(bool, gs1NoCheck);
+ QFETCH(bool, gs1Raw);
QFETCH(bool, gs1SyntaxEngine);
QFETCH(bool, readerInit);
QFETCH(bool, guardWhitespace);
@@ -1418,6 +1540,7 @@ private slots:
bc.setECIValue(eci);
bc.setGS1Parens(gs1Parens);
bc.setGS1NoCheck(gs1NoCheck);
+ bc.setGS1Raw(gs1Raw);
bc.setGS1SyntaxEngine(gs1SyntaxEngine);
bc.setReaderInit(readerInit);
bc.setGuardWhitespace(guardWhitespace);
diff --git a/backend_tcl/zint.c b/backend_tcl/zint.c
index 12cee075..00d4ff0f 100644
--- a/backend_tcl/zint.c
+++ b/backend_tcl/zint.c
@@ -189,6 +189,8 @@
2026-02-20 GL
- Added -azfull switch.
- Fiddled with some help capitalization.
+2026-02-25 GL
+- Added -gs1raw switch.
*/
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
@@ -580,10 +582,11 @@ static const char help_message[] = "zint tcl(stub,obj) dll\n"
/* cli option --gs1 replaced by -format */
" -gs1nocheck bool: for gs1, do not check validity of data (allows non-standard symbols)\n"
" -gs1parens bool: for gs1, AIs enclosed in parentheses instead of square brackets\n"
+ " -gs1raw bool: for gs1, raw GS1 input (no square brackets or parentheses), with GS for FNC1\n"
#ifdef ZINT_HAVE_GS1SE
" -gs1strict bool: use GS1 Syntax Engine to strictly validate GS1 data\n"
#else
- " -gs1strict 0: GS1 syntax engine not compiled in, may not be activated.\n"
+ " -gs1strict 0: GS1 syntax engine not compiled in, may not be activated\n"
#endif
" -gssep bool: for gs1, use gs as separator instead fnc1 (Data Matrix only)\n"
" -guarddescent double: height of guard bar descent in modules (EAN/UPC only)\n"
@@ -910,8 +913,7 @@ static int Encode(Tcl_Interp *interp, int objc,
"-barcode", "-bg", "-bind", "-bindtop", "-bold", "-border", "-box",
"-cols", "-compliantheight", "-dmiso144", "-dmre", "-dotsize", "-dotty",
"-eci", "-esc", "-extraesc", "-fast", "-fg", "-format", "-fullmultibyte",
- "-gs1nocheck", "-gs1parens",
- "-gs1strict",
+ "-gs1nocheck", "-gs1parens", "-gs1raw", "-gs1strict",
"-gssep", "-guarddescent",
"-guardwhitespace", "-height", "-heightperrow", "-init", "-mask", "-mode",
"-nobackground", "-noquietzones", "-notext", "-primary", "-quietzones",
@@ -925,8 +927,7 @@ static int Encode(Tcl_Interp *interp, int objc,
iBarcode, iBG, iBind, iBindTop, iBold, iBorder, iBox,
iCols, iCompliantHeight, iDMISO144, iDMRE, iDotSize, iDotty,
iECI, iEsc, iExtraEsc, iFast, iFG, iFormat, iFullMultiByte,
- iGS1NoCheck, iGS1Parens,
- iGS1Strict,
+ iGS1NoCheck, iGS1Parens, iGS1Raw, iGS1Strict,
iGSSep, iGuardDescent,
iGuardWhitespace, iHeight, iHeightPerRow, iInit, iMask, iMode,
iNoBackground, iNoQuietZones, iNoText, iPrimary, iQuietZones,
@@ -964,6 +965,7 @@ static int Encode(Tcl_Interp *interp, int objc,
case iFast:
case iGS1NoCheck:
case iGS1Parens:
+ case iGS1Raw:
case iGS1Strict:
case iGSSep:
case iGuardWhitespace:
@@ -1177,6 +1179,14 @@ static int Encode(Tcl_Interp *interp, int objc,
my_symbol->input_mode &= ~GS1PARENS_MODE;
}
break;
+ case iGS1Raw:
+ if (intValue) {
+ my_symbol->input_mode |= GS1RAW_MODE;
+ my_symbol->input_mode = (my_symbol->input_mode & ~0x07) | GS1_MODE;
+ } else {
+ my_symbol->input_mode &= ~GS1RAW_MODE;
+ }
+ break;
case iGS1Strict:
if (intValue) {
#ifdef ZINT_HAVE_GS1SE
diff --git a/docs/images/ean13.svg b/docs/images/ean13.svg
index d1263ffd..260059fe 100644
--- a/docs/images/ean13.svg
+++ b/docs/images/ean13.svg
@@ -4,15 +4,15 @@
Zint Generated Symbol
-
+
- 4
+ 9
- 512345
+ 520123
- 678906
+ 456788
diff --git a/docs/images/ean13_2.svg b/docs/images/ean13_2.svg
index 937d469e..a18ba89b 100644
--- a/docs/images/ean13_2.svg
+++ b/docs/images/ean13_2.svg
@@ -4,15 +4,15 @@
Zint Generated Symbol
-
+
- 4
+ 9
- 512345
+ 520123
- 678906
+ 456788
21
diff --git a/docs/images/ean13_gd_gws.svg b/docs/images/ean13_gd_gws.svg
index f4a06555..f63efbfa 100644
--- a/docs/images/ean13_gd_gws.svg
+++ b/docs/images/ean13_gd_gws.svg
@@ -4,15 +4,15 @@
Zint Generated Symbol
-
+
- 4
+ 9
- 512345
+ 520123
- 678906
+ 456788
>
diff --git a/docs/images/ean8.svg b/docs/images/ean8.svg
index dd019586..d3b57676 100644
--- a/docs/images/ean8.svg
+++ b/docs/images/ean8.svg
@@ -4,12 +4,12 @@
Zint Generated Symbol
-
+
- 7432
+ 9520
- 3654
+ 0002
diff --git a/docs/images/ean8_gws.svg b/docs/images/ean8_gws.svg
index 1b1b7da9..8fef2d27 100644
--- a/docs/images/ean8_gws.svg
+++ b/docs/images/ean8_gws.svg
@@ -4,15 +4,15 @@
Zint Generated Symbol
-
+
<
- 7432
+ 9520
- 3654
+ 0002
>
diff --git a/docs/images/gui_aztec.png b/docs/images/gui_aztec.png
index 71146ad4..63523ac3 100644
Binary files a/docs/images/gui_aztec.png and b/docs/images/gui_aztec.png differ
diff --git a/docs/images/gui_c25inter.png b/docs/images/gui_c25inter.png
index 732ccff4..4e6894ff 100644
Binary files a/docs/images/gui_c25inter.png and b/docs/images/gui_c25inter.png differ
diff --git a/docs/images/gui_composite.png b/docs/images/gui_composite.png
index fe8ec5d4..ad1d25af 100644
Binary files a/docs/images/gui_composite.png and b/docs/images/gui_composite.png differ
diff --git a/docs/images/gui_main.png b/docs/images/gui_main.png
index 64a5ea06..a1072a4a 100644
Binary files a/docs/images/gui_main.png and b/docs/images/gui_main.png differ
diff --git a/docs/images/gui_segs.png b/docs/images/gui_segs.png
index f53db6b2..996b4bd1 100644
Binary files a/docs/images/gui_segs.png and b/docs/images/gui_segs.png differ
diff --git a/docs/images/upca.svg b/docs/images/upca.svg
index 371a9b16..c6d07803 100644
--- a/docs/images/upca.svg
+++ b/docs/images/upca.svg
@@ -4,18 +4,18 @@
Zint Generated Symbol
-
+
- 7
+ 0
- 25272
+ 12345
- 70270
+ 00005
- 3
+ 8
diff --git a/docs/images/upca_5.svg b/docs/images/upca_5.svg
index e7b74170..c7ba0e2f 100644
--- a/docs/images/upca_5.svg
+++ b/docs/images/upca_5.svg
@@ -4,18 +4,18 @@
Zint Generated Symbol
-
+
- 7
+ 0
- 25272
+ 12345
- 70270
+ 00005
- 3
+ 8
12345
diff --git a/docs/images/upca_5_gws.svg b/docs/images/upca_5_gws.svg
index 63db3297..3e1b7557 100644
--- a/docs/images/upca_5_gws.svg
+++ b/docs/images/upca_5_gws.svg
@@ -4,18 +4,18 @@
Zint Generated Symbol
-
+
- 7
+ 0
- 25272
+ 12345
- 70270
+ 00005
- 3
+ 8
12345
diff --git a/docs/images/upce.svg b/docs/images/upce.svg
index 44eeef7e..494a5b03 100644
--- a/docs/images/upce.svg
+++ b/docs/images/upce.svg
@@ -4,15 +4,15 @@
Zint Generated Symbol
-
+
0
- 123456
+ 123455
- 5
+ 8
diff --git a/docs/images/upce_2_gws.svg b/docs/images/upce_2_gws.svg
index 8cd08103..47d35f88 100644
--- a/docs/images/upce_2_gws.svg
+++ b/docs/images/upce_2_gws.svg
@@ -4,15 +4,15 @@
Zint Generated Symbol
-
+
0
- 123456
+ 123455
- 5
+ 8
12
diff --git a/docs/manual.html b/docs/manual.html
index 28c3a0d2..a1c876d6 100644
--- a/docs/manual.html
+++ b/docs/manual.html
@@ -431,6 +431,15 @@ Example 2
id="toc-input-modes-and-eci-example-3">4.11.2.3 Input Modes and ECI
Example 3
+4.11.3 GS1 Data Entry and
+Options
+
4.12 Batch
Processing
@@ -1074,12 +1083,18 @@ Composite data
In the middle of the Data tab is an area for creating composite
symbologies which appears when the currently selected symbology supports
-the GS1 Composite symbology standard. GS1 data can then be entered with
-square brackets used to separate Application Identifier (AI) information
-from data as shown here. Round brackets (parentheses) can be used
-instead if the "GS1 ()" checkbox is set. For details, see
-6.3 GS1 Composite Symbols
-(ISO 24723) .
+the GS1 Composite symbology standard - namely EAN-13, EAN-8, GS1-128,
+GS1 DataBar (all variants), UPC-A and UPC-E. See 6.3 GS1 Composite Symbols (ISO
+24723) for details.
+If the "Add 2D Component" checkbox is checked, GS1 data
+can then be entered in the "2D Component Data" text box,
+with square brackets used to separate Application Identifier (AI)
+information from data as shown here, or using one of the other formats
+described in 4.11.3 GS1 Data Entry
+and Options , where the GS1 checkbox options "()"
+(Parentheses), "Raw", "No Check" and
+"Strict" are also discussed.
3.3 Additional ECI/Data
Segments Groupbox
@@ -2395,10 +2410,10 @@ mixed with U.S. units:
zint -d "1234" --scalexdimdp = 0.33mm,300dpi
4.9.2 Scaling Example
-The GS1 General Specifications Section 5.2.6.6 ‘Symbol dimensions at
-nominal size’ gives an example of an EAN-13 barcode using the
-X-dimension of 0.33mm. To print that example as a PNG at 12 dpmm, the
-approximate equivalent of 300 dpi (dpi = dpmm * 25.4),
+
The GS1 General Specifications 26.0 Section 5.2.6.6 “Symbol
+dimensions at nominal size” gives an example of an EAN-13 barcode using
+the X-dimension of 0.33mm. To print that example as a PNG at 12 dpmm,
+the approximate equivalent of 300 dpi (dpi = dpmm * 25.4),
specify a scale of 2, since 0.33 * 12 = 3.96 pixels, or 4
pixels rounding to the nearest pixel:
4.11.2 Input
Modes and ECI below.
-GS1 data can be encoded in a number of symbologies. Application
-Identifiers (AIs) should be enclosed in [square brackets]
-followed by the data to be encoded (see 6.1.10.3
-GS1-128 ). For matrix symbologies, GS1 Digital Link URIs can also be
-given. To encode GS1 data use the --gs1 option.
-Alternatively, use the --gs1strict option, which strictly
-verifies the GS1 data.
-GS1 mode is assumed (and doesn’t need to be set) for GS1-128, EAN-14,
-GS1 DataBar and GS1 Composite symbologies but is also available for
-Aztec Code, Code 16K, Code 49, Code One, Data Matrix, DotCode, QR Code
-and Ultracode.
+GS1 data can be encoded in a number of symbologies - see 4.11.3 GS1 Data Entry and
+Options .
Health Industry Barcode (HIBC) data may also be encoded in the
symbologies Aztec Code, Codablock-F, Code 128, Code 39, Data Matrix,
MicroPDF417, PDF417 and QR Code. Within this mode, the leading
@@ -2881,13 +2888,188 @@ alt="zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8" --esc" />
Figure 25:
zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8" --esc
+
4.11.3 GS1 Data Entry and
+Options
+The following symbologies accept GS1 data:
+
+Table 9: GS1-Enabled
+Symbologies
+
+
+Symbology
+Implicit AI?
+Assumed?
+Supports Composite?
+
+
+
+
+Aztec Code
+No
+No
+No
+
+
+Code 16K
+No
+No
+No
+
+
+Code 49
+No
+No
+No
+
+
+Code One
+No
+No
+No
+
+
+Data Matrix
+No
+No
+No
+
+
+DotCode
+No
+No
+No
+
+
+EAN-13, EAN-8
+Yes (01)
+Yes
+Yes
+
+
+EAN-14
+Yes (01)
+Yes
+No
+
+
+GS1-128
+No
+Yes
+Yes
+
+
+GS1 DataBar Expanded (Stacked)
+No
+Yes
+Yes
+
+
+GS1 DataBar (all others)
+Yes (01)
+Yes
+Yes
+
+
+NVE-18
+Yes (00)
+Yes
+No
+
+
+QR Code
+No
+No
+No
+
+
+rMQR
+No
+No
+No
+
+
+Ultracode
+No
+No
+No
+
+
+UPC-A, UPC-E
+Yes (01)
+Yes
+Yes
+
+
+
+
4.11.3.1 GS1 Data Entry
+
Those that encode an implicit AI take numeric data in their linear
+part without any further markup - see respective descriptions in 6. Types of Symbology .
+
GS1-128, GS1 DataBar Expanded (including Expanded Stacked), the
+matrix symbologies and the 2D component of GS1 Composite symbologies,
+all of which can encode multiple AIs, require markup in the data to
+distinguish AIs.
+
The traditional way in Zint of specifying GS1 data for these cases is
+to delimit the GS1 AIs in square brackets:
+
zint -b AZTEC -d "[01]09520123456788[10]BATCH4[21]07" --gs1
+
(Note that for the matrix symbologies the --gs1 option
+must be given.)
+
Parentheses (round brackets) may be used instead by giving the
+--gs1parens option:
+
zint -b AZTEC -d "(01)09520123456788(10)BATCH4(21)07" --gs1parens
+
If the data includes opening parentheses when using the latter
+format, they must be escaped and the --esc option
+given:
+
zint -b AZTEC -d "(01)09520123456788(90)Var\(34)" --esc --gs1parens
+
Closing parentheses may also be escaped for clarity.
+
For matrix symbologies, a GS1 Digital Link URI may be used:
+
zint -b AZTEC -d "https://example.com/01/09520123456788/10/BATCH4/21/07" --gs1
+
A further way to specify GS1 input is “Unbracketed AI”, a GS1 Syntax
+Engine format that uses carets (^)
+to indicate any required FNC1s.11
+The data must start with a caret:
+
zint -b AZTEC -d "^010952012345678810BATCH4^2107" --gs1
+
The final way to specify input is the related “raw” mode using the
+--gs1raw option. Here FNC1s are indicated by
+Group Separators (GS, ASCII 29, escape sequence
+\G). It does not start with a GS:
+
zint -b AZTEC -d "010952012345678810BATCH4\G2107" --esc --gs1raw
+
4.11.3.2 GS1 Options
+
Apart from --gs1, --gs1parens and
+--gs1raw discussed above, there are two other GS1
+options.
+
+--gs1strict, which enables the use the GS1 Syntax
+Engine to strictly validate GS1 data, including GS1 Digital Link URIs
+(by default Zint does not validate Digital Links at all). It requires
+that the gs1encoders library was present when Zint was
+built, otherwise the default built-in validation will be used.
+--gs1nocheck, for use with legacy systems that have
+data that does not conform to the current GS1 standard. Printable ASCII
+input is still checked for, as is the validity of GS1 data specified
+without AIs (e.g. linear data for GS1 DataBar
+Omnidirectional/Limited/etc.). Also checked is GS1 DataBar Expanded and
+GS1 Composite input that is not in the GS1 encodable character set 82
+(see GS1 General Specifications 26.0 Table 7-2 “GS1 AI encodable
+character set 82”), otherwise encodation would fail. In “Unbracketed AI”
+and raw mode, overlong AI data will also fail.
+
+
All the GS1 options imply --gs1.
4.12 Batch Processing
Data can be batch processed by reading from a text file and producing
a separate barcode image for each line of text in that file. To do this
use the --batch switch together with -i to
select the input file from which to read data. For example
-
zint -b EAN13 --batch -i ean13nos.txt
+
zint -b EAN13 --batch -i ean13nos.txt
where "ean13nos.txt" contains a list of EAN-13 numbers
(GTINs), each on its own line. Zint will automatically detect the end of
a line of text (in either Unix or Windows formatted text files) and
@@ -2900,7 +3082,7 @@ you that there is a problem.
behaviour specify the
-o option using special characters in
the output filename as shown in the table below:
For instance
-
zint -b EAN13 --batch -i ean13nos.txt -o "file~~~.svg"
+
zint -b EAN13 --batch -i ean13nos.txt -o "file~~~.svg"
The following table shows some examples to clarify this method:
-Table 10: Batch Filename
+Table 11: Batch Filename
Examples
@@ -2972,7 +3154,7 @@ Examples
The special characters can span directories also, which is useful
when creating a large number of barcodes:
-Table 11: Batch Directory
+Table 12: Batch Directory
Examples
@@ -3004,8 +3186,8 @@ part of a pipe by using the --direct option. By default
supplementing the --direct option with a
--filetype option followed by the suffix of the file type
required. For example:
-zint -b MICROPDF417 --direct --filetype = pcx -d "Data to encode"
+zint -b MICROPDF417 --direct --filetype = pcx -d "Data to encode"
This command will output the symbol as a PCX file to stdout. For the
supported output file formats see Table 3: Output File
@@ -3057,8 +3239,8 @@ and data is the data to which this applies. This is in
addition to the ECI and data specified using the --eci and
-d options which must still be present and which in effect
constitute segment 0. For instance
-zint -b AZTEC_CODE --eci = 9 -d "Κείμενο" --seg1 = 7,"Текст" --seg2 = 20,"文章"
+zint -b AZTEC_CODE --eci = 9 -d "Κείμενο" --seg1 = 7,"Текст" --seg2 = 20,"文章"
specifies 3 segments: segment 0 with ECI 9 (Greek), segment 1 with
ECI 7 (Cyrillic), and segment 2 with ECI 20 (Shift JIS). Segments must
be consecutive.
@@ -3084,8 +3266,8 @@ Data Matrix, DotCode, Grid Matrix, MaxiCode, MicroPDF417, PDF417, QR
Code and Ultracode.
The --structapp option marks a symbol as part of a
Structured Append sequence, and has the format
-
+
@@ -3141,22 +3323,22 @@ These symbol structures are created with the
ZBarcode_Create() function and deleted using the
ZBarcode_Delete() function. For example the following code
creates and then deletes a symbol:
-#include <zint.h>
-#include <stdio.h>
-int main()
-{
- struct zint_symbol * symbol;
- symbol = ZBarcode_Create();
- if ( symbol != NULL) {
- printf( "Symbol successfully created! \n " );
- ZBarcode_Delete( symbol);
- }
- return 0 ;
-}
+#include <zint.h>
+#include <stdio.h>
+int main()
+{
+ struct zint_symbol * symbol;
+ symbol = ZBarcode_Create();
+ if ( symbol != NULL) {
+ printf( "Symbol successfully created! \n " );
+ ZBarcode_Delete( symbol);
+ }
+ return 0 ;
+}
When compiling this code it will need to be linked with the
libzint library using the -lzint option:
-gcc -o simple simple.c -lzint
+gcc -o simple simple.c -lzint
5.2 Encoding and Saving to
File
To encode data in a barcode use the ZBarcode_Encode()
@@ -3166,28 +3348,28 @@ takes a string from the command line and outputs a Code 128 symbol to a
PNG file named "out.png" (or a GIF file
"out.gif" if libpng is not present) in the
current working directory:
-#include <zint.h>
-int main( int argc, char ** argv)
-{
- struct zint_symbol * symbol;
- symbol = ZBarcode_Create();
- ZBarcode_Encode( symbol, argv[ 1 ], 0 );
- ZBarcode_Print( symbol, 0 );
- ZBarcode_Delete( symbol);
- return 0 ;
-}
+#include <zint.h>
+int main( int argc, char ** argv)
+{
+ struct zint_symbol * symbol;
+ symbol = ZBarcode_Create();
+ ZBarcode_Encode( symbol, argv[ 1 ], 0 );
+ ZBarcode_Print( symbol, 0 );
+ ZBarcode_Delete( symbol);
+ return 0 ;
+}
This can also be done in one stage using the
ZBarcode_Encode_and_Print() function as shown in the next
example:
-#include <zint.h>
-int main( int argc, char ** argv)
-{
- struct zint_symbol * symbol;
- symbol = ZBarcode_Create();
- ZBarcode_Encode_and_Print( symbol, argv[ 1 ], 0 , 0 );
- ZBarcode_Delete( symbol);
- return 0 ;
-}
+#include <zint.h>
+int main( int argc, char ** argv)
+{
+ struct zint_symbol * symbol;
+ symbol = ZBarcode_Create();
+ ZBarcode_Encode_and_Print( symbol, argv[ 1 ], 0 , 0 );
+ ZBarcode_Delete( symbol);
+ return 0 ;
+}
Note that when using the API, the input data is assumed to be 8-bit
binary unless the input_mode member of the
zint_symbol structure is set - see
5.3 Encoding and
Printing Functions in Depth
The functions for encoding and printing barcodes are defined as:
-int ZBarcode_Encode( struct zint_symbol * symbol,
- const unsigned char * source, int length);
-
-int ZBarcode_Encode_File( struct zint_symbol * symbol,
- const char * filename);
-
-int ZBarcode_Print( struct zint_symbol * symbol, int rotate_angle);
-
-int ZBarcode_Encode_and_Print( struct zint_symbol * symbol,
- const unsigned char * source, int length, int rotate_angle);
-
-int ZBarcode_Encode_File_and_Print( struct zint_symbol * symbol,
- const char * filename, int rotate_angle);
+int ZBarcode_Encode( struct zint_symbol * symbol,
+ const unsigned char * source, int length);
+
+int ZBarcode_Encode_File( struct zint_symbol * symbol,
+ const char * filename);
+
+int ZBarcode_Print( struct zint_symbol * symbol, int rotate_angle);
+
+int ZBarcode_Encode_and_Print( struct zint_symbol * symbol,
+ const unsigned char * source, int length, int rotate_angle);
+
+int ZBarcode_Encode_File_and_Print( struct zint_symbol * symbol,
+ const char * filename, int rotate_angle);
In these definitions length can be used to set the
length of the input string. This allows the encoding of NUL
(ASCII 0) characters in those symbologies which allow this. A value of 0
@@ -3235,13 +3417,13 @@ Memory (raster)
In addition to saving barcode images to file Zint allows you to
access a representation of the resulting bitmap image in memory. The
following functions allow you to do this:
-int ZBarcode_Buffer( struct zint_symbol * symbol, int rotate_angle);
-
-int ZBarcode_Encode_and_Buffer( struct zint_symbol * symbol,
- const unsigned char * source, int length, int rotate_angle);
-
-int ZBarcode_Encode_File_and_Buffer( struct zint_symbol * symbol,
- const char * filename, int rotate_angle);
+int ZBarcode_Buffer( struct zint_symbol * symbol, int rotate_angle);
+
+int ZBarcode_Encode_and_Buffer( struct zint_symbol * symbol,
+ const unsigned char * source, int length, int rotate_angle);
+
+int ZBarcode_Encode_File_and_Buffer( struct zint_symbol * symbol,
+ const char * filename, int rotate_angle);
The arguments here are the same as above, and rotation and colour
options can be used with the buffer functions in the same way as when
saving to a file. The difference is that instead of saving the image to
@@ -3263,23 +3445,23 @@ method shown in the example below, where render_rgb() and
render_rgba() are assumed to be functions for drawing an
RGB and RGBA pixel on the screen implemented by the client
application:
-int row, col, i = 0 , j = 0 ;
-
-for ( row = 0 ; row < symbol-> bitmap_height; row++) {
- for ( col = 0 ; col < symbol-> bitmap_width; col++) {
- int red = ( int ) symbol-> bitmap[ i];
- int green = ( int ) symbol-> bitmap[ i + 1 ];
- int blue = ( int ) symbol-> bitmap[ i + 2 ];
- if ( symbol-> alphamap) {
- int alpha = ( int ) symbol-> alphamap[ j];
- render_rgba( row, col, red, green, blue, alpha);
- j++;
- } else {
- render_rgb( row, col, red, green, blue);
- }
- i += 3 ;
- }
-}
+int row, col, i = 0 , j = 0 ;
+
+for ( row = 0 ; row < symbol-> bitmap_height; row++) {
+ for ( col = 0 ; col < symbol-> bitmap_width; col++) {
+ int red = ( int ) symbol-> bitmap[ i];
+ int green = ( int ) symbol-> bitmap[ i + 1 ];
+ int blue = ( int ) symbol-> bitmap[ i + 2 ];
+ if ( symbol-> alphamap) {
+ int alpha = ( int ) symbol-> alphamap[ j];
+ render_rgba( row, col, red, green, blue, alpha);
+ j++;
+ } else {
+ render_rgb( row, col, red, green, blue);
+ }
+ i += 3 ;
+ }
+}
Where speed is important, the buffer can be returned instead in a
more compact intermediate form using the output option
OUT_BUFFER_INTERMEDIATE. Here each byte is an ASCII value:
@@ -3291,26 +3473,26 @@ for blue, 'M' for magenta, 'R' for red,
'K' for black. Alpha values are not reported
(alphamap will always be NULL). The loop for
accessing the data is then:
-int row, col, i = 0 ;
-
-for ( row = 0 ; row < symbol-> bitmap_height; row++) {
- for ( col = 0 ; col < symbol-> bitmap_width; col++) {
- render_pixel( row, col, symbol-> bitmap[ i]);
- i++;
- }
-}
+int row, col, i = 0 ;
+
+for ( row = 0 ; row < symbol-> bitmap_height; row++) {
+ for ( col = 0 ; col < symbol-> bitmap_width; col++) {
+ render_pixel( row, col, symbol-> bitmap[ i]);
+ i++;
+ }
+}
5.5 Buffering Symbols in
Memory (vector)
Symbols can also be saved to memory in a vector representation as
well as a bitmap one. The following functions, exactly analogous to the
ones above, allow you to do this:
-int ZBarcode_Buffer_Vector( struct zint_symbol * symbol, int rotate_angle);
-
-int ZBarcode_Encode_and_Buffer_Vector( struct zint_symbol * symbol,
- const unsigned char * source, int length, int rotate_angle);
-
-int ZBarcode_Encode_File_and_Buffer_Vector( struct zint_symbol * symbol,
- const char * filename, int rotate_angle);
+int ZBarcode_Buffer_Vector( struct zint_symbol * symbol, int rotate_angle);
+
+int ZBarcode_Encode_and_Buffer_Vector( struct zint_symbol * symbol,
+ const unsigned char * source, int length, int rotate_angle);
+
+int ZBarcode_Encode_File_and_Buffer_Vector( struct zint_symbol * symbol,
+ const char * filename, int rotate_angle);
Here the vector member is set to point to a
zint_vector header structure which contains pointers to
lists of structures representing the various elements of the barcode:
@@ -3321,30 +3503,30 @@ rendering system with prepare_canvas(),
draw_rect(), draw_hexagon(),
draw_string(), and draw_circle() routines
available:
-struct zint_vector_rect * rect;
-struct zint_vector_hexagon * hex;
-struct zint_vector_string * string;
-struct zint_vector_circle * circle;
-
- prepare_canvas( symbol-> vector-> width, symbol-> vector-> height,
- symbol-> scale, symbol-> fgcolour, symbol-> bgcolour,
- rotate_angle);
-
-for ( rect = symbol-> vector-> rectangles; rect; rect = rect-> next) {
- draw_rect( rect-> x, rect-> y, rect-> width, rect-> height,
- rect-> colour);
-}
-for ( hex = symbol-> vector-> hexagons; hex; hex = hex-> next) {
- draw_hexagon( hex-> x, hex-> y, hex-> diameter, hex-> rotation);
-}
-for ( string = symbol-> vector-> strings; string; string = string-> next) {
- draw_string( string-> x, string-> y, string-> fsize,
- string-> rotation, string-> halign,
- string-> text, string-> length);
-}
-for ( circle = symbol-> vector-> circles; circle; circle = circle-> next) {
- draw_circle( circle-> x, circle-> y, circle-> diameter, circle-> width);
-}
+struct zint_vector_rect * rect;
+struct zint_vector_hexagon * hex;
+struct zint_vector_string * string;
+struct zint_vector_circle * circle;
+
+ prepare_canvas( symbol-> vector-> width, symbol-> vector-> height,
+ symbol-> scale, symbol-> fgcolour, symbol-> bgcolour,
+ rotate_angle);
+
+for ( rect = symbol-> vector-> rectangles; rect; rect = rect-> next) {
+ draw_rect( rect-> x, rect-> y, rect-> width, rect-> height,
+ rect-> colour);
+}
+for ( hex = symbol-> vector-> hexagons; hex; hex = hex-> next) {
+ draw_hexagon( hex-> x, hex-> y, hex-> diameter, hex-> rotation);
+}
+for ( string = symbol-> vector-> strings; string; string = string-> next) {
+ draw_string( string-> x, string-> y, string-> fsize,
+ string-> rotation, string-> halign,
+ string-> text, string-> length);
+}
+for ( circle = symbol-> vector-> circles; circle; circle = circle-> next) {
+ draw_circle( circle-> x, circle-> y, circle-> diameter, circle-> width);
+}
5.6 Buffering Symbols in
Memory (memfile)
Symbols can also be stored as “in-memory” file buffers by giving the
@@ -3353,26 +3535,26 @@ Memory (memfile)
member memfile instead of to the output file
outfile. The length of the buffer is given in
memfile_size. For instance:
-#include <zint.h>
-#include <stdio.h>
-#include <string.h>
-int main( int argc, char ** argv)
-{
- struct zint_symbol * symbol;
- symbol = ZBarcode_Create();
- symbol-> output_options |= BARCODE_MEMORY_FILE;
- /* Only the extension is used, to determine output format */
- strcpy( symbol-> outfile, "mem.svg" );
- ZBarcode_Encode_and_Print( symbol, argv[ 1 ], 0 , 0 );
- /* `symbol->memfile` now contains the SVG output */
- fwrite( symbol-> memfile, 1 , symbol-> memfile_size, stdout);
- ZBarcode_Delete( symbol);
- return 0 ;
-}
+#include <zint.h>
+#include <stdio.h>
+#include <string.h>
+int main( int argc, char ** argv)
+{
+ struct zint_symbol * symbol;
+ symbol = ZBarcode_Create();
+ symbol-> output_options |= BARCODE_MEMORY_FILE;
+ /* Only the extension is used, to determine output format */
+ strcpy( symbol-> outfile, "mem.svg" );
+ ZBarcode_Encode_and_Print( symbol, argv[ 1 ], 0 , 0 );
+ /* `symbol->memfile` now contains the SVG output */
+ fwrite( symbol-> memfile, 1 , symbol-> memfile_size, stdout);
+ ZBarcode_Delete( symbol);
+ return 0 ;
+}
will print the SVG output to stdout (the file
"mem.svg" is not created). This is particularly useful for
-the textual formats EPS and SVG, allowing the output to
+the textual formats EPS and SVG, allowing the output to
be manipulated and processed by the client.
5.7 Setting Options
So far our application is not very useful unless we plan to only make
@@ -3383,7 +3565,7 @@ is by altering the contents of the zint_symbol structure
between the creation and encoding stages. The zint_symbol
structure consists of the following members:
-Table 12: API Structure
+Table 13: API Structure
zint_symbol
@@ -3411,8 +3593,8 @@ href="#specifying-a-symbology">5.9 Specifying a Symbology.
height
float
Symbol height in X-dimensions, excluding
-fixed width-to-height symbols.
+fixed width-to-height symbols.
Symbol dependent
@@ -3487,8 +3669,8 @@ resulting barcode symbol to. Must end in .png,
.gif, .bmp, .emf,
.eps, .pcx, .svg,
.tif or .txt followed by a terminating
-NUL.
+NUL.
"out.png"
@@ -3703,22 +3885,22 @@ see 5.16 Feedback .
To alter these values use the syntax shown in the example below. This
code has the same result as the previous example except the output is
now taller and plotted in green.
-#include <zint.h>
-#include <string.h>
-int main( int argc, char ** argv)
-{
- struct zint_symbol * symbol;
- symbol = ZBarcode_Create();
- strcpy( symbol-> fgcolour, "00ff00" );
- symbol-> height = 400.0 f ;
- ZBarcode_Encode_and_Print( symbol, argv[ 1 ], 0 , 0 );
- ZBarcode_Delete( symbol);
- return 0 ;
-}
+#include <zint.h>
+#include <string.h>
+int main( int argc, char ** argv)
+{
+ struct zint_symbol * symbol;
+ symbol = ZBarcode_Create();
+ strcpy( symbol-> fgcolour, "00ff00" );
+ symbol-> height = 400.0 f ;
+ ZBarcode_Encode_and_Print( symbol, argv[ 1 ], 0 , 0 );
+ ZBarcode_Delete( symbol);
+ return 0 ;
+}
Note that background removal for all outputs except BMP can be
achieved by setting the background alpha to "00" where the
values for R, G and B will be ignored:
- strcpy( symbol-> bgcolour, "55555500" );
+ strcpy( symbol-> bgcolour, "55555500" );
This is what the CLI option --nobackground does - see 4.7 Using Colour .
5.8 Handling Errors
@@ -3727,7 +3909,7 @@ back to the calling application. In addition the errtxt
member is set to a message detailing the nature of the error. The errors
generated by Zint are:
-Table 13: API Warning and
+Table 14: API Warning and
Error Return Values
@@ -3837,30 +4019,30 @@ occurs.
To catch errors use an integer variable as shown in the code
below:
-#include <zint.h>
-#include <stdio.h>
-#include <string.h>
-int main( int argc, char ** argv)
-{
- struct zint_symbol * symbol;
- int error;
- symbol = ZBarcode_Create();
- /* Set invalid foreground colour */
- strcpy( symbol-> fgcolour, "nonsense" );
- error = ZBarcode_Encode_and_Print( symbol, argv[ 1 ], 0 , 0 );
- if ( error != 0 ) {
- /* Some warning or error occurred */
- printf( " %s\n " , symbol-> errtxt);
- if ( error >= ZINT_ERROR) {
- /* Stop now */
- ZBarcode_Delete( symbol);
- return 1 ;
- }
- }
- /* Otherwise carry on with the rest of the application */
- ZBarcode_Delete( symbol);
- return 0 ;
-}
+#include <zint.h>
+#include <stdio.h>
+#include <string.h>
+int main( int argc, char ** argv)
+{
+ struct zint_symbol * symbol;
+ int error;
+ symbol = ZBarcode_Create();
+ /* Set invalid foreground colour */
+ strcpy( symbol-> fgcolour, "nonsense" );
+ error = ZBarcode_Encode_and_Print( symbol, argv[ 1 ], 0 , 0 );
+ if ( error != 0 ) {
+ /* Some warning or error occurred */
+ printf( " %s\n " , symbol-> errtxt);
+ if ( error >= ZINT_ERROR) {
+ /* Stop now */
+ ZBarcode_Delete( symbol);
+ return 1 ;
+ }
+ }
+ /* Otherwise carry on with the rest of the application */
+ ZBarcode_Delete( symbol);
+ return 0 ;
+}
This code will exit with the appropriate message:
Error 881: Malformed foreground RGB colour 'nonsense' (hexadecimal only)
To treat all warnings as errors, set
@@ -3870,15 +4052,15 @@ below:
class="cross-ref-group">Table 4: Barcode Types (Symbologies) . For
example
- symbol-> symbology = BARCODE_LOGMARS;
+ symbol-> symbology = BARCODE_LOGMARS;
5.10 Adjusting Output Options
The output_options member can be used to adjust various
aspects of the output file. To select more than one option from the
table below simply OR them together when adjusting this
value:
- symbol-> output_options |= BARCODE_BIND | READER_INIT;
+ symbol-> output_options |= BARCODE_BIND | READER_INIT;
-Table 14: API
+Table 15: API
output_options Values
@@ -3898,15 +4080,15 @@ value:
BARCODE_BIND_TOP
Boundary bar above the symbol only.
+href="#fn15" class="footnote-ref" id="fnref15"
+role="doc-noteref">15
BARCODE_BIND
Boundary bars above and below the symbol
-and between rows if stacking multiple symbols.14
+and between rows if stacking multiple symbols.16
BARCODE_BOX
@@ -3956,8 +4138,8 @@ Memory (raster).
BARCODE_QUIET_ZONES
Add compliant quiet zones (additional to
-any specified whitespace).
+any specified whitespace).
BARCODE_NO_QUIET_ZONES
@@ -3998,7 +4180,7 @@ href="#feedback">5.16 Feedback).
The way in which the input data is encoded can be set using the
input_mode member:
The default mode is DATA_MODE (CLI option
@@ -4079,36 +4267,28 @@ CLI and GUI, which is UNICODE_MODE.)
GS1_MODE are mutually exclusive, whereas
ESCAPE_MODE, GS1PARENS_MODE,
GS1NOCHECK_MODE, HEIGHTPERROW_MODE,
-FAST_MODE, EXTRA_ESCAPE_MODE and
-GS1SYNTAXENGINE_MODE are optional. So, for example, you can
-set
- symbol-> input_mode = UNICODE_MODE | ESCAPE_MODE;
+FAST_MODE, EXTRA_ESCAPE_MODE,
+GS1SYNTAXENGINE_MODE and GS1RAW_MODE are
+optional. So, for example, you can set
+ symbol-> input_mode = UNICODE_MODE | ESCAPE_MODE;
or
- symbol-> input_mode = GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE;
+ symbol-> input_mode = GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE;
whereas
- symbol-> input_mode = DATA_MODE | GS1_MODE;
+ symbol-> input_mode = DATA_MODE | GS1_MODE;
is not valid.
Permissible escape sequences (ESCAPE_MODE) are listed in
Table 2: Escape Sequences , and the special
Code 128-only EXTRA_ESCAPE_MODE escape sequences are given
in 6.1.10.1 Standard Code 128
-(ISO 15417) . An example of GS1PARENS_MODE usage is
-given in section 6.1.10.3 GS1-128 .
-GS1NOCHECK_MODE (CLI --gs1nocheck) is for
-use with legacy systems that have data that does not conform to the
-current GS1 standard. Printable ASCII input is still checked for, as is
-the validity of GS1 data specified without AIs (e.g. linear data for GS1
-DataBar Omnidirectional/Limited/etc.). Also checked is GS1 DataBar
-Expanded and GS1 Composite input that is not in the GS1 encodable
-character set 82 (see GS1 General Specifications Figure 7.11.1 ‘GS1 AI
-encodable character set 82’), otherwise encodation would fail.
-In contrast GS1SYNTAXENGINE_MODE (CLI
---gs1strict) enables the use the GS1 Syntax Engine to
-strictly validate GS1 data, including GS1 Digital Link URIs (by default
-ZINT does not validate Digital Links at all). It requires that the
-gs1encoders library was present when Zint was built,
-otherwise the default built-in validation will be used.
+(ISO 15417).
+The GS1 options GS1PARENS_MODE (CLI
+--gs1parens) , GS1NOCHECK_MODE (CLI
+--gs1nocheck), GS1SYNTAXENGINE_MODE (CLI
+--gs1strict) and GS1RAW_MODE (CLI
+--gs1raw) are described in 4.11.3 GS1 Data Entry and
+Options .
For HEIGHTPERROW_MODE, see --heightperrow
in section 4.4 Adjusting Height . The
height member should be set to the desired per-row value on
@@ -4120,17 +4300,17 @@ href="#qr-code-iso-18004">6.6.3 QR Code (ISO 18004) for details.
5.12 Multiple Segments
For input data requiring multiple ECIs, the following functions may
be used:
-int ZBarcode_Encode_Segs( struct zint_symbol * symbol,
- const struct zint_seg segs[], const int seg_count);
-
-int ZBarcode_Encode_Segs_and_Print( struct zint_symbol * symbol,
- const struct zint_seg segs[], const int seg_count, int rotate_angle);
-
-int ZBarcode_Encode_Segs_and_Buffer( struct zint_symbol * symbol,
- const struct zint_seg segs[], const int seg_count, int rotate_angle);
-
-int ZBarcode_Encode_Segs_and_Buffer_Vector( struct zint_symbol * symbol,
- const struct zint_seg segs[], const int seg_count, int rotate_angle);
+int ZBarcode_Encode_Segs( struct zint_symbol * symbol,
+ const struct zint_seg segs[], const int seg_count);
+
+int ZBarcode_Encode_Segs_and_Print( struct zint_symbol * symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
+
+int ZBarcode_Encode_Segs_and_Buffer( struct zint_symbol * symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
+
+int ZBarcode_Encode_Segs_and_Buffer_Vector( struct zint_symbol * symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
These are direct analogues of the previously mentioned
ZBarcode_Encode(),
ZBarcode_Encode_and_Print(),
@@ -4141,44 +4321,44 @@ consisting of "segs, seg_count" is given, with
segs being an array of struct zint_seg
segments and seg_count being the number of elements it
contains. The zint_seg structure is of the form:
-struct zint_seg {
- unsigned char * source; /* Data to encode */
- int length; /* Length of `source`. If 0 or negative, `source`
- must be NUL-terminated */
- int eci; /* Extended Channel Interpretation */
-};
+struct zint_seg {
+ unsigned char * source; /* Data to encode */
+ int length; /* Length of `source`. If 0 or negative, `source`
+ must be NUL-terminated */
+ int eci; /* Extended Channel Interpretation */
+};
The symbology must support ECIs (see Table 7: ECI-Aware
Symbologies ). For example:
-#include <zint.h>
-int main( int argc, char ** argv)
-{
- struct zint_seg segs[] = {
- { "Κείμενο" , 0 , 9 },
- { "Текст" , 0 , 7 },
- { "文章" , 0 , 20 }
- };
- struct zint_symbol * symbol;
- symbol = ZBarcode_Create();
- symbol-> symbology = BARCODE_AZTEC;
- symbol-> input_mode = UNICODE_MODE;
- ZBarcode_Encode_Segs( symbol, segs, 3 );
- ZBarcode_Print( symbol, 0 );
- ZBarcode_Delete( symbol);
- return 0 ;
-}
+#include <zint.h>
+int main( int argc, char ** argv)
+{
+ struct zint_seg segs[] = {
+ { "Κείμενο" , 0 , 9 },
+ { "Текст" , 0 , 7 },
+ { "文章" , 0 , 20 }
+ };
+ struct zint_symbol * symbol;
+ symbol = ZBarcode_Create();
+ symbol-> symbology = BARCODE_AZTEC;
+ symbol-> input_mode = UNICODE_MODE;
+ ZBarcode_Encode_Segs( symbol, segs, 3 );
+ ZBarcode_Print( symbol, 0 );
+ ZBarcode_Delete( symbol);
+ return 0 ;
+}
A maximum of 256 segments may be specified. Use of multiple segments
with GS1 data is not currently supported.
5.13 Scaling Helpers
To help with scaling the output, the following three function are
available:
-float ZBarcode_Default_Xdim( int symbol_id);
-
-float ZBarcode_Scale_From_XdimDp( int symbol_id, float x_dim_mm, float dpmm,
- const char * filetype);
-
-float ZBarcode_XdimDP_From_Scale( int symbol_id, float scale,
- float x_dim_mm_or_dpmm, const char * filetype);
+float ZBarcode_Default_Xdim( int symbol_id);
+
+float ZBarcode_Scale_From_XdimDp( int symbol_id, float x_dim_mm, float dpmm,
+ const char * filetype);
+
+float ZBarcode_XdimDP_From_Scale( int symbol_id, float scale,
+ float x_dim_mm_or_dpmm, const char * filetype);
The first ZBarcode_Default_Xdim() returns the default
X-dimension suggested by Zint for symbology symbol_id.
The second ZBarcode_Scale_From_XdimDp() returns the
@@ -4190,13 +4370,13 @@ however dpmm may be zero and defaults to 12 dpmm, and
is assumed. For raster output (BMP/GIF/PCX/PNG/TIF) the scale is rounded
to half-integer increments.
For example:
-/* Royal Mail 4-State Customer Code */
- symbol-> symbology = BARCODE_RM4SCC;
- symbol-> dpmm = 600.0 f / 25.4 f ; /* 600 dpi */
- symbol-> scale = ZBarcode_Scale_From_XdimDp(
- symbol-> symbology,
- ZBarcode_Default_Xdim( symbol-> symbology),
- symbol-> dpmm, "PNG" ); /* Returns 7.5 */
+/* Royal Mail 4-State Customer Code */
+ symbol-> symbology = BARCODE_RM4SCC;
+ symbol-> dpmm = 600.0 f / 25.4 f ; /* 600 dpi */
+ symbol-> scale = ZBarcode_Scale_From_XdimDp(
+ symbol-> symbology,
+ ZBarcode_Default_Xdim( symbol-> symbology),
+ symbol-> dpmm, "PNG" ); /* Returns 7.5 */
The third function ZBarcode_XdimDP_From_Scale() is the
“reverse” of ZBarcode_Scale_From_XdimDp(), returning the
X-dimension (in mm) or the dot density (in dpmm) given a scale
@@ -4211,34 +4391,34 @@ the type of scanner used, the intended scanning distance, and what media
5.14 Verifying Symbology
Availability
An additional function available in the API is:
-int ZBarcode_ValidID( int symbol_id);
+int ZBarcode_ValidID( int symbol_id);
which allows you to check whether a given symbology is available,
returning a non-zero value if so. For example:
-if ( ZBarcode_ValidID( BARCODE_PDF417) != 0 ) {
- printf( "PDF417 available \n " );
-} else {
- printf( "PDF417 not available \n " );
-}
+if ( ZBarcode_ValidID( BARCODE_PDF417) != 0 ) {
+ printf( "PDF417 available \n " );
+} else {
+ printf( "PDF417 not available \n " );
+}
Another function that may be useful is:
-int ZBarcode_BarcodeName( int symbol_id, char name[ 32 ]);
+int ZBarcode_BarcodeName( int symbol_id, char name[ 32 ]);
which copies the name of a symbology into the supplied
name buffer, which should be 32 characters in length. The
name is NUL-terminated, and zero is returned on success.
For instance:
-char name[ 32 ];
-if ( ZBarcode_BarcodeName( BARCODE_PDF417, name) == 0 ) {
- printf( " %s\n " , name);
-}
+char name[ 32 ];
+if ( ZBarcode_BarcodeName( BARCODE_PDF417, name) == 0 ) {
+ printf( " %s\n " , name);
+}
will print BARCODE_PDF417.
5.15 Checking Symbology
Capabilities
It can be useful for frontend programs to know the capabilities of a
symbology. This can be determined using another additional function:
-unsigned int ZBarcode_Cap( int symbol_id, unsigned int cap_flag);
+unsigned int ZBarcode_Cap( int symbol_id, unsigned int cap_flag);
by OR-ing the flags below in the cap_flag
argument and checking the return to see which are set.
-Table 16: API Capability
+Table 17: API Capability
Flags
@@ -4263,8 +4443,8 @@ stacked symbologies are not stackable.
ZINT_CAP_EANUPC
+href="#fn18" class="footnote-ref" id="fnref18"
+role="doc-noteref">18
Is the symbology EAN/UPC?
@@ -4331,32 +4511,32 @@ symbologies.
For example:
-unsigned int cap;
- cap = ZBarcode_Cap( BARCODE_PDF417, ZINT_CAP_HRT | ZINT_CAP_ECI);
-if ( cap & ZINT_CAP_HRT) {
- printf( "PDF417 supports HRT \n " );
-} else {
- printf( "PDF417 does not support HRT \n " );
-}
-if ( cap & ZINT_CAP_ECI) {
- printf( "PDF417 supports ECI \n " );
-} else {
- printf( "PDF417 does not support ECI \n " );
-}
+unsigned int cap;
+ cap = ZBarcode_Cap( BARCODE_PDF417, ZINT_CAP_HRT | ZINT_CAP_ECI);
+if ( cap & ZINT_CAP_HRT) {
+ printf( "PDF417 supports HRT \n " );
+} else {
+ printf( "PDF417 does not support HRT \n " );
+}
+if ( cap & ZINT_CAP_ECI) {
+ printf( "PDF417 supports ECI \n " );
+} else {
+ printf( "PDF417 does not support ECI \n " );
+}
5.16 Feedback
On successful encodation (after using ZBarcode_Encode()
etc.) the option_1, option_2 and
option_3 members will be set to the values used by Zint to
create the barcode. This is useful for feedback if the values were left
as defaults or were overridden by Zint.
-In particular for symbologies that have masks,17
+
In particular for symbologies that have masks,19
option_3 will contain the mask used as
(N + 1) << 8, N being the mask. Also Aztec Code will
return the actual ECC percentage used in option_1 as
P << 8, where P is the integer percentage, the low
byte containing the values given in Table 39: Aztec Code Error
+href="#tbl:aztec_eccs" class="cross-ref">Table 40: Aztec Code Error
Correction Modes (with the addition of 0 meaning
less than 5% + 3 codewords and -1 meaning minimum 3
codewords). Micro PDF417 also will return the ECC percentage in
@@ -4374,8 +4554,8 @@ members of zint_seg will be set accordingly - the
unconverted data in source, the data length in
length, and the character set the data was converted to in
eci. Any check characters encoded will be included, and for GS1 data any
+href="#fn20" class="footnote-ref" id="fnref20"
+role="doc-noteref">20 and for GS1 data any
FNC1 separators will be represented as GS
(ASCII 29) characters. UPC-A and UPC-E data will be expanded to EAN-13,
as will EAN-8 but only if it has an add-on (otherwise it will remain at
@@ -4392,15 +4572,15 @@ member using the two helper functions discussed next.
convenience functions
As a convenience the conversion done by Zint from UTF-8 to ECIs is
exposed in two helper functions (compatible with the
-libzueci functions
+libzueci functions
zueci_utf8_to_eci() and
zueci_dest_len_eci()):
-int ZBarcode_UTF8_To_ECI( int eci, const unsigned char * source, int length,
- unsigned char dest[], int * p_dest_length);
-
-int ZBarcode_Dest_Len_ECI( int eci, const unsigned char * source, int length,
- int * p_dest_length);
+int ZBarcode_UTF8_To_ECI( int eci, const unsigned char * source, int length,
+ unsigned char dest[], int * p_dest_length);
+
+int ZBarcode_Dest_Len_ECI( int eci, const unsigned char * source, int length,
+ int * p_dest_length);
Call ZBarcode_Dest_Len_ECI() to get the size of buffer
sufficient to accommodate the conversion, then call
ZBarcode_UTF8_To_ECI() with an appropriately sized buffer
@@ -4412,17 +4592,17 @@ is not NUL-terminated. The obsolete ECIs 0, 1 and 2 are supported.
5.18 Zint Version
Whether the Zint library was built without PNG
support may be determined with:
-int ZBarcode_NoPng( void );
+int ZBarcode_NoPng( void );
which returns 1 if PNG support is not available,
else zero.
Similarly, but with opposite sense, whether the Zint library was
built with GS1 Syntax Engine support may be determined
with:
-int ZBarcode_HaveGS1SyntaxEngine( void );
+int ZBarcode_HaveGS1SyntaxEngine( void );
which returns 1 if GS1 Syntax Engine support is
available, else zero.
Lastly, the version of the Zint library linked to is returned by:
-int ZBarcode_Version( void );
+int ZBarcode_Version( void );
The version parts are separated by hundreds. For instance, version
"2.9.1" is returned as "20901".
6. Types of Symbology
@@ -4567,9 +4747,9 @@ encodes a GTIN-12, a 12-digit Global Trade Item Number that includes a
standard GS1 check digit.
+alt="zint -b UPCA --compliantheight -d "01234500005"" />
Figure 39:
-zint -b UPCA --compliantheight -d "72527270270"
+zint -b UPCA --compliantheight -d "01234500005"
Input up to 11 digits may be given, to which a check digit will be
added by Zint. A 12-digit input including the check digit may also be
@@ -4579,37 +4759,37 @@ last digit is a check digit. Input less than 11 digits will be
zero-filled.
In addition 2-digit and 5-digit add-on symbols can be added, their
data separated from the main data by a '+' character or a
-space. For example, to draw a UPC-A symbol with the data “72527270270”
+space. For example, to draw a UPC-A symbol with the data “01234500005”
and 5-digit add-on data “12345” use the command:
-zint -b UPCA -d "72527270270+12345"
+zint -b UPCA -d "01234500005+12345"
or using the API:
- symbol-> symbology = BARCODE_UPCA;
-/* Using '+' */
- error = ZBarcode_Encode_and_Print( symbol, "72527270270+12345" , 0 , 0 );
-/* Or a space */
- error = ZBarcode_Encode_and_Print( symbol, "72527270270 12345" , 0 , 0 );
+ symbol-> symbology = BARCODE_UPCA;
+/* Using '+' */
+ error = ZBarcode_Encode_and_Print( symbol, "01234500005+12345" , 0 , 0 );
+/* Or a space */
+ error = ZBarcode_Encode_and_Print( symbol, "01234500005 12345" , 0 , 0 );
+alt="zint -b UPCA --compliantheight -d "01234500005+12345"" />
Figure 40:
-zint -b UPCA --compliantheight -d "72527270270+12345"
+zint -b UPCA --compliantheight -d "01234500005+12345"
A quiet zone indicator can be added to the HRT by setting
--guardwhitespace (API
output_options |= EANUPC_GUARD_WHITESPACE). For UPC, this
is only relevant when there is an add-on:
-zint -b UPCA -d "72527270270+12345" --guardwhitespace
+zint -b UPCA -d "01234500005+12345" --guardwhitespace
or using the API:
- symbol-> symbology = BARCODE_UPCA;
- symbol-> output_options |= EANUPC_GUARD_WHITESPACE;
- error = ZBarcode_Encode_and_Print( symbol, "72527270270+12345" , 0 , 0 );
+ symbol-> symbology = BARCODE_UPCA;
+ symbol-> output_options |= EANUPC_GUARD_WHITESPACE;
+ error = ZBarcode_Encode_and_Print( symbol, "01234500005+12345" , 0 , 0 );
+alt="zint -b UPCA --compliantheight -d "01234500005+12345" --guardwhitespace" />
Figure 41:
-zint -b UPCA --compliantheight -d "72527270270+12345" --guardwhitespace
+zint -b UPCA --compliantheight -d "01234500005+12345" --guardwhitespace
You can adjust the gap between the main symbol and an add-on in
integral multiples of the X-dimension by setting --addongap
@@ -4626,9 +4806,9 @@ be ‘0’ or ‘1’ (the latter is known as number system 1 and is
non-standard). Input less than 7 digits will be zero-filled.
+alt="zint -b UPCE --compliantheight -d "123455"" />
Figure 42:
-zint -b UPCE --compliantheight -d "123456"
+zint -b UPCE --compliantheight -d "123455"
An 8-digit input including the check digit may also be supplied, in
which case Zint will verify the check digit, or the symbology
@@ -4639,13 +4819,13 @@ a '+' character or a space as a separator, and a quiet zone
indicator can be added when there is an add-on by setting
--guardwhitespace (API
output_options |= EANUPC_GUARD_WHITESPACE):
-zint -b UPCE -d "123456+12" --guardwhitespace
+zint -b UPCE -d "123455+12" --guardwhitespace
+alt="zint -b UPCE --compliantheight -d "123455+12" --guardwhitespace" />
Figure 43:
-zint -b UPCE --compliantheight -d "123456+12" --guardwhitespace
+zint -b UPCE --compliantheight -d "123455+12" --guardwhitespace
You can adjust the gap between the main symbol and an add-on in
integral multiples of the X-dimension by setting --addongap
@@ -4665,9 +4845,9 @@ defines the symbologies EAN-13, EAN-8 and ISBN (a subset of EAN-13).
includes a standard GS1 check digit.
+alt="zint -b EAN13 --compliantheight -d "952012345678"" />
Figure 44:
-zint -b EAN13 --compliantheight -d "451234567890"
+zint -b EAN13 --compliantheight -d "952012345678"
Input up to 12 digits may be given, to which a check digit will be
added by Zint, or a 13-digit input can be supplied in which case Zint
@@ -4675,28 +4855,29 @@ will validate the check digit. Input less than 12 digits will be
zero-filled.
A 2-digit or 5-digit add-on can be added by using a ‘+’ or space
character as with UPC symbols. For example:
-zint -b EAN13 -d "451234567890+21"
+zint -b EAN13 -d "952012345678+21"
will encode an EAN-13 symbol with a 2-digit add-on. As before these
results can be achieved using the API:
- symbol-> symbology = BARCODE_EAN13;
- error = ZBarcode_Encode_and_Print( symbol, "451234567890+21" , 0 , 0 );
+ symbol-> symbology = BARCODE_EAN13;
+ error = ZBarcode_Encode_and_Print( symbol, "952012345678+21" , 0 , 0 );
+alt="zint -b EAN13 --compliantheight -d "952012345678+21"" />
Figure 45:
-zint -b EAN13 --compliantheight -d "451234567890+21"
+zint -b EAN13 --compliantheight -d "952012345678+21"
Options to add quiet zone indicators and to adjust the add-on gap and
the guard bar descent height are the same as for 6.1.3.2 UPC Version E . For instance:
-zint -b EAN13 -d "4512345678906" --guarddescent = 2.5 --guardwhitespace
+zint -b EAN13 -d "9520123456788" --guarddescent = 2.5 --guardwhitespace
+alt="zint -b EAN13 --compliantheight -d "9520123456788" –guarddescent=2.5 –guardwhitespace" />
Figure 46:
-zint -b EAN13 --compliantheight -d "4512345678906"
+zint -b EAN13 --compliantheight -d "9520123456788"
–guarddescent=2.5 –guardwhitespace
6.1.4.2 EAN-8
@@ -4704,9 +4885,9 @@ alt="zint -b EAN13 --compliantheight -d "4512345678906" –guarddescen
with 5 leading zeroes implied), for use with small packages.
+alt="zint -b EAN8 --compliantheight -d "9520000"" />
Figure 47:
-zint -b EAN8 --compliantheight -d "7432365"
+zint -b EAN8 --compliantheight -d "9520000"
Input up to 7 digits may be supplied, to which Zint will add a
standard GS1 check digit. An 8-digit input including the check digit may
@@ -4715,17 +4896,18 @@ less than 7 digits will be zero-filled.
Options to add quiet zone indicators and to adjust the guard bar
descent height are the same as for 6.1.3.2 UPC
Version E . For instance:
-zint -b EAN8 -d "7432365" --guardwhitespace
+zint -b EAN8 -d "9520000" --guardwhitespace
or using the API:
- symbol-> symbology = BARCODE_EAN8;
- symbol-> output_options |= EANUPC_GUARD_WHITESPACE;
- error = ZBarcode_Encode_and_Print( symbol, "7432365" , 0 , 0 );
+ symbol-> symbology = BARCODE_EAN8;
+ symbol-> output_options |= EANUPC_GUARD_WHITESPACE;
+ error = ZBarcode_Encode_and_Print( symbol, "9520000" , 0 , 0 );
+alt="zint -b EAN8 --compliantheight -d "9520000" –guardwhitespace" />
Figure 48:
-zint -b EAN8 --compliantheight -d "7432365"
+zint -b EAN8 --compliantheight -d "9520000"
–guardwhitespace
2-digit and 5-digit add-ons may also be added, and the gap adjusted,
@@ -4768,13 +4950,14 @@ alt="zint -b EAN_2ADDON --compliantheight -d "12"" />
As with the main EAN/UPC symbols a quiet zone indicator can be added
using ---guardwhitespace. For instance
-zint -b EAN_5ADDON -d "54321" --guardwhitespace
+zint -b EAN_5ADDON -d "54321" --guardwhitespace
will generate a standalone 5-digit add-on with quiet zone guards, or
using the API:
- symbol-> symbology = BARCODE_EAN_5ADDON;
- symbol-> output_options |= EANUPC_GUARD_WHITESPACE;
- error = ZBarcode_Encode_and_Print( symbol, "54321" , 0 , 0 );
+ symbol-> symbology = BARCODE_EAN_5ADDON;
+ symbol-> output_options |= EANUPC_GUARD_WHITESPACE;
+ error = ZBarcode_Encode_and_Print( symbol, "54321" , 0 , 0 );
@@ -4810,7 +4993,7 @@ alt="zint -b MSI_PLESSEY -d "6502" --vers=2" />
setting --vers (API option_2), shown in the
table below:
-Table 17: MSI Plessey Check
+Table 18: MSI Plessey Check
Digit Options
@@ -5045,21 +5228,21 @@ escapes \^A, \^B, \^C and
\^@ (the latter turns off manual Code Set selection). For
instance the following will force switching to Code Set B for the data
"5678" (normally Code Set C would be used throughout):
-zint -b CODE128 -d "1234\^B5678" --extraesc
+zint -b CODE128 -d "1234\^B5678" --extraesc
The manually selected Code Set will apply until the next Code Set
escape sequence or until a \^@, with the exception that
data that cannot be represented in that Code Set will be switched as
appropriate. If the data contains an extra escape sequence, it can be
escaped by doubling the caret (^). For instance
-zint -b CODE128 -d "\^AABC\^^BDEF" --extraesc
+zint -b CODE128 -d "\^AABC\^^BDEF" --extraesc
will encode the data "ABC\^BDEF" in Code Set A.
There is also the extra escape \^1, which will encode a
special Function Code 1 character (FNC1) anywhere you
choose in the data, for instance
-zint -b CODE128 -d "A\^1BC\^1DEF" --extraesc
+zint -b CODE128 -d "A\^1BC\^1DEF" --extraesc
Zint can encode a maximum of 102 symbol characters, which allows for
e.g. 202 all-numeric or 101 all-uppercase characters. Sizes above 120
digits (60 alphanumerics) are not recommended.
@@ -5067,8 +5250,8 @@ digits (60 alphanumerics) are not recommended.
Code 128 Suppress Code Set C (Code Sets A and B only)
It is sometimes advantageous to stop Code 128 from using Code Set C
which compresses numerical data. The BARCODE_CODE128AB variant (symbology 60) suppresses
+href="#fn22" class="footnote-ref" id="fnref22"
+role="doc-noteref">22 variant (symbology 60) suppresses
Code Set C in favour of Code Sets A and B.
for this variant (nor for any other).
6.1.10.3 GS1-128
A variation of Code 128 previously known as UCC/EAN-128, this
-symbology is defined by the GS1 General Specifications. Application
-Identifiers (AIs) should be entered using [square bracket] notation.
-These will be converted to parentheses (round brackets) for the Human
-Readable Text. This method allows the inclusion of parentheses in the AI
-data without escaping.
+symbology is defined by the GS1 General Specifications. Data should be
+in one of the formats described in 4.11.3.1
+GS1 Data Entry . Here we will use the square bracket format.
Figure 69:
zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"
-For compatibility with data entry in other systems, the option
---gs1parens (API input_mode |= GS1PARENS_MODE)
-may be used to signal that AIs are encased in parentheses. If there are
-any opening parentheses in the AI data, they must be escaped with a
-backslash (\(). Optionally, for clarity, closing
-parentheses may also be escaped,
Fixed length data should be entered at the appropriate length for
correct encoding. GS1-128 does not support extended ASCII (ISO/IEC
8859-1) characters. Check digits for GTIN data AI (01) are not generated
and need to be included in the input data. The following is an example
of a valid GS1-128 input:
-zint -b GS1_128 -d "[01]98898765432106[3202]012345[15]991231"
-or using the --gs1parens option:
-zint -b GS1_128 --gs1parens -d "(01)98898765432106(3202)012345(15)991231"
+zint -b GS1_128 -d "[01]98898765432106[3202]012345[15]991231"
6.1.10.4 EAN-14
A shorter version of GS1-128 which encodes GTIN-14 data only, EAN-14
takes a 13-digit input, which will be prefixed with leading zeroes if
@@ -5160,7 +5332,7 @@ usually be "%" (ASCII 37). If 27 characters are supplied,
“relabel”, see below). The rest of the 27-character input must be
alphanumeric, and is of the form: