mirror of
https://git.code.sf.net/p/zint/code
synced 2026-07-31 10:29:52 +00:00
debian: updated using https://salsa.debian.org/debian/zint as
template, props Dmitry Smirnov (ticket #147, props John Crisp); TODO: enable building with the GS1 Syntax Engine; this involved auditing copyrights which prompted the next item re "tif.c" and will prompt the next next item "pdf417.c" tif.c: replaced LZW compression with tree-based one due to "tif_lzw.h"'s original BSD-TAHOE license which has the equivalent of the "advertising clause", new implementation (which is much faster anyway) props Harald Kuhr and Bob Montgomery pdf417.c: TODO: Replace all code adapted from "pdf417.frm" as it was released under GPL v2.0 or later pdf417.h: replace unnecessary "pdf417.frm" references with ISO/IEC standard as 1st step re above, some expanded comments general: Codablock-F -> Codablock F (i.e. lose hyphen) cmake: frontend/frontend_qt: go back to only setting RPATH on macOS as not Debian compatible and it seems it's not a good idea on Linux anyway; TODO: check BSD + other Unixes CLI/GUI: make "--verbose" option official and document tools/gen_eci_sb_h.php/gen_eci_mb_h.php: add SPDX Unicode-3.0; update haible.de/bruno tarball info - "GB18030.TXT" no longer in "jdk-1.4.2/" so mention "libiconv-1.11/" version instead (same) general: add various SPDXs and normalize some Copyrights reedsol.c: malloced `logt`/`alog` tables int -> short (slight performance improvement) aztec.c: add copyrights, some code fiddling BWIPP: update to latest
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2019-2025 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2019-2026 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@@ -45,7 +45,7 @@
|
||||
INTERNAL int zint_test_u_gb18030_int(const unsigned int u, unsigned int *dest1, unsigned int *dest2);
|
||||
|
||||
/* As control convert to GB 18030 using table generated from GB18030.TXT plus simple processing.
|
||||
The version of GB18030.TXT is jdk-1.4.2/GB18030.TXT taken from
|
||||
The version of GB18030.TXT is libiconv-1.11/GB18030.TXT taken from
|
||||
https://haible.de/bruno/charsets/conversion-tables/GB18030.html
|
||||
The generated file backend/tests/test_gb18030_tab.h does not include U+10000..10FFFF codepoints to save space.
|
||||
See also backend/tests/tools/data/GB18030.TXT.README and backend/tests/tools/gen_test_tab.php.
|
||||
|
||||
@@ -2712,7 +2712,7 @@ static void test_input_mode(const testCtx *const p_ctx) {
|
||||
/* 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 */
|
||||
/* 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 },
|
||||
|
||||
@@ -1036,7 +1036,7 @@ static void test_non_forced(const testCtx *const p_ctx) {
|
||||
/* 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 */
|
||||
/* 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
-29
@@ -280,9 +280,12 @@ static void test_reader_init(const testCtx *const p_ctx) {
|
||||
const char *expected;
|
||||
const char *comment;
|
||||
};
|
||||
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||
static const struct item data[] = {
|
||||
/* 0*/ { BARCODE_PDF417, UNICODE_MODE, READER_INIT, "A", 0, 6, 103, "(12) 4 921 29 900 209 917 46 891 522 472 822 385", "Outputs Test Alpha flag 900" },
|
||||
/* 1*/ { BARCODE_MICROPDF417, UNICODE_MODE, READER_INIT, "A", 0, 11, 38, "(11) 921 900 29 900 179 499 922 262 777 478 300", "Outputs Test Alpha flag 900" },
|
||||
/* 0*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, READER_INIT, "A", 0, 6, 103, "(12) 4 921 29 900 209 917 46 891 522 472 822 385", "Outputs Test Alpha flag 900" },
|
||||
/* 1*/ { BARCODE_PDF417, UNICODE_MODE, READER_INIT, "A", 0, 6, 103, "(12) 4 921 29 900 209 917 46 891 522 472 822 385", "Outputs Test Alpha flag 900" },
|
||||
/* 2*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, READER_INIT, "A", 0, 11, 38, "(11) 921 900 29 900 179 499 922 262 777 478 300", "Outputs Test Alpha flag 900" },
|
||||
/* 3*/ { BARCODE_MICROPDF417, UNICODE_MODE, READER_INIT, "A", 0, 11, 38, "(11) 921 900 29 900 179 499 922 262 777 478 300", "Outputs Test Alpha flag 900" },
|
||||
};
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
@@ -434,33 +437,40 @@ static void test_input(const testCtx *const p_ctx) {
|
||||
/* 54*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 1, -1, { 0, 0, "" }, "A", 0, 0, 6, 86, "(6) 2 29 752 533 551 139", 0, "BWIPP BYTE1" },
|
||||
/* 55*/ { BARCODE_PDF417, UNICODE_MODE, -1, 1, -1, { 0, 0, "" }, "A", 0, 0, 6, 86, "(6) 2 29 752 533 551 139", 0, "BWIPP BYTE1" },
|
||||
/* 56*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 2, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", 0, "BWIPP BYTE1" },
|
||||
/* 57*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 3, -1, { 0, 0, "" }, "A", 0, 0, 9, 103, "(18) 2 29 290 888 64 789 390 182 22 197 347 41 298 467 387 917 455 196", 0, "BWIPP BYTE1" },
|
||||
/* 58*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 4, -1, { 0, 0, "" }, "A", 0, 0, 12, 120, "(36) 4 29 900 900 702 212 753 721 695 584 222 459 110 594 813 465 718 912 667 349 852 602", 0, "BWIPP BYTE1" },
|
||||
/* 59*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 5, -1, { 0, 0, "" }, "A", 0, 0, 14, 154, "(70) 6 29 900 900 900 900 774 599 527 418 850 374 921 763 922 772 572 661 584 902 578 696", 0, "BWIPP BYTE1" },
|
||||
/* 60*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 6, -1, { 0, 0, "" }, "A", 0, 0, 19, 188, "(133) 5 29 900 900 900 113 261 822 368 600 652 404 869 860 902 184 702 611 323 195 794 566", 0, "BWIPP BYTE1" },
|
||||
/* 61*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 7, -1, { 0, 0, "" }, "A", 0, 0, 29, 222, "(261) 5 29 900 900 900 384 614 456 20 422 177 78 492 215 859 765 864 755 572 621 891 97 538", 0, "BWIPP BYTE1" },
|
||||
/* 62*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 0, 0, "" }, "A", 0, 0, 40, 290, "(520) 8 29 900 900 900 900 900 900 255 576 871 499 885 500 866 196 784 681 589 448 428 108", 0, "BWIPP BYTE1" },
|
||||
/* 63*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" },
|
||||
/* 64*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" },
|
||||
/* 65*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" },
|
||||
/* 66*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" },
|
||||
/* 67*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" },
|
||||
/* 68*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" },
|
||||
/* 69*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" },
|
||||
/* 70*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" },
|
||||
/* 71*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" },
|
||||
/* 72*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" },
|
||||
/* 73*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 4, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 928 111 103 17 53 923 1 111 104 922 837 837 774 835 701 445 926 428 285 851 334", 1, "H.4 example last segment" },
|
||||
/* 74*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" },
|
||||
/* 75*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" },
|
||||
/* 76*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" },
|
||||
/* 77*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" },
|
||||
/* 78*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 902 1 348 256 900 759 577 359 263 64 409 852 154", 0, "BWIPP BYTE" },
|
||||
/* 79*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 841 63 125 209 900 889 730 746 451 470 371 667 636", 1, "" },
|
||||
/* 80*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" },
|
||||
/* 81*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" },
|
||||
/* 82*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" },
|
||||
/* 83*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" },
|
||||
/* 57*/ { BARCODE_PDF417, UNICODE_MODE, -1, 2, -1, { 0, 0, "" }, "A", 0, 0, 5, 103, "(10) 2 29 478 509 903 637 74 490 760 21", 0, "BWIPP BYTE1" },
|
||||
/* 58*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 3, -1, { 0, 0, "" }, "A", 0, 0, 9, 103, "(18) 2 29 290 888 64 789 390 182 22 197 347 41 298 467 387 917 455 196", 0, "BWIPP BYTE1" },
|
||||
/* 59*/ { BARCODE_PDF417, UNICODE_MODE, -1, 3, -1, { 0, 0, "" }, "A", 0, 0, 9, 103, "(18) 2 29 290 888 64 789 390 182 22 197 347 41 298 467 387 917 455 196", 0, "BWIPP BYTE1" },
|
||||
/* 60*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 4, -1, { 0, 0, "" }, "A", 0, 0, 12, 120, "(36) 4 29 900 900 702 212 753 721 695 584 222 459 110 594 813 465 718 912 667 349 852 602", 0, "BWIPP BYTE1" },
|
||||
/* 61*/ { BARCODE_PDF417, UNICODE_MODE, -1, 4, -1, { 0, 0, "" }, "A", 0, 0, 12, 120, "(36) 4 29 900 900 702 212 753 721 695 584 222 459 110 594 813 465 718 912 667 349 852 602", 0, "BWIPP BYTE1" },
|
||||
/* 62*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 5, -1, { 0, 0, "" }, "A", 0, 0, 14, 154, "(70) 6 29 900 900 900 900 774 599 527 418 850 374 921 763 922 772 572 661 584 902 578 696", 0, "BWIPP BYTE1" },
|
||||
/* 63*/ { BARCODE_PDF417, UNICODE_MODE, -1, 5, -1, { 0, 0, "" }, "A", 0, 0, 14, 154, "(70) 6 29 900 900 900 900 774 599 527 418 850 374 921 763 922 772 572 661 584 902 578 696", 0, "BWIPP BYTE1" },
|
||||
/* 64*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 6, -1, { 0, 0, "" }, "A", 0, 0, 19, 188, "(133) 5 29 900 900 900 113 261 822 368 600 652 404 869 860 902 184 702 611 323 195 794 566", 0, "BWIPP BYTE1" },
|
||||
/* 65*/ { BARCODE_PDF417, UNICODE_MODE, -1, 6, -1, { 0, 0, "" }, "A", 0, 0, 19, 188, "(133) 5 29 900 900 900 113 261 822 368 600 652 404 869 860 902 184 702 611 323 195 794 566", 0, "BWIPP BYTE1" },
|
||||
/* 66*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 7, -1, { 0, 0, "" }, "A", 0, 0, 29, 222, "(261) 5 29 900 900 900 384 614 456 20 422 177 78 492 215 859 765 864 755 572 621 891 97 538", 0, "BWIPP BYTE1" },
|
||||
/* 67*/ { BARCODE_PDF417, UNICODE_MODE, -1, 7, -1, { 0, 0, "" }, "A", 0, 0, 29, 222, "(261) 5 29 900 900 900 384 614 456 20 422 177 78 492 215 859 765 864 755 572 621 891 97 538", 0, "BWIPP BYTE1" },
|
||||
/* 68*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 0, 0, "" }, "A", 0, 0, 40, 290, "(520) 8 29 900 900 900 900 900 900 255 576 871 499 885 500 866 196 784 681 589 448 428 108", 0, "BWIPP BYTE1" },
|
||||
/* 69*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 0, 0, "" }, "A", 0, 0, 40, 290, "(520) 8 29 900 900 900 900 900 900 255 576 871 499 885 500 866 196 784 681 589 448 428 108", 0, "BWIPP BYTE1" },
|
||||
/* 70*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" },
|
||||
/* 71*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 1, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 111 100 17 53 923 1 111 104 903 71", 1, "H.4 example" },
|
||||
/* 72*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" },
|
||||
/* 73*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 4, 4, "017053" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 928 111 103 17 53 923 1 111 104 922 772 754", 1, "H.4 example last segment" },
|
||||
/* 74*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" },
|
||||
/* 75*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 2, 4, "" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 900 900 928 111 101 923 1 111 104 583", 1, "No ID" },
|
||||
/* 76*/ { BARCODE_PDF417, UNICODE_MODE | FAST_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" },
|
||||
/* 77*/ { BARCODE_PDF417, UNICODE_MODE, -1, 8, -1, { 99998, 99999, "12345" }, "A", 0, 0, 41, 290, "(533) 21 29 900 900 900 900 900 900 900 900 900 900 928 222 197 123 45 923 1 222 199 198", 1, "IDs '123', '045'" },
|
||||
/* 78*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" },
|
||||
/* 79*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 1, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 900 928 111 100 17 53 923 1 111 104 430 136 328 218 796 853 32 421 712 477 363", 1, "H.4 example" },
|
||||
/* 80*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 4, 4, "017053" }, "A", 0, 0, 6, 99, "(24) 900 29 928 111 103 17 53 923 1 111 104 922 837 837 774 835 701 445 926 428 285 851 334", 1, "H.4 example last segment" },
|
||||
/* 81*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" },
|
||||
/* 82*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 3, 4, "" }, "A", 0, 0, 17, 38, "(17) 900 29 900 928 111 102 923 1 111 104 343 717 634 693 618 860 618", 1, "No ID" },
|
||||
/* 83*/ { BARCODE_MICROPDF417, UNICODE_MODE | FAST_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" },
|
||||
/* 84*/ { BARCODE_MICROPDF417, UNICODE_MODE, -1, -1, -1, { 99999, 99999, "100200300" }, "A", 0, 0, 11, 55, "(22) 900 29 928 222 198 100 200 300 923 1 222 199 922 693 699 895 719 637 154 478 399 638", 1, "IDs '100', '200', '300'" },
|
||||
/* 85*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 902 1 348 256 900 759 577 359 263 64 409 852 154", 0, "BWIPP BYTE" },
|
||||
/* 86*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "123456", 0, 0, 7, 103, "(14) 6 841 63 125 209 900 889 730 746 451 470 371 667 636", 1, "" },
|
||||
/* 87*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" },
|
||||
/* 88*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "12345678901234567890", 0, 0, 9, 103, "(18) 10 902 211 358 354 304 269 753 190 900 327 902 163 367 231 586 808 731", 1, "" },
|
||||
/* 89*/ { BARCODE_PDF417, DATA_MODE | FAST_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" },
|
||||
/* 90*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1, { 0, 0, "" }, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 0, 12, 137, "(48) 40 902 491 81 137 450 302 67 15 174 492 862 667 475 869 12 434 685 326 422 57 117 339", 1, "" },
|
||||
};
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
|
||||
+185
-51
@@ -51,15 +51,23 @@ struct perf_item {
|
||||
};
|
||||
|
||||
static void test_perf(const testCtx *const p_ctx, const int default_iterations, const struct perf_item *data,
|
||||
const int data_size) {
|
||||
int debug = p_ctx->debug;
|
||||
const int data_size, const char *const outfile) {
|
||||
int debug = p_ctx->debug & 0xFFFF;
|
||||
/* Hack (use "-d $((256 + (flg << 16)))") to select whether to time (`ZBarcode_Create()` always timed):
|
||||
1. `ZBarcode_Encode()`
|
||||
2. `ZBarcode_Buffer()`
|
||||
4. `ZBarcode_Buffer()` with `OUT_BUFFER_INTERMEDIATE`
|
||||
8. `ZBarcode_Print()`
|
||||
16. `ZBarcode_Print()` with `BARCODE_MEMORY_FILE`
|
||||
with 0 meaning all */
|
||||
int flg = (p_ctx->debug >> 16) & 0xFF;
|
||||
|
||||
int i, length, ret;
|
||||
struct zint_symbol *symbol = NULL;
|
||||
|
||||
clock_t start;
|
||||
clock_t total_create = 0, total_encode = 0, total_buffer = 0, total_buf_inter = 0, total_print = 0;
|
||||
clock_t diff_create, diff_encode, diff_buffer, diff_buf_inter, diff_print;
|
||||
clock_t total_create = 0, total_encode = 0, total_buffer = 0, total_buf_inter = 0, total_print = 0, total_memfile = 0;
|
||||
clock_t diff_create, diff_encode, diff_buffer, diff_buf_inter, diff_print, diff_memfile;
|
||||
int comment_max = 0;
|
||||
|
||||
const int iterations = p_ctx->arg ? p_ctx->arg : default_iterations; /* Use "-a N" to set iterations */
|
||||
@@ -83,9 +91,10 @@ static void test_perf(const testCtx *const p_ctx, const int default_iterations,
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
diff_create = diff_encode = diff_buffer = diff_buf_inter = diff_print = 0;
|
||||
diff_create = diff_encode = diff_buffer = diff_buf_inter = diff_print = 0, diff_memfile = 0;
|
||||
|
||||
for (j = 0; j < iterations; j++) {
|
||||
int have_encoded = 0;
|
||||
start = clock();
|
||||
symbol = ZBarcode_Create();
|
||||
diff_create += clock() - start;
|
||||
@@ -113,55 +122,104 @@ static void test_perf(const testCtx *const p_ctx, const int default_iterations,
|
||||
data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/,
|
||||
text, -1, debug);
|
||||
|
||||
start = clock();
|
||||
ret = ZBarcode_Encode(symbol, TCU(text), length);
|
||||
diff_encode += clock() - start;
|
||||
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
|
||||
i, ret, data[i].ret, symbol->errtxt);
|
||||
if (!flg || (flg & 1)) {
|
||||
start = clock();
|
||||
ret = ZBarcode_Encode(symbol, TCU(text), length);
|
||||
diff_encode += clock() - start;
|
||||
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n",
|
||||
i, ret, data[i].ret, symbol->errtxt);
|
||||
have_encoded = 1;
|
||||
}
|
||||
|
||||
if (!flg || (flg & 2)) {
|
||||
if (!have_encoded) {
|
||||
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);
|
||||
have_encoded = 1;
|
||||
}
|
||||
start = clock();
|
||||
ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/);
|
||||
diff_buffer += clock() - start;
|
||||
assert_zero(ret, "i:%d ZBarcode_Buffer ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
|
||||
}
|
||||
|
||||
if (!flg || (flg & 4)) {
|
||||
if (!have_encoded) {
|
||||
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);
|
||||
have_encoded = 1;
|
||||
}
|
||||
symbol->output_options |= OUT_BUFFER_INTERMEDIATE;
|
||||
start = clock();
|
||||
ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/);
|
||||
diff_buf_inter += clock() - start;
|
||||
assert_zero(ret, "i:%d ZBarcode_Buffer OUT_BUFFER_INTERMEDIATE ret %d != 0 (%s)\n",
|
||||
i, ret, symbol->errtxt);
|
||||
symbol->output_options &= ~OUT_BUFFER_INTERMEDIATE; /* Undo */
|
||||
}
|
||||
|
||||
if (!flg || (flg & 8)) {
|
||||
if (!have_encoded) {
|
||||
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);
|
||||
have_encoded = 1;
|
||||
}
|
||||
if (outfile && strlen(outfile) < 256) {
|
||||
strcpy(symbol->outfile, outfile);
|
||||
}
|
||||
start = clock();
|
||||
ret = ZBarcode_Print(symbol, 0 /*rotate_angle*/);
|
||||
diff_print += clock() - start;
|
||||
assert_zero(ret, "i:%d ZBarcode_Print ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
|
||||
assert_zero(testUtilRemove(symbol->outfile), "i:%d testUtilRemove(%s) != 0\n", i, symbol->outfile);
|
||||
}
|
||||
|
||||
if (!flg || (flg & 16)) {
|
||||
if (!have_encoded) {
|
||||
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);
|
||||
/*have_encoded = 1;*/
|
||||
}
|
||||
symbol->output_options |= BARCODE_MEMORY_FILE;
|
||||
if (outfile && strlen(outfile) < 256) {
|
||||
strcpy(symbol->outfile, outfile);
|
||||
}
|
||||
start = clock();
|
||||
ret = ZBarcode_Print(symbol, 0 /*rotate_angle*/);
|
||||
diff_memfile += clock() - start;
|
||||
assert_zero(ret, "i:%d ZBarcode_Print BARCODE_MEMORY_FILE ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
|
||||
symbol->output_options &= ~BARCODE_MEMORY_FILE; /* Undo */
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
start = clock();
|
||||
ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/);
|
||||
diff_buffer += clock() - start;
|
||||
assert_zero(ret, "i:%d ZBarcode_Buffer ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
|
||||
|
||||
symbol->output_options |= OUT_BUFFER_INTERMEDIATE;
|
||||
start = clock();
|
||||
ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/);
|
||||
diff_buf_inter += clock() - start;
|
||||
assert_zero(ret, "i:%d ZBarcode_Buffer OUT_BUFFER_INTERMEDIATE ret %d != 0 (%s)\n",
|
||||
i, ret, symbol->errtxt);
|
||||
symbol->output_options &= ~OUT_BUFFER_INTERMEDIATE; /* Undo */
|
||||
|
||||
start = clock();
|
||||
ret = ZBarcode_Print(symbol, 0 /*rotate_angle*/);
|
||||
diff_print += clock() - start;
|
||||
assert_zero(ret, "i:%d ZBarcode_Print ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
|
||||
assert_zero(testUtilRemove(symbol->outfile), "i:%d testUtilRemove(%s) != 0\n", i, symbol->outfile);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
}
|
||||
|
||||
printf(" %*s: encode % 8gms, buffer % 8gms, buf_inter % 8gms, print % 8gms, create % 8gms\n",
|
||||
printf(" %*s: encode % 8gms, buffer % 8gms, buf_inter % 8gms, print % 8gms, memfile % 8gms, create % 8gms\n",
|
||||
comment_max, data[i].comment,
|
||||
TEST_PERF_TIME(diff_encode), TEST_PERF_TIME(diff_buffer), TEST_PERF_TIME(diff_buf_inter),
|
||||
TEST_PERF_TIME(diff_print), TEST_PERF_TIME(diff_create));
|
||||
TEST_PERF_TIME(diff_print), TEST_PERF_TIME(diff_memfile), TEST_PERF_TIME(diff_create));
|
||||
|
||||
total_create += diff_create;
|
||||
total_encode += diff_encode;
|
||||
total_buffer += diff_buffer;
|
||||
total_buf_inter += diff_buf_inter;
|
||||
total_print += diff_print;
|
||||
total_memfile += diff_memfile;
|
||||
}
|
||||
if (p_ctx->index == -1) {
|
||||
printf(" %*s: encode % 8gms, buffer % 8gms, buf_inter % 8gms, print % 8gms, create % 8gms\n",
|
||||
printf(" %*s: encode % 8gms, buffer % 8gms, buf_inter % 8gms, print % 8gms, memfile % 8gms, create % 8gms\n",
|
||||
comment_max, "totals",
|
||||
TEST_PERF_TIME(total_encode), TEST_PERF_TIME(total_buffer), TEST_PERF_TIME(total_buf_inter),
|
||||
TEST_PERF_TIME(total_print), TEST_PERF_TIME(total_create));
|
||||
TEST_PERF_TIME(total_print), TEST_PERF_TIME(total_memfile), TEST_PERF_TIME(total_create));
|
||||
}
|
||||
|
||||
testFinish();
|
||||
@@ -178,7 +236,7 @@ static void test_2of5(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_aztec(const testCtx *const p_ctx) {
|
||||
@@ -235,7 +293,7 @@ static void test_aztec(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 1 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_aztec_fast(const testCtx *const p_ctx) {
|
||||
@@ -292,7 +350,7 @@ static void test_aztec_fast(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 1 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_code11(const testCtx *const p_ctx) {
|
||||
@@ -304,7 +362,7 @@ static void test_code11(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_code128(const testCtx *const p_ctx) {
|
||||
@@ -317,7 +375,7 @@ static void test_code128(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_composite(const testCtx *const p_ctx) {
|
||||
@@ -344,7 +402,7 @@ static void test_composite(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 1 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_dmatrix(const testCtx *const p_ctx) {
|
||||
@@ -424,7 +482,7 @@ static void test_dmatrix(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_dotcode(const testCtx *const p_ctx) {
|
||||
@@ -442,7 +500,7 @@ static void test_dotcode(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 1 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_gridmtx(const testCtx *const p_ctx) {
|
||||
@@ -467,7 +525,7 @@ static void test_gridmtx(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 1 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_hanxin(const testCtx *const p_ctx) {
|
||||
@@ -509,7 +567,7 @@ static void test_hanxin(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 1 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_maxicode(const testCtx *const p_ctx) {
|
||||
@@ -532,7 +590,7 @@ static void test_maxicode(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 10 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_pdf417(const testCtx *const p_ctx) {
|
||||
@@ -582,7 +640,57 @@ static void test_pdf417(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_pdf417_fast(const testCtx *const p_ctx) {
|
||||
|
||||
static const struct perf_item data[] = {
|
||||
/* 0*/ { BARCODE_PDF417, FAST_MODE, -1, -1, -1, "1234567890", "", 0, 7, 103, "10 numerics" },
|
||||
/* 1*/ { BARCODE_PDF417, FAST_MODE, -1, -1, -1,
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM"
|
||||
"NOPQRSTUVWXYZ;<>@[]_`~!||()?{}'123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJK"
|
||||
"LMNOPQRSTUVWXYZ12345678912345678912345678912345678900001234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFG"
|
||||
"HIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567"
|
||||
"890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcde"
|
||||
"fghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO",
|
||||
"", 0, 43, 290, "960 chars, text/numeric" },
|
||||
/* 2*/ { BARCODE_PDF417, DATA_MODE, -1, -1, -1,
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240"
|
||||
"\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240",
|
||||
"", 0, 51, 358, "960 chars, byte" },
|
||||
/* 3*/ { BARCODE_PDF417, FAST_MODE, -1, -1, -1,
|
||||
"BP2D+1.00+0005+FLE ESC BV+1.00+3.60*BX2D+1.00+0001+Casual shoes & apparel+90044030118100801265*D_2D+1.02+31351440315981+C910332+02032018+KXXXX CXXXX+UNIT 4 HXXX"
|
||||
"XXXXX BUSINESS PARK++ST ALBANS+ST ALBANS++AL2 3TA+0001+000001+001+00000000+00++N+N+N+0000++++++N+++N*DS2D+1.01+0001+0001+90044030118100801265+++++07852389322+"
|
||||
"+E*F_2D+1.00+0005*",
|
||||
"", 0, 26, 222, "338 chars, text/numeric/byte" },
|
||||
};
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_plessey(const testCtx *const p_ctx) {
|
||||
@@ -596,7 +704,7 @@ static void test_plessey(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_postal(const testCtx *const p_ctx) {
|
||||
@@ -609,7 +717,7 @@ static void test_postal(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 10 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_qr(const testCtx *const p_ctx) {
|
||||
@@ -662,7 +770,7 @@ static void test_qr(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_qr_fast(const testCtx *const p_ctx) {
|
||||
@@ -715,7 +823,7 @@ static void test_qr_fast(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_microqr(const testCtx *const p_ctx) {
|
||||
@@ -729,7 +837,7 @@ static void test_microqr(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 5 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_upcean(const testCtx *const p_ctx) {
|
||||
@@ -749,7 +857,29 @@ static void test_upcean(const testCtx *const p_ctx) {
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 10 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size);
|
||||
test_perf(p_ctx, default_iterations, data, data_size, NULL /*outfile*/);
|
||||
}
|
||||
|
||||
static void test_gif(const testCtx *const p_ctx) {
|
||||
|
||||
static const struct perf_item data[] = {
|
||||
/* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, "123456ABCD", "", 0, 1, 123, "CODE128 10" },
|
||||
};
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 10 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size, "out.gif");
|
||||
}
|
||||
|
||||
static void test_tif(const testCtx *const p_ctx) {
|
||||
|
||||
static const struct perf_item data[] = {
|
||||
/* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, "123456ABCD", "", 0, 1, 123, "CODE128 10" },
|
||||
};
|
||||
const int data_size = ARRAY_SIZE(data);
|
||||
const int default_iterations = 10 * 1000;
|
||||
|
||||
test_perf(p_ctx, default_iterations, data, data_size, "out.tif");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
@@ -767,12 +897,16 @@ int main(int argc, char *argv[]) {
|
||||
{ "test_hanxin", test_hanxin },
|
||||
{ "test_maxicode", test_maxicode },
|
||||
{ "test_pdf417", test_pdf417 },
|
||||
{ "test_pdf417_fast", test_pdf417_fast },
|
||||
{ "test_plessey", test_plessey },
|
||||
{ "test_postal", test_postal },
|
||||
{ "test_qr", test_qr },
|
||||
{ "test_qr_fast", test_qr_fast },
|
||||
{ "test_microqr", test_microqr },
|
||||
{ "test_upcean", test_upcean },
|
||||
|
||||
{ "test_gif", test_gif },
|
||||
{ "test_tif", test_tif },
|
||||
};
|
||||
|
||||
testRun(argc, argv, funcs, ARRAY_SIZE(funcs));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2020-2025 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2020-2026 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
INTERNAL int zint_tif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf);
|
||||
|
||||
/* For overview when debugging: ./test_tiff -f pixel_plot -d 5 */
|
||||
/* For overview when debugging: ./test_tif -f pixel_plot -d 5 */
|
||||
static void test_pixel_plot(const testCtx *const p_ctx) {
|
||||
int debug = p_ctx->debug;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Copyright (C) 2006-2017 Kentaro Fukuchi <kentaro@fukuchi.org>
|
||||
*/
|
||||
/* Due to above: */
|
||||
/* SPDX-License-Identifier: LGPL-2.1+ */
|
||||
/* SPDX-License-Identifier: LGPL-2.0-or-later */
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
/* Generate lookup table from unicode.org mapping file (SHIFTJIS.TXT by default). */
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2019-2022 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2019-2026 Robin Stuart <rstuart114@gmail.com>
|
||||
*/
|
||||
/* To create backend/tests/test_sjis_tab.h (from the project root directory):
|
||||
*
|
||||
@@ -18,7 +18,7 @@
|
||||
*
|
||||
* To create backend/tests/test_gb18030_tab.h (note that backend/tests/tools/data/GB18030.TXT
|
||||
* will have to be downloaded first from https://haible.de/bruno/charsets/conversion-tables/GB18030.html
|
||||
* using the version jdk-1.4.2/GB18030.TXT):
|
||||
* using the version libiconv-1.11/GB18030.TXT):
|
||||
*
|
||||
* php backend/tests/tools/gen_test_tab.php -f GB18030.TXT -s gb18030_tab
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user