mirror of
https://git.code.sf.net/p/zint/code
synced 2026-05-14 18:13:53 +00:00
DATAMATRIX: add new options DM_B256_START and DM_C40_START to
`options_3`, allowing forcing of Base 256 or C40 mode a la BWIPP for initial no. of characters specified in `option_1`, with 0 meaning all (CLI "--dmb256=" and "--dmc40=", GUI also (apart from MAILMARK_2D, which may be added later); export masks `DM_B256_C40_START_MASK` & `DM_SQUARE_DMRE_MASK` in "zint.h" ZBarcode_Encode_File: report filename (possibly truncated) in error message on failed open GUI: uniquify some accelerators and add some child widget getter helpers to "mainwindow.cpp" backend/DEVELOPER -> backend/README, with some expansion debian/copyright: a few more fixes BWIPP/pandoc: update to latest tests/fuzz: adjust for new DATAMATRIX options
This commit is contained in:
@@ -1524,9 +1524,12 @@ static void test_encode_file_directory(const testCtx *const p_ctx) {
|
||||
static void test_encode_file(const testCtx *const p_ctx) {
|
||||
int ret;
|
||||
struct zint_symbol *symbol = NULL;
|
||||
const char *data = "1";
|
||||
const char *filename = "test_encode_file_in.txt";
|
||||
const char *outfile = "test_encode_file_out.gif";
|
||||
const char data[] = "1";
|
||||
const char filename[] = "test_encode_file_in.txt";
|
||||
const char outfile[] = "test_encode_file_out.gif";
|
||||
const char long_filename[] = "test_encode_file_in_1234567890123456789012345678901234567890.txt";
|
||||
const char long_filename_errtxt[]
|
||||
= "Error 233: Unable to read input file \"test_encod...56789012345678901234567890.txt\" (";
|
||||
FILE *fp;
|
||||
|
||||
(void)p_ctx;
|
||||
@@ -1580,6 +1583,19 @@ static void test_encode_file(const testCtx *const p_ctx) {
|
||||
ZBarcode_Delete(symbol);
|
||||
}
|
||||
|
||||
{
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
strcpy(symbol->outfile, outfile);
|
||||
ret = ZBarcode_Encode_File_and_Buffer_Vector(symbol, long_filename, 0);
|
||||
assert_nonzero(ret, "ret %d == 0 (%s)\n", ret, symbol->errtxt);
|
||||
assert_zero(strncmp(symbol->errtxt, long_filename_errtxt, sizeof(long_filename_errtxt) - 1),
|
||||
"strncmp(%s, %s) != 0\n", symbol->errtxt, long_filename_errtxt);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
}
|
||||
|
||||
ret = testUtilRemove(filename);
|
||||
assert_zero(ret, "testUtilRemove(%s) != 0 (%d: %s)\n", filename, errno, strerror(errno));
|
||||
|
||||
@@ -1632,7 +1648,7 @@ static void test_bad_args(const testCtx *const p_ctx) {
|
||||
"Error 200: Input segments NULL",
|
||||
"Error 239: Filename NULL",
|
||||
"Error 778: No input data",
|
||||
"Error 229: Unable to read input file (", /* Excluding OS-dependent `errno` stuff */
|
||||
"Error 229: Unable to read input file \"", /* Excluding filename and OS-dependent `errno` stuff */
|
||||
"Error 771: Too many input segments (maximum 256)",
|
||||
"Error 205: No input data",
|
||||
"Error 777: Input too long",
|
||||
|
||||
Reference in New Issue
Block a user