CLI/Tcl: fix version check (need <= 999 for DAFT permille)

UPNQR: fix required binary mode using mode_preset
UPNQR: allow mask to be manually specified
GUI: use non-native QColorDialog on Unix also; no noEXE for CLI equivalent;
  add shortcuts for copy-to-clipboard and CLI equivalent
CLI: new --version option to print Zint version
This commit is contained in:
gitlost 2022-05-12 20:35:06 +01:00
parent f58c80e290
commit 9aae557cdc
24 changed files with 777 additions and 109 deletions

View file

@ -5306,6 +5306,7 @@ static void test_upnqr_encode(int index, int generate, int debug) {
int input_mode;
int option_1;
int option_2;
int option_3;
char *data;
int ret;
@ -5315,8 +5316,325 @@ static void test_upnqr_encode(int index, int generate, int debug) {
char *expected;
};
// https://www.upn-qr.si/uploads/files/Tehnicni standard UPN QR.pdf
struct item data[] = {
/* 0*/ { UNICODE_MODE, -1, -1, "Ą˘Ł¤ĽŚ§¨ŠŞŤŹŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙", 0, 77, 77, "ISO 8859-2",
/* 0*/ { UNICODE_MODE, -1, -1, -1, "UPNQR\012\012\012\012\012Janez Novak\012Dunajska 1\0121000 Ljubljana\01200000008105\012\012\012COST\012Plačilo obveznosti 10/2016\012\012SI56051008010486080\012SI0598765432100\012Novo podjetje d.o.o.\012Lepa cesta 15\0123698 Loški Potok\012183\012 ", 0, 77, 77, "Example A",
"11111110111111111100010011100010110001111000010010000011011111010000001111111"
"10000010100011011111111001110100100100111110110100100100100111100010101000001"
"10111010001000100000110111010001001000001000001101001001001001011000101011101"
"10111010101000111111100101110000011010110100010001010110010010111000101011101"
"10111010001000001001001011111100000110101100001111110101110011110111101011101"
"10000010001111111001010010001001001000001000001000101001011001101010001000001"
"11111110101010101010101010101010101010101010101010101010101010101010101111111"
"00000000110100001001111110001101011101000100101000100100100100100100100000000"
"10110111001011100111111111111011000001101011011111101101010000000101001001011"
"11001001101111111100011011010011101000111100110110000001000110000010011010010"
"10010011010011001101011011110101100100100110100110100100111100100101100100000"
"10100000010000010100110110001000001001001001001101011011000001011001001001000"
"11000110111001011001100000101001001011110000000011000110001011000111110000010"
"01100000001000001010001010000101000110101100000100100111110000100100001100100"
"11011010001110100011010100011001011001001001001001001011001001001000001001101"
"01100101000011101111001001011100110111010010010110011000011010010010010010011"
"01011011110011001110010110000111101100100110110101001010110101100001100110100"
"00000101101101100110100111101110101010100001101001010000001101011001100001011"
"00000011000011011001011001010011010110010010010000011000110010010011010110110"
"11100101110001011000111101110100110110100100100000001101000100100100100000101"
"00011010011000100011111101110011011011101011000011000110011000001011011111011"
"11101000111110111101100000101011110010011010110111000001110110000000000010010"
"10001011110111101111111001111100111100100100101101100110000100100001100000101"
"00100000001000110101001110010000001111000001001011011000101001001001101101010"
"11111111110101101000100011111000011100111000001111100111000011010100111111010"
"11101000100100011011011010001101100110100100001000100101000000110000100011101"
"00111010110010001010010010101001001101001001001010101001101011001111101011100"
"01101000100011111100011110001010010000011010001000101010010110010010100010101"
"10001111100101011010000111111110101110010110111111101001110000100001111110010"
"00011000010101110110101111110001101001010001110000010001101110011010011110001"
"01101010101101011001000100111010010010010010010110110010010011010011011010101"
"01100101110001010010111010111100100000110101011000100100100010100110111011000"
"10111010001110111000010101110011000001101010100001101100111010001100001001111"
"01001001001010111000000101001010110110011010110011100011010100100001000100010"
"00000110111010100100111010001100100100110101110101100100100100100100111001010"
"01011001111110011000100111110001001001010100000000001000001111001011011010001"
"00111011010010000010110111001110011010111000000110010111101001010110110011100"
"01111100011111110001111011111100000110101111000101110101010000010010100110100"
"01001010110110000011110111100101001001011011001001101001010001001001010101101"
"00100000000111011011011101101110010010010110010010010010010010010000000110011"
"10001110000101001100110001011100101101100001101000000000110110001000000000100"
"00110001010111011000100111010011101011001000000000011000000100011001001101001"
"01010010001111001110110101011100010011010011010010010010010011111010010110110"
"11010101111000010110001010111000100100100100001100100100100000111100101100101"
"10100010001001000010001100110101000001101110101101001011001100111101100001001"
"01101001011100010101001101101110110000011110110011000111000001000010010000010"
"11101111111001110000001011111010100100100101101111100010110101000100111110000"
"00111000110101111110000010001100001000001101001000101001001001111001100011000"
"01111010100010111010110010101011000010110000001010110110000011000110101010010"
"11011000101011001011011010001100000110001010001000110111100000100100100010100"
"10001111111100100100000111111010011000001111001111100001001001001001111111101"
"11100001001110110011111000111010010010010010010010000010010010000011011010011"
"11000111010101101011000010000110111101000110100100110000110101110000100100100"
"10110001010110000001010000001010101011100001111101010010001101001001001001001"
"01010011111110111110111010111100010010010010010011011100010010010010010000110"
"01111101011001100100101010011110010101100100100100101100100100100101101100101"
"10010010101001000111101010111011000001101011001001001111011000001101101001001"
"01011101011000111010101001000010101101011010100110001111010110000011010010010"
"11110111111011001000011101001001111001100100100101100000100100100100000110010"
"00101101100110101001001100001011011001001001001001001001001001001000000001010"
"01001110101000011100110000011010010010110000010100011100100011010010110010000"
"01011001110011001100010011101001001010101100010000110000000000110001100100010"
"11011110101100100101101111110111011001001001001010000111001001001101101010000"
"10110000001001111010001001110000000010011010010000011000010010010011011010001"
"00011011010000111010011010100101001010011110100100101000010101100010000100100"
"01100101010110100001100110001101101011000001110111011000101101011001001000011"
"01001111100111100110111110110101101110010010011011111010110000010011010001100"
"00001001111101000000101011011110100000100100101101111101100100100111001101101"
"01111010101101000011101111111001000001100011011111111101111111001101111110011"
"00000000101101101110101110001110110100001010111000101010110111000000100011010"
"11111110110001001100010110101010100100100100111010100100100011100101101010000"
"10000010110110110101000110001011001001001001101000101001001111001001100010100"
"10111010010110001000101011111010011100101001101111110110100111010111111111110"
"10111010111111011111010010100000000110101100000111110101100010010110000000100"
"10111010111000101010000010001111001111011001010101101001101011001000001000101"
"10000010001101100100010110101010010010001110010010010010110010010010100101001"
"11111110100011011001111101001100101100000010111001100000111111111001000100010"
},
/* 1*/ { UNICODE_MODE, -1, -1, -1, "UPNQR\012SI56020170014356205\012\012\012SI003528-990\012Združenje bank Slovenije\012Šubičeva 2\0121000 Ljubljana\01200000128067\012\012\012ADVA\012Plačilo avansa-ponudba 2016/12\012\012SI56051008010486080\012SI00123456-67890-12345\012Novo podjetje d.o.o.\012Lepa cesta 15\0123698 Loški Potok\012238\012 ", 0, 77, 77, "Example B",
"11111110000111011101000010011000101001000000001000111011101100110000001111111"
"10000010110011111100001100011111010101001001100001010101010101110010101000001"
"10111010001010110110001000110010101011101110001000101010100110110000101011101"
"10111010001111111101111110011110011101010101110100010001000110000100101011101"
"10111010100111000001000111111010001000000110101111111001100110010011101011101"
"10000010010011100010000010001100010100010101011000111101010101110110001000001"
"11111110101010101010101010101010101010101010101010101010101010101010101111111"
"00000000011101111011101110001101001110110101011000110101010101100101100000000"
"10101010010001000011011011111000100000001100111111110000111011011110000010010"
"00010001100001111111011101100100101101111001110001000110011001001101011101010"
"00100011011101000010110111011010101010101110101110100110111011100011001010001"
"10111100001110101010101001111101010100010001010101000111010101110101110101011"
"11101110011001000011011001111000110111101000111001100110111011111110101000101"
"00110001101101111101111101011101100011011011110101000110011001011101111101001"
"00111011101101100010110111101010111110101100101110101010010010101011101000010"
"10001000000000001000001000011010010101001001010111000111111101010101010011011"
"11001011110100100000011000001000100011010000111011111110010011101110101000111"
"00011101111110111010111111110010110011111111110001110000010001000101111101010"
"00110011111100100001100001111010101010111110101111101100101010101011001110001"
"10010100011100100001001100000100000100001101010101110111011101010101010111001"
"11010011100010010000011100010001000000010000111001000110011011101001111010101"
"00111101111101101010100011101101111110011101111101000000010001000111000001011"
"00000011100101101001100111110010111100111010111110001000101010101111001100111"
"00100100010100111001010010001100010000010100110011101110110111010001110101001"
"11101111101101011000000011111000110011001000011111100010011001101110111111111"
"10111000101011101010111010001100000110001101101000101000010011000010100011010"
"00011010101001100001100010101010101110101011101010101110101010101100101011001"
"10101000101010100011000010001101000011011101101000111101010011010100100011001"
"11101111101001001101001011111000100010000001101111100110011001101101111110101"
"01110000000111101010101011101101111011010100111100000100010001100000000011000"
"11001010011011111100001100000010100010101011101100001010101010001001100111000"
"01110001000000110001101011001101010001000101010110110101010101110101000101001"
"01010110101011001100101110010000110010000000100110101110111011001101101100101"
"01100100001011110011101010001101110001011100111101000100010001000000000100010"
"00000011010110110001011100000010100010111010101011101010001010001100100110011"
"11000000100010010111110011101101010101001100001100010100110101111111011111010"
"10000111101010100110000110110110100010001010111110101110011001000110000001111"
"01001101101110000000001011101101110111000111000100000100011001000111000001010"
"11101010010101111000101100000110101010111001111010001010101010100110100110101"
"11100101000001010001100011001001010101010001110101110101010001111101010001111"
"10000011001010101110011010010110000011101100010110101110110011000100011110001"
"01101100001011011000011111011110110111010001011100000100000011001111010001010"
"10101010110110100011100010010000101011101110111011001010110011100010110110001"
"00100101001000000010100101001001010101010000011101010101010101010101010100111"
"10000011001011000010001111110000100011001111110110101110111001101110001010001"
"00101100011010010000000110011101110111011000101100000110011001101101010111010"
"00101111110111111001100111111010101010101000101111101010101011001010111110001"
"11101000100000100111111010001001110010010101011000101101010101001101100011011"
"00001010101011100101101010101101111000001100111010100100111011011110101010101"
"10101000111010111100001010001110110110011101111000100000011001001101100011010"
"01111111111111100000000111111000111111101110101111101000101010000010111110001"
"00100101000010010000111100011000110000010101010101000101010101100100010101011"
"01001010000100100011001110011011010110001000101010100110111011100110100010101"
"10111100101000111111001111110001110110111101100001000110001001011101111101011"
"01101010110000000110000010101111100110101010101011101110001010101011101000010"
"00111100010111010101011101110111110001010101010101000101010101010101111101011"
"01100011101001000100001111001000010011001000101010100110011011101110101010101"
"10111001010000011101101111100101010011000101100001000110010001000101010101010"
"01000010101011000110010110000000100010111010101001101010001010101010001000000"
"00100000100101111101010110100101000000010101010111010111010101010100011101001"
"01001110000101001100001100100000000010001000101000110111011011101010001010101"
"00101000000010001101100000100100101111101101100001000110010001000001110101100"
"00101011001011101110001110110100101110011010101001100010001000101111101001101"
"01001001001010100101011000011111010110010100010001001111010001010100011101011"
"10000011000110110100001010110011010110001000001000111110011001101100001100111"
"01110001010000100101100010011001111010101100100111001110010011000101110011010"
"01001111000111001110001010010101001111001010000001100110101000101000001000101"
"00001000011010100001101010101111000101000100110011110111010111010110111001101"
"01111011000000110000000111111010100010001001001111100110011111101100111110001"
"00000000110100100000011010001001100011010101111000100100010001100001100011000"
"11111110010011010010010010101100111010111011111010101010001001000111101010000"
"10000010001110100101010010001111010101011101101000110100010101010101100011001"
"10111010101010100101111011111010110100001001101111101111111011101100111110101"
"10111010001000111010010011011001110111011100100111100100110011001000110010010"
"10111010111111010100110001101100110100111010111110001010001010100101101010001"
"10000010001110111011101001101101010101011101110100110101010001000101100000101"
"11111110101101000011101011000010100010000010001101101110011110100111001110011"
},
/* 2*/ { UNICODE_MODE, -1, -1, -1, "UPNQR\012\012\012\012\012Janez Novak\012Dunajska 1\0121000 Ljubljana\01200000008105\012\012\012RENT\012Plačilo najemnine 10/2016\01215.11.2016\012SI56051008010486080\012RF45SBO2010\012Novo podjetje d.o.o.\012Lepa cesta 15\0123698 Loški Potok\012188\012 ", 0, 77, 77, "Example H",
"11111110000111000010011001010010001001000000101010111011100111100000001111111"
"10000010110011101110001010110101010101001111000101010101010110110010101000001"
"10111010001010100101010100101010101011101011101110101010101010001000101011101"
"10111010001111111111100001111111011101110011010110010001000100011100101011101"
"10111010100111000110000111111010001000100110001111111011100100011011101011101"
"10000010010011000001001010001101010100010110011000110101010100010110001000001"
"11111110101010101010101010101010101010101010101010101010101010101010101111111"
"00000000000101011111001110001101001100110001011000110101011101110101000000000"
"10101010001001000110011011111000100010001000111111101110111011100110100010010"
"00001100101001011111011101001100101111111001110011000110011001000101011101010"
"00011111001101000001010101100011101010101110101110101010101010101011101010001"
"10111100010101101000101100011101010101010101010011010111010101000101010101011"
"11110110011001000001011000011000010011001100111011100110111011111110101000101"
"00000101111001011011111011111100110111011111110001011110010001010101011101010"
"00101111101101100000110101110010111010101010101110101010101010101011101010001"
"10101100011100001000001110011011110110010101010011010111010101010101010101011"
"11100011111101000000011100001000000100001000111011000100111011101110001000101"
"00000001100010011010111011110011110110111101110001001110010001000101111101010"
"00011011110101100001100001101011101011001010101110101100001010101011101100001"
"10111000001000101001001100000101010101010101010101110101010101010101110101011"
"11110011110001000000011110010000110010001000100010100101011011101000111100101"
"00001101101111111010100111101100110011011101110000000000010001000111100001010"
"00101011111011100001110111110010111010101010100001101111001010101111101000101"
"00100000011100100001010010001100010011011101010111000110110101010101110111001"
"11011111111011011000011011111000101100010000111111111111111011101100111111101"
"10111000111011100010101010001100011111011101111000110100110001000001100010000"
"11111010110001100001110010101010100110101010101010101010001010101100101010010"
"10001000100100111011011010001101010111000100011000101101010101010101100011111"
"10111111101001001100001011111000100000001000111111100110011100101111111110011"
"00001000001011100010110011101101110101001100100100001100010000000110000100010"
"10011110010011100001111100000010101010101010111110001010101001101011100010010"
"00011000000000110011010011001101010001000101100001010101010101010101001110110"
"00011111101101000011000110010000100010001000001010001111011001101111101100011"
"01001000001101101110101010001101110001011101101100100100010001100110000111010"
"11001010110100110110011100000010101010111011111011101010101010101000100111011"
"00000100100010011010001011101101010101001000011100110100010001000111000111110"
"10000011101010100100101111110110100010000001111110001111010111111110011010111"
"10001101101110000101111010001101110111011110100100100100100101110111000110010"
"11101011010101110101110100000110101010111000111011101010110010101010111110001"
"11100101100000011111101010101001010101010001011100110101010101100111010001011"
"10000011001011000111001110010010100011101111100110001110111001101110000111001"
"01101101101011000010010010001111110111010100001100000100011001111101000001010"
"01101010110111110110001100100100101011101011101010101010101011101010110110001"
"01100101001000000100111010001111010101010101111101010101010001000101000101011"
"01000011101011000011101111010000100010001101001110101000111111100110001010101"
"10101101011010110110001011101111110111011101110100000000011111100101010111010"
"01101111110110011011100111111000101010101011101111101100100011001010111110001"
"00101000101001000110011010001100010100010101011000110101011101000101100011011"
"01001010111011000110001010101011111010001000111010101110101011111110101010101"
"10101000111010011110101010001011110111111101111000100110000001010101100011010"
"01101111101111000101100111111001111011101010101111101010111010101010111110001"
"00100100101000010100111000001011010101010101010101010101010101000100011101011"
"01001010001010100101001100011101110011001100101010101110100011111110101010101"
"10101101101011111101001111100100110111011111100001000000000001010101010101010"
"01011010111111000110000011011110101010101010101011101100100010101010101000001"
"00101100100010010101011100111000000011010101010101010101010101010100011101011"
"01110011011111000100001011010100100100001000101010101100111011101110001010101"
"10001000011001111101101110010011101110111101100001000000010001000101010101000"
"01001011100001000110010100100001100110001010101011101100001010101010101000001"
"00000001110000110101010011011111010101011101010111000110110101010100111101011"
"01100110011100100100001110110010110000000000101000100101111011101010101010111"
"00111000010110111101100100010000110011010101100011000000110001000000110101111"
"00011111001001000110001000010100101010101010101011100010101010101110101001111"
"01101001011110111101001110111111000101010101010111011110110101010101111101001"
"10100011000100110100010100111011001100011000101010100111111011101100101010101"
"01011001011000101101111010000001101111011101101011000101110001000101010100000"
"01001111011111001110000110001101001110111010100011000010101000101010101001011"
"00001000001100110001010010101111010001000101111010001100110101010110011100011"
"01111011001010100000001111111010100010011000011111111111111100101110111111111"
"00000000101000101001111010001001110011001101011000101100010000000001100010010"
"11111110011001001010011010101100101010101010111010101010101011101101101010001"
"10000010001010100001001010001111010101010101011000110101010101010111100011111"
"10111010101110100001000011111010100100010001101111101110011001101001111111101"
"10111010001110110111100011010001110111011100101110000100010001100111110001010"
"10111010111011000101100001101100101100111011100110001010001010100111101111001"
"10000010001010100100100001101101010101001000000101010101110011011111100111001"
"11111110101101000110111011000010100010001100001111101110110001100111001110111"
},
/* 3*/ { UNICODE_MODE, -1, -1, 2 << 8, "UPNQR\012\012\012\012\012Janez Novak\012Dunajska 1\0121000 Ljubljana\01200000008105\012\012\012RENT\012Plačilo najemnine 10/2016\01215.11.2016\012SI56051008010486080\012RF45SBO2010\012Novo podjetje d.o.o.\012Lepa cesta 15\0123698 Loški Potok\012188\012 ", 0, 77, 77, "Example H with explicit mask 001 (auto-mask 000)",
"11111110110010010111001100000111011100010101111111101110110010110100001111111"
"10000010000110111011011111100000000000011010010000000000000011100110101000001"
"10111010111111110000000001111111111110111110111011111111111111011100101011101"
"10111010011010101010110100101010001000100110000011000100010001001000101011101"
"10111010010010010011010011111111011101110011011111101110110001001111101011101"
"10000010100110010100011110001000000001000011001000100000000001000010001000001"
"11111110101010101010101010101010101010101010101010101010101010101010101111111"
"00000000010000001010011010001000011001100100001000100000001000100000000000000"
"10100011011100010011001111111101110111011101101111111011101110110011100100101"
"01011001111100001010001000011001111010101100100110010011001100010000001000000"
"01001010011000010100000000110110111111111011111011111111111111111110111111011"
"11101001000000111101111001001000000000000000000110000010000000010000000000001"
"10100011001100010100001101001101000110011001101110110011101110101011111101111"
"01010000101100001110101110101001100010001010100100001011000100000000001000000"
"01111010111000110101100000100111101111111111111011111111111111111110111111011"
"11111001001001011101011011001110100011000000000110000010000000000000000000001"
"10110110101000010101001001011101010001011101101110010001101110111011011101111"
"01010100110111001111101110100110100011101000100100011011000100010000101000000"
"01001110100000110100110100111110111110011111111011111001011111111110111001011"
"11101101011101111100011001010000000000000000000000100000000000000000100000001"
"10100110100100010101001011000101100111011101110111110000001110111101101001111"
"01011000111010101111110010111001100110001000100101010101000100010010110100000"
"01111110101110110100100010100111101111111111110100111010011111111010111101111"
"01110101001001110100000111011001000110001000000010010011100000000000100010011"
"10001111101110001101001111111101111001000101101111101010101110111001111110111"
"11101000101110110111111110001001001010001000101000100001100100010100100011010"
"10101010100100110100100110101111110011111111111010111111011111111001101011000"
"11011000110001101110001110001000000010010001001000111000000000000000100010101"
"11101111111100011001011111111101110101011101101111110011001001111010111111001"
"01011101011110110111100110111000100000011001110001011001000101010011010001000"
"11001011000110110100101001010111111111111111101011011111111100111110110111000"
"01001101010101100110000110011000000100010000110100000000000000000000011011100"
"01001010111000010110010011000101110111011101011111011010001100111010111001001"
"00011101011000111011111111011000100100001000111001110001000100110011010010000"
"10011111100001100011001001010111111111101110101110111111111111111101110010001"
"01010001110111001111011110111000000000011101001001100001000100010010010010100"
"11010110111111110001111010100011110111010100101011011010000010101011001111101"
"11011000111011010000101111011000100010001011110001110001110000100010010011000"
"10111110000000100000100001010011111111101101101110111111100111111111101011011"
"10110000110101001010111111111100000000000100001001100000000000110010000100001"
"11010110011110010010011011000111110110111010110011011011101100111011010010011"
"00111000111110010111000111011010100010000001011001010001001100101000010100000"
"00111111100010100011011001110001111110111110111111111111111110111111100011011"
"00110000011101010001101111011010000000000000101000000000000100010000010000001"
"00010110111110010110111010000101110111011000011011111101101010110011011111111"
"11111000001111100011011110111010100010001000100001010101001010110000000010000"
"00111111100011001110110011111101111111111110111111111001110110011111111111011"
"01111000111100010011001110001001000001000000001000100000001000010000100010001"
"00011010101110010011011110101110101111011101101010111011111110101011101011111"
"11111000101111001011111110001110100010101000101000110011010100000000100010000"
"00111111111010010000110011111100101110111111111111111111101111111111111111011"
"01110001111101000001101101011110000000000000000000000000000000010001001000001"
"00011111011111110000011001001000100110011001111111111011110110101011111111111"
"11111000111110101000011010110001100010001010110100010101010100000000000000000"
"00001111101010010011010110001011111111111111111110111001110111111111111101011"
"01111001110111000000001001101101010110000000000000000000000000000001001000001"
"00100110001010010001011110000001110001011101111111111001101110111011011111111"
"11011101001100101000111011000110111011101000110100010101000100010000000000010"
"00011110110100010011000001110100110011011111111110111001011111111111111101011"
"01010100100101100000000110001010000000001000000010010011100000000001101000001"
"00110011001001110001011011100111100101010101111101110000101110111111111111101"
"01101101000011101000110001000101100110000000110110010101100100010101100000101"
"01001010011100010011011101000001111111111111111110110111111111111011111100101"
"00111100001011101000011011101010010000000000000010001011100000000000101000011"
"11110110010001100001000001101110011001001101111111110010101110111001111111111"
"00001100001101111000101111010100111010001000111110010000100100010000000001010"
"01001110001010011011010011011000011011101111110110010111111101111111111100001"
"00001001011001100100000111111010000100010000101111011001100000000011001001001"
"01111010011111110101011011111111110111001101001111101010101001111011111110101"
"00000000111101111100101110001100100110011000001000111001000101010100100011000"
"11111110101100011111001110101001111111111111101010111111111110111000101011011"
"10000010011111110100011110001010000000000000001000100000000000000010100010101"
"10111010011011110100010111111111110001000100111111111011001100111100111110111"
"10111010011011100010110110000100100010001001111011010001000100110010100100000"
"10111010101110010000110100111001111001101110110011011111011111110010111010011"
"10000010011111110001110100111000000000011101010000000000100110001010110010011"
"11111110111000010011101110010111110111011001011010111011100100110010011011101"
},
/* 4*/ { UNICODE_MODE, -1, -1, -1, "Ą˘Ł¤ĽŚ§¨ŠŞŤŹŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙", 0, 77, 77, "ISO 8859-2",
"11111110000111101001000110101100101001111110111011001111111000110000001111111"
"10000010001011100100110111111011110100001011110000100001001110011010101000001"
"10111010110101111111101101111101001010110101111011011110100001100100101011101"
@ -5400,6 +5718,15 @@ static void test_upnqr_encode(int index, int generate, int debug) {
int i, length, ret;
struct zint_symbol *symbol;
char escaped[4096];
char cmp_buf[32768];
char cmp_msg[1024];
#if 0 /* Need to add "force binary mode" to BWIPP for this to work */
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise
#endif
int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise
testStart("test_upnqr_encode");
for (i = 0; i < data_size; i++) {
@ -5409,15 +5736,16 @@ static void test_upnqr_encode(int index, int generate, int debug) {
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
length = testUtilSetSymbol(symbol, BARCODE_UPNQR, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
length = testUtilSetSymbol(symbol, BARCODE_UPNQR, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) {
printf(" /*%3d*/ { %s, %d, %d, \"%s\", %s, %d, %d, \"%s\",\n",
i, testUtilInputModeName(data[i].input_mode), data[i].option_1, data[i].option_2,
data[i].data, testUtilErrorName(data[i].ret),
printf(" /*%3d*/ { %s, %d, %d, %s, \"%s\", %s, %d, %d, \"%s\",\n",
i, testUtilInputModeName(data[i].input_mode), data[i].option_1, data[i].option_2, testUtilOption3Name(data[i].option_3),
testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
testUtilErrorName(data[i].ret),
symbol->rows, symbol->width, data[i].comment);
testUtilModulesPrint(symbol, " ", "\n");
printf(" },\n");
@ -5430,6 +5758,33 @@ static void test_upnqr_encode(int index, int generate, int debug) {
ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data);
}
if (ret < ZINT_ERROR) {
#if 0
if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, data[i].option_2, data[i].option_3, debug)) {
char modules_dump[77 * 77 + 1];
assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i);
ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, data[i].option_3, data[i].data, length, NULL, cmp_buf, sizeof(cmp_buf), NULL);
assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilBwippCmp(symbol, cmp_msg, cmp_buf, modules_dump);
assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, modules_dump);
}
}
#endif
if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) {
int cmp_len, ret_len;
char modules_dump[77 * 77 + 1];
assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i);
ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len);
assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len);
assert_zero(ret, "i:%d %s testUtilZXingCPPCmp %d != 0 %s\n actual: %.*s\nexpected: %.*s\n",
i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, ret_len, escaped);
}
}
}
ZBarcode_Delete(symbol);