mirror of
https://git.code.sf.net/p/zint/code
synced 2026-08-06 21:38:53 +00:00
CLI: make --mirror available in standard non-batch mode via
new routines `mirror_start()`, `mirror_outfile()` & limit substitutions on Unix to backslash (Windows remains the same); restrict "borderwidth", "textgap", "vwhitesp", "whitesp" < 100 CODEONE: fix `ceilf()` -> `C1_MULT_CEIL()` in FAST_MODE encodation (improves/changes some encodation) composite: preserve `gs1_verify()` warning using `warn_level` hack; fix wrong name `zint_dbar_omnstk_set_height()` -> `zint_dbar_stk_set_height()`; use new `zint_micropdf_variant()` & `zint_micropdf_expand()` routines (see below) MICROPDF417: move variant determination into new shareable routine `zint_micropdf_variant()` & expansion into `zint_micropdf_expand()` qzint: add helper methods `setbordertypevalue()`, `encodedinputmode()`, `encodedoutputoptions()`, `ecivaluetoeciindex()` and `eciindextoecivalue()` dbar: for performance pre-calculate `combins()` as array coverage: add `malloc()`-type failure testing to AZTEC, CONTENT_SEGS, MEMORY_FILE, raster, Reed-Solomon & vector; numerous changes to remove unused code and test more branches common: add `isxdigit()` general: various code fiddlings manual: add char names to sequence and batch format char tables; mention long options can be shortened (& use "--compliantheight" -> "--compliant"); expand mirror explanation & document substitutions in footnote; workaround xecjk putting space after double quote when quoting cjk chars & rejig input mode examples; workaround html alignment bug in table gs1-enabled symbologies by adding extra rh dashes to header cols; add "figure nn: " to txt image tags via sed: various other small fixes and rephrasings
This commit is contained in:
@@ -70,6 +70,7 @@ struct zint_symbol **testAssertPPSymbol = NULL;
|
||||
const char *testAssertFilename = "";
|
||||
static const char *testName = NULL;
|
||||
static const char *testFunc = NULL;
|
||||
static const char *testFailedFuncs[128] = {0};
|
||||
|
||||
/* Visual C++ 6 doesn't support variadic args to macros, so make do with functions, which have inferior behaviour,
|
||||
e.g. don't exit on failure, `assert_equal()` type-specific */
|
||||
@@ -167,6 +168,9 @@ void testFinish(void) {
|
||||
}
|
||||
if (testAssertFailed) {
|
||||
printf("FAILED. (%d assertions failed)\n", testAssertFailed);
|
||||
if (testFailed < ARRAY_SIZE(testFailedFuncs)) {
|
||||
testFailedFuncs[testFailed] = testFunc;
|
||||
}
|
||||
testFailed++;
|
||||
} else if (testDataset) {
|
||||
if (testAssertNum) {
|
||||
@@ -206,12 +210,21 @@ void testSkip(const char *msg) {
|
||||
|
||||
/* End test program */
|
||||
void testReport(void) {
|
||||
int i;
|
||||
if (testFailed && testSkipped) {
|
||||
printf("Total %d tests, %d skipped, %d **fails**.\n", testTests, testSkipped, testFailed);
|
||||
printf("Total %d tests, %d skipped, %d **fails**: ", testTests, testSkipped, testFailed);
|
||||
for (i = 0; i < testFailed; i++) {
|
||||
printf(i == 0 ? "%s" : ", %s", testFailedFuncs[i]);
|
||||
}
|
||||
fputs("\n", stdout);
|
||||
exit(-1);
|
||||
}
|
||||
if (testFailed) {
|
||||
printf("Total %d tests, %d **fails**.\n", testTests, testFailed);
|
||||
printf("Total %d tests, %d **fails**: ", testTests, testFailed);
|
||||
for (i = 0; i < testFailed; i++) {
|
||||
printf(i == 0 ? "%s" : ", %s", testFailedFuncs[i]);
|
||||
}
|
||||
fputs("\n", stdout);
|
||||
exit(-1);
|
||||
}
|
||||
if (testSkipped) {
|
||||
@@ -1640,6 +1653,18 @@ int testUtilRename(const char *oldpath, const char *newpath) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Create file. Returns 1 if successful, 0 if not */
|
||||
int testUtilCreateFile(const char *filename) {
|
||||
FILE *fp = testUtilOpen(filename, "w+");
|
||||
if (fp == NULL) {
|
||||
return 0;
|
||||
}
|
||||
if (fclose(fp) != 0) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Create read-only file. Returns 1 if successful, 0 if not */
|
||||
int testUtilCreateROFile(const char *filename) {
|
||||
#ifdef _WIN32
|
||||
@@ -2677,7 +2702,6 @@ static int supports_extra_escape_mode(const struct zint_symbol *const symbol) {
|
||||
&& (symbol->input_mode & 0x07) != GS1_MODE);
|
||||
}
|
||||
|
||||
#define z_isxdigit(c) (z_isdigit(c) || ((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
|
||||
#define z_isodigit(c) ((c) <= '7' && (c) >= '0')
|
||||
|
||||
/* Convert data to Ghostscript format for passing to bwipp_dump.ps */
|
||||
|
||||
Reference in New Issue
Block a user