mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-30 06:45:28 -04:00
- library: check symbol->primary for escape sequences also
- GUI: error message GS1_MODE -> GS1 mode - GUI: sequence window: fix initial clear button status - GUI: make acceptable for macOS; add iconset for macOS, install - manual: update macOS Homebrew install info; add README.macos - GUI: export window: add no. of sequences to results label
This commit is contained in:
parent
a232dec4ff
commit
15b8024712
27 changed files with 530 additions and 290 deletions
|
@ -1,8 +1,7 @@
|
|||
/* composite.c - Handles GS1 Composite Symbols */
|
||||
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2008 - 2021 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
@ -29,7 +28,7 @@
|
|||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
*/
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
/* The functions "getBit", "init928" and "encode928" are copyright BSI and are
|
||||
released with permission under the following terms:
|
||||
|
@ -1253,20 +1252,21 @@ static int cc_binary_string(struct zint_symbol *symbol, const unsigned char sour
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int linear_dummy_run(int input_mode, unsigned char *source, const int length, char *errtxt) {
|
||||
struct zint_symbol *dummy;
|
||||
/* Calculate the width of the linear part (primary) */
|
||||
static int linear_dummy_run(int input_mode, unsigned char *source, const int length, const int debug, char *errtxt) {
|
||||
struct zint_symbol dummy = {0};
|
||||
int error_number;
|
||||
int linear_width;
|
||||
|
||||
dummy = ZBarcode_Create();
|
||||
dummy->symbology = BARCODE_GS1_128_CC;
|
||||
dummy->input_mode = input_mode;
|
||||
error_number = gs1_128_cc(dummy, source, length, 3 /*cc_mode*/, 0 /*cc_rows*/);
|
||||
linear_width = dummy->width;
|
||||
if (error_number >= ZINT_ERROR) {
|
||||
strcpy(errtxt, dummy->errtxt);
|
||||
dummy.symbology = BARCODE_GS1_128_CC;
|
||||
dummy.option_1 = -1;
|
||||
dummy.input_mode = input_mode;
|
||||
dummy.debug = debug;
|
||||
error_number = gs1_128_cc(&dummy, source, length, 3 /*cc_mode*/, 0 /*cc_rows*/);
|
||||
linear_width = dummy.width;
|
||||
if (error_number >= ZINT_ERROR || (debug & ZINT_DEBUG_TEST)) {
|
||||
strcpy(errtxt, dummy.errtxt);
|
||||
}
|
||||
ZBarcode_Delete(dummy);
|
||||
|
||||
if (error_number >= ZINT_ERROR) {
|
||||
return 0;
|
||||
|
@ -1317,7 +1317,7 @@ INTERNAL int composite(struct zint_symbol *symbol, unsigned char source[], int l
|
|||
if (symbol->symbology == BARCODE_GS1_128_CC) {
|
||||
/* Do a test run of encoding the linear component to establish its width */
|
||||
linear_width = linear_dummy_run(symbol->input_mode, (unsigned char *) symbol->primary, pri_len,
|
||||
symbol->errtxt);
|
||||
symbol->debug, symbol->errtxt);
|
||||
if (linear_width == 0) {
|
||||
if (strlen(symbol->errtxt) + strlen(in_linear_comp) < sizeof(symbol->errtxt)) {
|
||||
strcat(symbol->errtxt, in_linear_comp);
|
||||
|
@ -1636,3 +1636,5 @@ INTERNAL int composite(struct zint_symbol *symbol, unsigned char source[], int l
|
|||
|
||||
return error_number ? error_number : warn_number;
|
||||
}
|
||||
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* dotcode.c - Handles DotCode */
|
||||
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2017-2022 Robin Stuart <rstuart114@gmail.com>
|
||||
|
@ -29,6 +28,7 @@
|
|||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
*/
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
/*
|
||||
* Attempts to encode DotCode according to (AIMD013) ISS DotCode Rev. 4.0, DRAFT 0.15, TSC Pre-PR #5,
|
||||
|
@ -1271,6 +1271,9 @@ INTERNAL int dotcode(struct zint_symbol *symbol, struct zint_seg segs[], const i
|
|||
}
|
||||
}
|
||||
|
||||
/* TODO: GS1 General Specifications 22.0 section 5.8.2 says Structured Append and ECIs not supported
|
||||
for GS1 DotCode so should check and return ZINT_WARN_NONCOMPLIANT if either true */
|
||||
|
||||
data_length = dc_encode_message_segs(symbol, segs, seg_count, codeword_array, &binary_finish, structapp_array,
|
||||
&structapp_size);
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* font.h - Font for PNG images */
|
||||
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2008 - 2021 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
@ -29,10 +28,10 @@
|
|||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
*/
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#ifndef FONT_H
|
||||
#define FONT_H
|
||||
#ifndef Z_FONT_H
|
||||
#define Z_FONT_H
|
||||
|
||||
typedef const unsigned short font_item;
|
||||
|
||||
|
@ -487,4 +486,5 @@ static font_item upcean_small_font[] = {
|
|||
/*39*/ 0x3C, 0x7E, 0xE7, 0xC3, 0xC3, 0xC3, 0xE3, 0x7E, 0x1E, 0x0C, 0x18, 0x30, 0x60, /* 9 */
|
||||
};
|
||||
|
||||
#endif /* FONT_H */
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
#endif /* Z_FONT_H */
|
||||
|
|
|
@ -685,7 +685,8 @@ static int esc_base(struct zint_symbol *symbol, unsigned char *input_string, int
|
|||
}
|
||||
|
||||
/* Helper to parse escape sequences */
|
||||
static int escape_char_process(struct zint_symbol *symbol, unsigned char *input_string, int *length) {
|
||||
static int escape_char_process(struct zint_symbol *symbol, unsigned char *input_string, int *p_length) {
|
||||
const int length = *p_length;
|
||||
int in_posn, out_posn;
|
||||
int ch;
|
||||
int val;
|
||||
|
@ -693,9 +694,9 @@ static int escape_char_process(struct zint_symbol *symbol, unsigned char *input_
|
|||
unsigned long unicode;
|
||||
|
||||
#ifndef _MSC_VER
|
||||
unsigned char escaped_string[*length + 1];
|
||||
unsigned char escaped_string[length + 1];
|
||||
#else
|
||||
unsigned char *escaped_string = (unsigned char *) _alloca(*length + 1);
|
||||
unsigned char *escaped_string = (unsigned char *) _alloca(length + 1);
|
||||
#endif
|
||||
|
||||
in_posn = 0;
|
||||
|
@ -703,7 +704,7 @@ static int escape_char_process(struct zint_symbol *symbol, unsigned char *input_
|
|||
|
||||
do {
|
||||
if (input_string[in_posn] == '\\') {
|
||||
if (in_posn + 1 >= *length) {
|
||||
if (in_posn + 1 >= length) {
|
||||
strcpy(symbol->errtxt, "236: Incomplete escape character in input data");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
@ -749,7 +750,7 @@ static int escape_char_process(struct zint_symbol *symbol, unsigned char *input_
|
|||
case 'd':
|
||||
case 'o': /* Undocumented (as not very useful for most people) */
|
||||
case 'x':
|
||||
if ((val = esc_base(symbol, input_string, *length, in_posn + 2, ch)) == -1) {
|
||||
if ((val = esc_base(symbol, input_string, length, in_posn + 2, ch)) == -1) {
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
escaped_string[out_posn] = val;
|
||||
|
@ -760,7 +761,7 @@ static int escape_char_process(struct zint_symbol *symbol, unsigned char *input_
|
|||
break;
|
||||
case 'u':
|
||||
case 'U':
|
||||
if (in_posn + 6 > *length || (ch == 'U' && in_posn + 8 > *length)) {
|
||||
if (in_posn + 6 > length || (ch == 'U' && in_posn + 8 > length)) {
|
||||
sprintf(symbol->errtxt, "209: Incomplete '\\%c' escape sequence in input data", ch);
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
@ -810,11 +811,11 @@ static int escape_char_process(struct zint_symbol *symbol, unsigned char *input_
|
|||
in_posn++;
|
||||
}
|
||||
out_posn++;
|
||||
} while (in_posn < *length);
|
||||
} while (in_posn < length);
|
||||
|
||||
memcpy(input_string, escaped_string, out_posn);
|
||||
input_string[out_posn] = '\0';
|
||||
*length = out_posn;
|
||||
*p_length = out_posn;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1095,7 +1096,7 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[
|
|||
if (seg_count > 1) {
|
||||
/* Note: GS1_MODE not currently supported when using multiple segments */
|
||||
if ((symbol->input_mode & 0x07) == GS1_MODE) {
|
||||
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "776: GS1_MODE not supported for multiple segments");
|
||||
return error_tag(symbol, ZINT_ERROR_INVALID_OPTION, "776: GS1 mode not supported for multiple segments");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1128,6 +1129,13 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[
|
|||
return error_tag(symbol, error_number, NULL);
|
||||
}
|
||||
}
|
||||
if (symbol->primary[0]) {
|
||||
int primary_len = (int) strlen(symbol->primary);
|
||||
error_number = escape_char_process(symbol, (unsigned char *) symbol->primary, &primary_len);
|
||||
if (error_number != 0) { /* Only returns errors, not warnings */
|
||||
return error_tag(symbol, error_number, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((symbol->input_mode & 0x07) == UNICODE_MODE) {
|
||||
|
|
10
backend/qr.c
10
backend/qr.c
|
@ -28,6 +28,7 @@
|
|||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
*/
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#include <math.h>
|
||||
#ifdef _MSC_VER
|
||||
|
@ -1452,7 +1453,7 @@ static int qr_calc_binlen(const int version, char mode[], const unsigned int dda
|
|||
|
||||
currentMode = ' '; // Null
|
||||
|
||||
if (eci != 0) { // RMQR and MICROQR do not support ECI
|
||||
if (eci != 0) { /* Not applicable to MICROQR */
|
||||
count += 4;
|
||||
if (eci <= 127) {
|
||||
count += 8;
|
||||
|
@ -1536,7 +1537,7 @@ static int qr_calc_binlen_segs(const int version, char mode[], const unsigned in
|
|||
count += 4 + 8 + 8;
|
||||
}
|
||||
|
||||
if (gs1 == 1) { /* Not applicable to MICROQR */
|
||||
if (gs1) { /* Not applicable to MICROQR */
|
||||
if (version < RMQR_VERSION) {
|
||||
count += 4;
|
||||
} else {
|
||||
|
@ -1672,6 +1673,9 @@ INTERNAL int qrcode(struct zint_symbol *symbol, struct zint_seg segs[], const in
|
|||
p_structapp = &symbol->structapp;
|
||||
}
|
||||
|
||||
/* TODO: GS1 General Specifications 22.0 section 5.7.3 says Structured Append and ECIs not supported
|
||||
for GS1 QR Code so should check and return ZINT_WARN_NONCOMPLIANT if either true */
|
||||
|
||||
est_binlen = qr_calc_binlen_segs(40, mode, ddata, local_segs, seg_count, p_structapp, 0 /*mode_preset*/, gs1,
|
||||
debug_print);
|
||||
|
||||
|
@ -2839,7 +2843,7 @@ INTERNAL int upnqr(struct zint_symbol *symbol, unsigned char source[], int lengt
|
|||
}
|
||||
break;
|
||||
case GS1_MODE: /* Should never happen as checked before being called */
|
||||
strcpy(symbol->errtxt, "571: UPNQR does not support GS-1 encoding"); /* Not reached */
|
||||
strcpy(symbol->errtxt, "571: UPNQR does not support GS1 data"); /* Not reached */
|
||||
return ZINT_ERROR_INVALID_OPTION;
|
||||
break;
|
||||
case UNICODE_MODE:
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* rss.c - GS1 DataBar (formerly Reduced Space Symbology) */
|
||||
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2008-2021 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
@ -29,7 +28,7 @@
|
|||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
*/
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
/* The functions "rss_combins" and "getRSSwidths" are copyright BSI and are
|
||||
released with permission under the following terms:
|
||||
|
@ -158,18 +157,15 @@ static void getRSSwidths(int widths[], int val, int n, const int elements, const
|
|||
}
|
||||
|
||||
/* Set GTIN-14 human readable text */
|
||||
static void dbar_set_gtin14_hrt(struct zint_symbol *symbol, const unsigned char *source, const int src_len) {
|
||||
int i;
|
||||
static void dbar_set_gtin14_hrt(struct zint_symbol *symbol, const unsigned char *source, const int length) {
|
||||
unsigned char *hrt = symbol->text + 4;
|
||||
const int leading_zeroes = 13 - length;
|
||||
|
||||
ustrcpy(symbol->text, "(01)");
|
||||
for (i = 0; i < 12; i++) {
|
||||
hrt[i] = '0';
|
||||
if (leading_zeroes) {
|
||||
memset(hrt, '0', leading_zeroes);
|
||||
}
|
||||
for (i = 0; i < src_len; i++) {
|
||||
hrt[12 - i] = source[src_len - i - 1];
|
||||
}
|
||||
|
||||
memcpy(hrt + leading_zeroes, source, length);
|
||||
hrt[13] = gs1_check_digit(hrt, 13);
|
||||
hrt[14] = '\0';
|
||||
}
|
||||
|
@ -290,7 +286,7 @@ INTERNAL int dbar_omnstk_set_height(struct zint_symbol *symbol, const int first_
|
|||
}
|
||||
|
||||
/* GS1 DataBar Omnidirectional/Truncated/Stacked, allowing for composite if `cc_rows` set */
|
||||
INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int src_len, const int cc_rows) {
|
||||
INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int length, const int cc_rows) {
|
||||
int error_number = 0, i;
|
||||
large_int accum;
|
||||
uint64_t left_pair, right_pair;
|
||||
|
@ -302,22 +298,22 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
|
||||
separator_row = 0;
|
||||
|
||||
if (src_len > 14) { /* Allow check digit to be specified (will be verified and ignored) */
|
||||
if (length > 14) { /* Allow check digit to be specified (will be verified and ignored) */
|
||||
strcpy(symbol->errtxt, "380: Input too long (14 character maximum)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
if (!is_sane(NEON_F, source, src_len)) {
|
||||
if (!is_sane(NEON_F, source, length)) {
|
||||
strcpy(symbol->errtxt, "381: Invalid character in data (digits only)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
if (src_len == 14) { /* Verify check digit */
|
||||
if (length == 14) { /* Verify check digit */
|
||||
if (gs1_check_digit(source, 13) != source[13]) {
|
||||
sprintf(symbol->errtxt, "388: Invalid check digit '%c', expecting '%c'",
|
||||
source[13], gs1_check_digit(source, 13));
|
||||
return ZINT_ERROR_INVALID_CHECK;
|
||||
}
|
||||
src_len--; /* Ignore */
|
||||
length--; /* Ignore */
|
||||
}
|
||||
|
||||
/* make some room for a separator row for composite symbols */
|
||||
|
@ -331,7 +327,7 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
break;
|
||||
}
|
||||
|
||||
large_load_str_u64(&accum, source, src_len);
|
||||
large_load_str_u64(&accum, source, length);
|
||||
|
||||
if (cc_rows) {
|
||||
/* Add symbol linkage flag */
|
||||
|
@ -490,7 +486,7 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
symbol->rows = symbol->rows + 1;
|
||||
|
||||
/* Set human readable text */
|
||||
dbar_set_gtin14_hrt(symbol, source, src_len);
|
||||
dbar_set_gtin14_hrt(symbol, source, length);
|
||||
|
||||
if (symbol->output_options & COMPLIANT_HEIGHT) {
|
||||
/* Minimum height is 13X for truncated symbol ISO/IEC 24724:2011 5.3.1
|
||||
|
@ -621,12 +617,12 @@ INTERNAL int dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
}
|
||||
|
||||
/* GS1 DataBar Omnidirectional/Truncated/Stacked */
|
||||
INTERNAL int dbar_omn(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
||||
return dbar_omn_cc(symbol, source, src_len, 0 /*cc_rows*/);
|
||||
INTERNAL int dbar_omn(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
return dbar_omn_cc(symbol, source, length, 0 /*cc_rows*/);
|
||||
}
|
||||
|
||||
/* GS1 DataBar Limited, allowing for composite if `cc_rows` set */
|
||||
INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int src_len, const int cc_rows) {
|
||||
INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int length, const int cc_rows) {
|
||||
int error_number = 0, i;
|
||||
large_int accum;
|
||||
uint64_t left_character, right_character;
|
||||
|
@ -639,25 +635,25 @@ INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
|
||||
separator_row = 0;
|
||||
|
||||
if (src_len > 14) { /* Allow check digit to be specified (will be verified and ignored) */
|
||||
if (length > 14) { /* Allow check digit to be specified (will be verified and ignored) */
|
||||
strcpy(symbol->errtxt, "382: Input too long (14 character maximum)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
if (!is_sane(NEON_F, source, src_len)) {
|
||||
if (!is_sane(NEON_F, source, length)) {
|
||||
strcpy(symbol->errtxt, "383: Invalid character in data (digits only)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
if (src_len == 14) { /* Verify check digit */
|
||||
if (length == 14) { /* Verify check digit */
|
||||
if (gs1_check_digit(source, 13) != source[13]) {
|
||||
sprintf(symbol->errtxt, "389: Invalid check digit '%c', expecting '%c'",
|
||||
source[13], gs1_check_digit(source, 13));
|
||||
return ZINT_ERROR_INVALID_CHECK;
|
||||
}
|
||||
src_len--; /* Ignore */
|
||||
length--; /* Ignore */
|
||||
}
|
||||
|
||||
if (src_len == 13) {
|
||||
if (length == 13) {
|
||||
if ((source[0] != '0') && (source[0] != '1')) {
|
||||
strcpy(symbol->errtxt, "384: Input out of range (0 to 1999999999999)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
|
@ -671,7 +667,7 @@ INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
symbol->rows += 1;
|
||||
}
|
||||
|
||||
large_load_str_u64(&accum, source, src_len);
|
||||
large_load_str_u64(&accum, source, length);
|
||||
|
||||
if (cc_rows) {
|
||||
/* Add symbol linkage flag */
|
||||
|
@ -795,7 +791,7 @@ INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
}
|
||||
|
||||
/* Set human readable text */
|
||||
dbar_set_gtin14_hrt(symbol, source, src_len);
|
||||
dbar_set_gtin14_hrt(symbol, source, length);
|
||||
|
||||
/* ISO/IEC 24724:2011 6.2 10X minimum height, use as default also */
|
||||
if (symbol->symbology == BARCODE_DBAR_LTD_CC) {
|
||||
|
@ -812,8 +808,8 @@ INTERNAL int dbar_ltd_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
}
|
||||
|
||||
/* GS1 DataBar Limited */
|
||||
INTERNAL int dbar_ltd(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
||||
return dbar_ltd_cc(symbol, source, src_len, 0 /*cc_rows*/);
|
||||
INTERNAL int dbar_ltd(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
return dbar_ltd_cc(symbol, source, length, 0 /*cc_rows*/);
|
||||
}
|
||||
|
||||
/* Check and convert date to DataBar date value */
|
||||
|
@ -1259,8 +1255,23 @@ 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) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= length; i++) { /* Include terminating NUL */
|
||||
if (source[i] == '[') {
|
||||
symbol->text[i] = '(';
|
||||
} else if (source[i] == ']') {
|
||||
symbol->text[i] = ')';
|
||||
} else {
|
||||
symbol->text[i] = source[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* GS1 DataBar Expanded, setting linkage for composite if `cc_rows` set */
|
||||
INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int src_len, const int cc_rows) {
|
||||
INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int length, const int cc_rows) {
|
||||
int error_number, warn_number = 0;
|
||||
int i, j, k, p, codeblocks, data_chars, vs, group, v_odd, v_even;
|
||||
int latch;
|
||||
|
@ -1268,7 +1279,7 @@ INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
int check_char, c_odd, c_even, elements[235], pattern_width, reader, writer;
|
||||
int separator_row;
|
||||
/* Allow for 8 bits + 5-bit latch per char + 200 bits overhead/padding */
|
||||
unsigned int bin_len = 13 * src_len + 200 + 1;
|
||||
unsigned int bin_len = 13 * length + 200 + 1;
|
||||
int widths[4];
|
||||
int bp = 0;
|
||||
int cols_per_row = 0;
|
||||
|
@ -1276,16 +1287,16 @@ INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
int stack_rows = 1;
|
||||
const int debug_print = (symbol->debug & ZINT_DEBUG_PRINT);
|
||||
#ifndef _MSC_VER
|
||||
unsigned char reduced[src_len + 1];
|
||||
unsigned char reduced[length + 1];
|
||||
char binary_string[bin_len];
|
||||
#else
|
||||
unsigned char *reduced = (unsigned char *) _alloca(src_len + 1);
|
||||
unsigned char *reduced = (unsigned char *) _alloca(length + 1);
|
||||
char *binary_string = (char *) _alloca(bin_len);
|
||||
#endif
|
||||
|
||||
separator_row = 0;
|
||||
|
||||
error_number = gs1_verify(symbol, source, src_len, reduced);
|
||||
error_number = gs1_verify(symbol, source, length, reduced);
|
||||
if (error_number >= ZINT_ERROR) {
|
||||
return error_number;
|
||||
}
|
||||
|
@ -1466,16 +1477,7 @@ INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
}
|
||||
symbol->rows = symbol->rows + 1;
|
||||
|
||||
/* Add human readable text */
|
||||
for (i = 0; i <= src_len; i++) {
|
||||
if (source[i] == '[') {
|
||||
symbol->text[i] = '(';
|
||||
} else if (source[i] == ']') {
|
||||
symbol->text[i] = ')';
|
||||
} else {
|
||||
symbol->text[i] = source[i];
|
||||
}
|
||||
}
|
||||
dbar_exp_hrt(symbol, source, length);
|
||||
|
||||
} else {
|
||||
int current_row, current_block, left_to_right;
|
||||
|
@ -1621,6 +1623,8 @@ INTERNAL int dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[], int
|
|||
}
|
||||
|
||||
/* GS1 DataBar Expanded */
|
||||
INTERNAL int dbar_exp(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
||||
return dbar_exp_cc(symbol, source, src_len, 0 /*cc_rows*/);
|
||||
INTERNAL int dbar_exp(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
return dbar_exp_cc(symbol, source, length, 0 /*cc_rows*/);
|
||||
}
|
||||
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
# elif defined(__GNUC__)
|
||||
# pragma GCC diagnostic ignored "-Wformat" /* Unfortunately doesn't seem to be way to only avoid non-ISO warnings */
|
||||
# endif
|
||||
#elif defined(_MSC_VER) || __WORDSIZE == 32
|
||||
#elif defined(_MSC_VER) || defined(__APPLE__) || __WORDSIZE == 32
|
||||
# define LX_FMT "ll"
|
||||
#else
|
||||
# define LX_FMT "l"
|
||||
|
|
|
@ -295,7 +295,7 @@ static void test_checks_segs(int index, int debug) {
|
|||
/* 6*/ { BARCODE_CODE128, -1, { { TU("A"), 0, 3 }, { TU("B"), 0, 4 } }, 2, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 775: Symbology does not support multiple segments" },
|
||||
/* 7*/ { BARCODE_CODE128, -1, { { TU("A"), 0, 3 }, { NULL, 0, 0 } }, 1, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 217: Symbology does not support ECI switching" },
|
||||
/* 8*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("B"), 0, 1 } }, 2, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 218: Invalid ECI code 1" },
|
||||
/* 9*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("B"), 0, 4 } }, 2, GS1_MODE, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 776: GS1_MODE not supported for multiple segments" },
|
||||
/* 9*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("B"), 0, 4 } }, 2, GS1_MODE, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 776: GS1 mode not supported for multiple segments" },
|
||||
/* 10*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("\200"), 0, 4 } }, 2, UNICODE_MODE, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input data" },
|
||||
/* 11*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("B"), 0, 4 } }, 2, -1, -1, -1, 0, "" },
|
||||
/* 12*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 0 }, { TU("B"), 0, 4 } }, 2, -1, 3, -1, 0, "" },
|
||||
|
@ -458,6 +458,7 @@ static void test_escape_char_process(int index, int generate, int debug) {
|
|||
int input_mode;
|
||||
int eci;
|
||||
char *data;
|
||||
char *composite;
|
||||
int ret;
|
||||
int expected_width;
|
||||
char *expected;
|
||||
|
@ -465,90 +466,95 @@ static void test_escape_char_process(int index, int generate, int debug) {
|
|||
char *comment;
|
||||
};
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 26, "01 05 08 09 0A 0B 0C 0D 0E 1C 1E 1F EB 02 5D 81 21 0D 92 2E 3D FD B6 9A 37 2A CD 61 FB 95", 0, "" },
|
||||
/* 1*/ { BARCODE_CODABLOCKF, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 101, "(45) 67 62 43 40 44 47 48 29 6A 67 62 0B 49 4A 4B 4C 18 6A 67 62 0C 4D 5B 5D 5E 62 6A 67", 0, "" },
|
||||
/* 2*/ { BARCODE_CODE16K, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 70, "(20) 14 64 68 71 72 73 74 75 76 77 91 93 94 101 65 60 103 103 45 61", 0, "" },
|
||||
/* 3*/ { BARCODE_DOTCODE, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 28, "65 40 44 47 48 49 4A 4B 4C 4D 5B 5D 5E 6E 41 3C 6A", 0, "" },
|
||||
/* 4*/ { BARCODE_GRIDMATRIX, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 30, "30 1A 00 02 01 61 00 48 28 16 0C 06 46 63 51 74 05 38 00", 0, "" },
|
||||
/* 5*/ { BARCODE_HANXIN, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 23, "2F 80 10 72 09 28 B3 0D 6F F3 00 20 E8 F4 0A E0 00", 0, "" },
|
||||
/* 6*/ { BARCODE_MAXICODE, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 30, "(144) 04 3E 3E 00 04 07 08 09 0A 0B 03 3D 2C 24 19 1E 23 1B 18 0E 0C 0D 1E 21 3C 1E 3C 31", 0, "" },
|
||||
/* 7*/ { BARCODE_PDF417, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 120, "(24) 16 901 0 23 655 318 98 18 461 639 893 122 129 92 900 900 872 438 359 646 522 773 831", 0, "" },
|
||||
/* 8*/ { BARCODE_ULTRA, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 20, "(15) 257 0 4 7 8 9 10 11 12 13 27 29 30 129 92", 0, "" },
|
||||
/* 9*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\d129\\o201\\\\", 0, 18, "(32) 01 05 08 09 0A 0B 0C 0D 0E 1C 1E 1F E7 32 45 DB 70 5D E3 16 7B 2B 44 60 E1 55 F7 08", 0, "" },
|
||||
/* 10*/ { BARCODE_HANXIN, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\d129\\o201\\\\", 0, 23, "2F 80 10 72 09 28 B3 0D 6F F3 00 30 E8 F4 0C 0C 0A E0 00 00 00", 0, "" },
|
||||
/* 11*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\c", ZINT_ERROR_INVALID_DATA, 0, "Error 234: Unrecognised escape character '\\c' in input data", 0, "" },
|
||||
/* 12*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\", ZINT_ERROR_INVALID_DATA, 0, "Error 236: Incomplete escape character in input data", 0, "" },
|
||||
/* 13*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\x", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\x' escape sequence in input data", 0, "" },
|
||||
/* 14*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\x1", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\x' escape sequence in input data", 0, "" },
|
||||
/* 15*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\x1g", ZINT_ERROR_INVALID_DATA, 0, "Error 233: Invalid character for '\\x' escape sequence in input data (hexadecimal only)", 0, "" },
|
||||
/* 16*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\d' escape sequence in input data", 0, "" },
|
||||
/* 17*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d1", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\d' escape sequence in input data", 0, "" },
|
||||
/* 18*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d12", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\d' escape sequence in input data", 0, "" },
|
||||
/* 19*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d12a", ZINT_ERROR_INVALID_DATA, 0, "Error 233: Invalid character for '\\d' escape sequence in input data (decimal only)", 0, "" },
|
||||
/* 20*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\o' escape sequence in input data", 0, "" },
|
||||
/* 21*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o1", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\o' escape sequence in input data", 0, "" },
|
||||
/* 22*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o12", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\o' escape sequence in input data", 0, "" },
|
||||
/* 23*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o128", ZINT_ERROR_INVALID_DATA, 0, "Error 233: Invalid character for '\\o' escape sequence in input data (octal only)", 0, "" },
|
||||
/* 24*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\xA01\\xFF", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 0, "" },
|
||||
/* 25*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d1601\\d255", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 1, "" },
|
||||
/* 26*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o2401\\o377", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 1, "" },
|
||||
/* 27*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\u00A01\\u00FF", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 1, "" },
|
||||
/* 28*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\U0000A01\\U0000FF", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 1, "" },
|
||||
/* 29*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\xc3\\xbF", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 0, "" },
|
||||
/* 30*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d195\\d191", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 1, "" },
|
||||
/* 31*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o303\\o277", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 1, "" },
|
||||
/* 32*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u00fF", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 1, "" },
|
||||
/* 33*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U0000fF", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 1, "" },
|
||||
/* 34*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\xc3\\xbF", 0, 10, "EB 80 81 47 1E 45 FC 93", 0, "" },
|
||||
/* 35*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\d195\\d191", 0, 10, "EB 80 81 47 1E 45 FC 93", 1, "" },
|
||||
/* 36*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\o303\\o277", 0, 10, "EB 80 81 47 1E 45 FC 93", 1, "" },
|
||||
/* 37*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\u00fF", 0, 10, "EB 80 81 47 1E 45 FC 93", 1, "" },
|
||||
/* 38*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\U0000fF", 0, 10, "EB 80 81 47 1E 45 FC 93", 1, "" },
|
||||
/* 39*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 40*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\uF", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 41*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u0F", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 42*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\uFG", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 43*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u00F", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 44*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u00FG", ZINT_ERROR_INVALID_DATA, 0, "Error 211: Invalid character for '\\u' escape sequence in input data (hexadecimal only)", 0, "" },
|
||||
/* 45*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\ufffe", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Invalid value for '\\u' escape sequence in input data", 0, "Reversed BOM" },
|
||||
/* 46*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\ud800", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Invalid value for '\\u' escape sequence in input data", 0, "Surrogate" },
|
||||
/* 47*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\udfff", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Invalid value for '\\u' escape sequence in input data", 0, "Surrogate" },
|
||||
/* 48*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, "\\xE2\\x82\\xAC", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 0, "Zint manual 4.10 Ex1" },
|
||||
/* 49*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, "\\u20AC", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 1, "" },
|
||||
/* 50*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, "\\U0020AC", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 1, "" },
|
||||
/* 51*/ { BARCODE_DATAMATRIX, DATA_MODE, 17, "\\xA4", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 1, "" },
|
||||
/* 52*/ { BARCODE_DATAMATRIX, DATA_MODE, 28, "\\xB1\\x60", 0, 12, "F1 1D EB 32 61 D9 1C 0C C2 46 C3 B2", 0, "Zint manual 4.10 Ex2" },
|
||||
/* 53*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 28, "\\u5E38", 0, 12, "F1 1D EB 32 61 D9 1C 0C C2 46 C3 B2", 1, "" },
|
||||
/* 54*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 28, "\\U005E38", 0, 12, "F1 1D EB 32 61 D9 1C 0C C2 46 C3 B2", 1, "" },
|
||||
/* 55*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\u007F", 0, 10, "80 81 46 73 64 88 6A 84", 0, "" },
|
||||
/* 56*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\U00007F", 0, 10, "80 81 46 73 64 88 6A 84", 0, "" },
|
||||
/* 57*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 58*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\UF", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 59*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U0F", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 60*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\UFG", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 61*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U00F", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 62*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U00FG", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 63*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\Ufffe", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "Reversed BOM" },
|
||||
/* 64*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\Ud800", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "Surrogate" },
|
||||
/* 65*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\Udfff", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "Surrogate" },
|
||||
/* 66*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U000F", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 67*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U0000F", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 68*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U110000", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Invalid value for '\\U' escape sequence in input data", 0, "" },
|
||||
/* 69*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, "\\U10FFFF", 0, 14, "F1 1A 01 01 EB 80 EB 80 3F C0 9C 0B 4B B8 DA B7 B6 1A", 0, "" },
|
||||
/* 70*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, "\\U10FFFF", 0, 14, "F1 1B 01 E7 EC 71 D7 6C 20 D6 B3 63 E2 18 B6 4C 7D 3E", 0, "" },
|
||||
/* 71*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, "\\U10FFFF", 0, 32, "F1 21 01 EB 05 32 EB 25 3A 81 7E 98 9B 50 AC 1C E0 4E 51 BA 23", 0, "" },
|
||||
/* 72*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, "\\U10FFFF", 0, 14, "F1 22 01 01 EB 80 EB 80 A3 E5 BE FB 1A 08 94 2E C3 74", 0, "" },
|
||||
/* 73*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, "\\U10FFFF", 0, 16, "F1 23 01 01 01 01 01 01 EB 80 EB 80 F6 F1 5D 2A D1 0A BF BC B8 22 65 0C", 0, "" },
|
||||
/* 74*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, "\\U10FFFF", 0, 16, "F1 24 01 01 01 01 EB 80 EB 80 01 01 7F 58 28 41 7F 63 0E EB A7 D8 D0 1F", 0, "" },
|
||||
/* 0*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 26, "01 05 08 09 0A 0B 0C 0D 0E 1C 1E 1F EB 02 5D 81 21 0D 92 2E 3D FD B6 9A 37 2A CD 61 FB 95", 0, "" },
|
||||
/* 1*/ { BARCODE_CODABLOCKF, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 101, "(45) 67 62 43 40 44 47 48 29 6A 67 62 0B 49 4A 4B 4C 18 6A 67 62 0C 4D 5B 5D 5E 62 6A 67", 0, "" },
|
||||
/* 2*/ { BARCODE_CODE16K, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 70, "(20) 14 64 68 71 72 73 74 75 76 77 91 93 94 101 65 60 103 103 45 61", 0, "" },
|
||||
/* 3*/ { BARCODE_DOTCODE, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 28, "65 40 44 47 48 49 4A 4B 4C 4D 5B 5D 5E 6E 41 3C 6A", 0, "" },
|
||||
/* 4*/ { BARCODE_GRIDMATRIX, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 30, "30 1A 00 02 01 61 00 48 28 16 0C 06 46 63 51 74 05 38 00", 0, "" },
|
||||
/* 5*/ { BARCODE_HANXIN, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 23, "2F 80 10 72 09 28 B3 0D 6F F3 00 20 E8 F4 0A E0 00", 0, "" },
|
||||
/* 6*/ { BARCODE_MAXICODE, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 30, "(144) 04 3E 3E 00 04 07 08 09 0A 0B 03 3D 2C 24 19 1E 23 1B 18 0E 0C 0D 1E 21 3C 1E 3C 31", 0, "" },
|
||||
/* 7*/ { BARCODE_PDF417, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 120, "(24) 16 901 0 23 655 318 98 18 461 639 893 122 129 92 900 900 872 438 359 646 522 773 831", 0, "" },
|
||||
/* 8*/ { BARCODE_ULTRA, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", "", 0, 20, "(15) 257 0 4 7 8 9 10 11 12 13 27 29 30 129 92", 0, "" },
|
||||
/* 9*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\d129\\o201\\\\", "", 0, 18, "(32) 01 05 08 09 0A 0B 0C 0D 0E 1C 1E 1F E7 32 45 DB 70 5D E3 16 7B 2B 44 60 E1 55 F7 08", 0, "" },
|
||||
/* 10*/ { BARCODE_HANXIN, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\d129\\o201\\\\", "", 0, 23, "2F 80 10 72 09 28 B3 0D 6F F3 00 30 E8 F4 0C 0C 0A E0 00 00 00", 0, "" },
|
||||
/* 11*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\c", "", ZINT_ERROR_INVALID_DATA, 0, "Error 234: Unrecognised escape character '\\c' in input data", 0, "" },
|
||||
/* 12*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\", "", ZINT_ERROR_INVALID_DATA, 0, "Error 236: Incomplete escape character in input data", 0, "" },
|
||||
/* 13*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\x", "", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\x' escape sequence in input data", 0, "" },
|
||||
/* 14*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\x1", "", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\x' escape sequence in input data", 0, "" },
|
||||
/* 15*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\x1g", "", ZINT_ERROR_INVALID_DATA, 0, "Error 233: Invalid character for '\\x' escape sequence in input data (hexadecimal only)", 0, "" },
|
||||
/* 16*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d", "", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\d' escape sequence in input data", 0, "" },
|
||||
/* 17*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d1", "", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\d' escape sequence in input data", 0, "" },
|
||||
/* 18*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d12", "", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\d' escape sequence in input data", 0, "" },
|
||||
/* 19*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d12a", "", ZINT_ERROR_INVALID_DATA, 0, "Error 233: Invalid character for '\\d' escape sequence in input data (decimal only)", 0, "" },
|
||||
/* 20*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o", "", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\o' escape sequence in input data", 0, "" },
|
||||
/* 21*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o1", "", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\o' escape sequence in input data", 0, "" },
|
||||
/* 22*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o12", "", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete '\\o' escape sequence in input data", 0, "" },
|
||||
/* 23*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o128", "", ZINT_ERROR_INVALID_DATA, 0, "Error 233: Invalid character for '\\o' escape sequence in input data (octal only)", 0, "" },
|
||||
/* 24*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\xA01\\xFF", "", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 0, "" },
|
||||
/* 25*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d1601\\d255", "", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 1, "" },
|
||||
/* 26*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o2401\\o377", "", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 1, "" },
|
||||
/* 27*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\u00A01\\u00FF", "", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 1, "" },
|
||||
/* 28*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\U0000A01\\U0000FF", "", 0, 12, "EB 21 32 EB 80 D8 49 44 DC 7D 9E 3B", 1, "" },
|
||||
/* 29*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\xc3\\xbF", "", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 0, "" },
|
||||
/* 30*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\d195\\d191", "", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 1, "" },
|
||||
/* 31*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\o303\\o277", "", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 1, "" },
|
||||
/* 32*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u00fF", "", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 1, "" },
|
||||
/* 33*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U0000fF", "", 0, 12, "EB 44 EB 40 81 30 87 17 C5 68 5C 91", 1, "" },
|
||||
/* 34*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\xc3\\xbF", "", 0, 10, "EB 80 81 47 1E 45 FC 93", 0, "" },
|
||||
/* 35*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\d195\\d191", "", 0, 10, "EB 80 81 47 1E 45 FC 93", 1, "" },
|
||||
/* 36*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\o303\\o277", "", 0, 10, "EB 80 81 47 1E 45 FC 93", 1, "" },
|
||||
/* 37*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\u00fF", "", 0, 10, "EB 80 81 47 1E 45 FC 93", 1, "" },
|
||||
/* 38*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\U0000fF", "", 0, 10, "EB 80 81 47 1E 45 FC 93", 1, "" },
|
||||
/* 39*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 40*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\uF", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 41*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u0F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 42*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\uFG", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 43*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u00F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input data", 0, "" },
|
||||
/* 44*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u00FG", "", ZINT_ERROR_INVALID_DATA, 0, "Error 211: Invalid character for '\\u' escape sequence in input data (hexadecimal only)", 0, "" },
|
||||
/* 45*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\ufffe", "", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Invalid value for '\\u' escape sequence in input data", 0, "Reversed BOM" },
|
||||
/* 46*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\ud800", "", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Invalid value for '\\u' escape sequence in input data", 0, "Surrogate" },
|
||||
/* 47*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\udfff", "", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Invalid value for '\\u' escape sequence in input data", 0, "Surrogate" },
|
||||
/* 48*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, "\\xE2\\x82\\xAC", "", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 0, "Zint manual 4.10 Ex1" },
|
||||
/* 49*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, "\\u20AC", "", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 1, "" },
|
||||
/* 50*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, "\\U0020AC", "", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 1, "" },
|
||||
/* 51*/ { BARCODE_DATAMATRIX, DATA_MODE, 17, "\\xA4", "", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 1, "" },
|
||||
/* 52*/ { BARCODE_DATAMATRIX, DATA_MODE, 28, "\\xB1\\x60", "", 0, 12, "F1 1D EB 32 61 D9 1C 0C C2 46 C3 B2", 0, "Zint manual 4.10 Ex2" },
|
||||
/* 53*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 28, "\\u5E38", "", 0, 12, "F1 1D EB 32 61 D9 1C 0C C2 46 C3 B2", 1, "" },
|
||||
/* 54*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 28, "\\U005E38", "", 0, 12, "F1 1D EB 32 61 D9 1C 0C C2 46 C3 B2", 1, "" },
|
||||
/* 55*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\u007F", "", 0, 10, "80 81 46 73 64 88 6A 84", 0, "" },
|
||||
/* 56*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, "\\U00007F", "", 0, 10, "80 81 46 73 64 88 6A 84", 0, "" },
|
||||
/* 57*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 58*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\UF", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 59*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U0F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 60*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\UFG", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 61*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U00F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 62*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U00FG", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 63*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\Ufffe", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "Reversed BOM" },
|
||||
/* 64*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\Ud800", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "Surrogate" },
|
||||
/* 65*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\Udfff", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "Surrogate" },
|
||||
/* 66*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U000F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 67*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U0000F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input data", 0, "" },
|
||||
/* 68*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U110000", "", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Invalid value for '\\U' escape sequence in input data", 0, "" },
|
||||
/* 69*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, "\\U10FFFF", "", 0, 14, "F1 1A 01 01 EB 80 EB 80 3F C0 9C 0B 4B B8 DA B7 B6 1A", 0, "" },
|
||||
/* 70*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, "\\U10FFFF", "", 0, 14, "F1 1B 01 E7 EC 71 D7 6C 20 D6 B3 63 E2 18 B6 4C 7D 3E", 0, "" },
|
||||
/* 71*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, "\\U10FFFF", "", 0, 32, "F1 21 01 EB 05 32 EB 25 3A 81 7E 98 9B 50 AC 1C E0 4E 51 BA 23", 0, "" },
|
||||
/* 72*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, "\\U10FFFF", "", 0, 14, "F1 22 01 01 EB 80 EB 80 A3 E5 BE FB 1A 08 94 2E C3 74", 0, "" },
|
||||
/* 73*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, "\\U10FFFF", "", 0, 16, "F1 23 01 01 01 01 01 01 EB 80 EB 80 F6 F1 5D 2A D1 0A BF BC B8 22 65 0C", 0, "" },
|
||||
/* 74*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, "\\U10FFFF", "", 0, 16, "F1 24 01 01 01 01 EB 80 EB 80 01 01 7F 58 28 41 7F 63 0E EB A7 D8 D0 1F", 0, "" },
|
||||
/* 75*/ { BARCODE_GS1_128_CC, GS1_MODE, -1, "[20]10", "[10]A", 0, 99, "(7) 105 102 20 10 100 59 106", 0, "" },
|
||||
/* 76*/ { BARCODE_GS1_128_CC, GS1_MODE | ESCAPE_MODE, -1, "[2\\x30]1\\d048", "[\\x310]\\x41", 0, 99, "(7) 105 102 20 10 100 59 106", 1, "" },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
struct zint_symbol *symbol;
|
||||
|
||||
char escaped[1024];
|
||||
char escaped_composite[1024];
|
||||
struct zint_symbol previous_symbol;
|
||||
char *input_filename = "test_escape.txt";
|
||||
|
||||
char *text;
|
||||
|
||||
testStart("test_escape_char_process");
|
||||
|
||||
for (i = 0; i < data_size; i++) {
|
||||
|
@ -559,17 +565,25 @@ static void test_escape_char_process(int index, int generate, int debug) {
|
|||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
symbol->debug = ZINT_DEBUG_TEST; // Needed to get codeword dump in errtxt
|
||||
if (is_composite(data[i].symbology)) {
|
||||
text = data[i].composite;
|
||||
strcpy(symbol->primary, data[i].data);
|
||||
} else {
|
||||
text = data[i].data;
|
||||
}
|
||||
|
||||
length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode | ESCAPE_MODE, data[i].eci, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
|
||||
debug |= ZINT_DEBUG_TEST; // Needed to get codeword dump in errtxt
|
||||
|
||||
ret = ZBarcode_Encode(symbol, TU(data[i].data), length);
|
||||
length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode | ESCAPE_MODE, data[i].eci, -1 /*option_1*/, -1, -1, -1 /*output_options*/, text, -1, debug);
|
||||
|
||||
ret = ZBarcode_Encode(symbol, TU(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 (generate) {
|
||||
printf(" /*%3d*/ { %s, %s, %d, \"%s\", %s, %d, \"%s\", %d, \"%s\" },\n",
|
||||
printf(" /*%3d*/ { %s, %s, %d, \"%s\", \"%s\", %s, %d, \"%s\", %d, \"%s\" },\n",
|
||||
i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), data[i].eci,
|
||||
testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
|
||||
testUtilEscape(data[i].composite, strlen(data[i].composite), escaped_composite, sizeof(escaped_composite)),
|
||||
testUtilErrorName(data[i].ret), symbol->width, symbol->errtxt, data[i].compare_previous, data[i].comment);
|
||||
} else {
|
||||
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
|
||||
|
@ -583,7 +597,7 @@ static void test_escape_char_process(int index, int generate, int debug) {
|
|||
}
|
||||
memcpy(&previous_symbol, symbol, sizeof(previous_symbol));
|
||||
|
||||
if (ret < 5) {
|
||||
if (ret < ZINT_ERROR && !data[i].composite[0]) {
|
||||
// Test from input file
|
||||
FILE *fp;
|
||||
struct zint_symbol *symbol2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue