composite: fix buffer overflow for large linear, small composite (500 -> 1000)

composite: clear errtxt when bumping from CC-A -> CC-B -> CC-C
composite: CC-C adjustment 53 -> 52 (same as BWIPP) with proper explanation
composite: remove unneeded > 11805 length check
CODEONE: remove unneeded extended ASCII check in C40 count
GS1_128/CODE16K: remove unneeded initial GS1 mode '[' check
PDF417: remove unneeded second option_2 > 30 check
Document some "Not reached" lines (code coverage)
Update bwipp_dump.ps
GUI: window/tab height +5 so 2 full lines for composite edit box (Ubuntu)
manual: dash -> hyphen, PDF417 "check digit" -> "error correction", DMRE ref
tests: further test cases for CODEONE/CODE16K/common/composite/DATAMATRIX/
DOTCODE/gs1/MAXICODE/PDF417/postal/QRCODE
This commit is contained in:
gitlost
2021-08-05 16:34:45 +01:00
parent f0bfb8d920
commit b015e38da0
28 changed files with 3610 additions and 2019 deletions

View File

@ -1706,7 +1706,97 @@ static void test_encode(int index, int generate, int debug) {
"1011110100111010100000"
"0001111010001000110010"
},
/* 57*/ { -1, -1, -1, "123456789012345", -1, 0, 16, 18, 1, "5 DECIMAL triplets, ASCII switch before padding (2)",
/* 57*/ { -1, -1, -1, "\015*>\015*>\015*>ABC", -1, 0, 16, 18, 1, "3 EDI triplets + 3 alphas (EDI)",
"111011000000100000"
"111010000010110000"
"001010000000100101"
"101110000010111001"
"111010111100100000"
"000010000000100000"
"111111111111111111"
"000000000000000000"
"011111111111111110"
"010000000000000010"
"011111111111111110"
"100111111111100110"
"111001010000100011"
"011001101110101101"
"010011011100100111"
"000001001101111001"
},
/* 58*/ { -1, -1, -1, "\015*>\015*>\015*>1234567", -1, 0, 22, 22, 1, "3 EDI triplets + 7 digits ending (EDI)",
"1110110000001000000010"
"1110100000101100001011"
"0000100010001000110011"
"0000101011000010000011"
"0111101111001110001000"
"0011101111100000010001"
"1000101000100010000000"
"0000100000000000100000"
"1111111111111111111111"
"0000000000000000000000"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"0001000100010001100101"
"1011111111111010100100"
"1000111100110000100110"
"0010100010010111101000"
"0101100111000110101001"
"0110011101010010101010"
"0101111011000100110001"
},
/* 59*/ { -1, -1, -1, "\015*>\015*>\015*>12345678", -1, 0, 22, 22, 1, "3 EDI triplets + 8 digits ending -> DECIMAL",
"1110110000001000000010"
"1110100000101100001011"
"0000100010111110001010"
"0000101011111111100100"
"1011101101100010001000"
"1010100000000100010001"
"1000101000100010001110"
"0000100000000000100000"
"1111111111111111111111"
"0000000000000000000000"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"0001000100010001101101"
"1101011110111101100011"
"1100101101000111100010"
"1000010100101111100101"
"0110001001101100100110"
"1101100100110011101111"
"1001110001001011110010"
},
/* 60*/ { -1, -1, -1, "\015*>\015*>\015*>123456789012\015*>", -1, 0, 22, 22, 1, "3 EDI triplets + 12 DECIMAL not ending -> DECIMAL",
"1110110000001000000010"
"1110100000101100001011"
"0000100010111110001010"
"0000101011111111100100"
"1011101101110110000000"
"1010100000110011101110"
"0010100011100010001010"
"0000100000000000100000"
"1111111111111111111111"
"0000000000000000000000"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"1011111100010001100011"
"0111101001010000100101"
"0010110110010110101010"
"1100111001111011100010"
"1000011000100100101001"
"1110010110011011100001"
"1100100100000011111100"
},
/* 61*/ { -1, -1, -1, "123456789012345", -1, 0, 16, 18, 1, "5 DECIMAL triplets, ASCII switch before padding (2)",
"111111111111001100"
"000110000110010101"
"100010110101101111"
@ -1724,7 +1814,7 @@ static void test_encode(int index, int generate, int debug) {
"100010110110101011"
"111111011010110001"
},
/* 58*/ { -1, -1, -1, "1234567890123456", -1, 0, 16, 18, 1, "5 DECIMAL triplets + singlet, switch to ASCII before padding (2)",
/* 62*/ { -1, -1, -1, "1234567890123456", -1, 0, 16, 18, 1, "5 DECIMAL triplets + singlet, switch to ASCII before padding (2)",
"111111111111001100"
"000110000110010101"
"100010110101101111"
@ -1742,7 +1832,7 @@ static void test_encode(int index, int generate, int debug) {
"000101110010100011"
"010101000001110111"
},
/* 59*/ { -1, -1, -1, "12345678901234567", -1, 0, 16, 18, 1, "5 DECIMAL triplets + doublet, switch before ASCII encoding of final char, padding (1)",
/* 63*/ { -1, -1, -1, "12345678901234567", -1, 0, 16, 18, 1, "5 DECIMAL triplets + doublet, switch before ASCII encoding of final char, padding (1)",
"111111111111001100"
"000110000110010101"
"100010110101101111"
@ -1760,7 +1850,7 @@ static void test_encode(int index, int generate, int debug) {
"011100000111101100"
"100010110100110100"
},
/* 60*/ { -1, -1, -1, "123456789012345678", -1, 0, 16, 18, 1, "6 DECIMAL triplets, switch to ASCII, padding (1)",
/* 64*/ { -1, -1, -1, "123456789012345678", -1, 0, 16, 18, 1, "6 DECIMAL triplets, switch to ASCII, padding (1)",
"111111111111001100"
"000110000110010101"
"100010110101101010"
@ -1778,7 +1868,7 @@ static void test_encode(int index, int generate, int debug) {
"101110000010100101"
"011010011110111101"
},
/* 61*/ { -1, -1, -1, "1234567890123456789", -1, 0, 16, 18, 1, "6 DECIMAL triplets + singlet, switch before ASCII encoding of singlet, no padding",
/* 65*/ { -1, -1, -1, "1234567890123456789", -1, 0, 16, 18, 1, "6 DECIMAL triplets + singlet, switch before ASCII encoding of singlet, no padding",
"111111111111001100"
"000110000110010101"
"100010110101101010"
@ -1796,7 +1886,7 @@ static void test_encode(int index, int generate, int debug) {
"011001101011100100"
"101110111011110000"
},
/* 62*/ { -1, -1, -1, "12345678901234567890", -1, 0, 16, 18, 1, "6 DECIMAL triplets + doublet, switch before ASCII 2-digit encoding of doublet, no padding",
/* 66*/ { -1, -1, -1, "12345678901234567890", -1, 0, 16, 18, 1, "6 DECIMAL triplets + doublet, switch before ASCII 2-digit encoding of doublet, no padding",
"111111111111001100"
"000110000110010101"
"100010110101101010"
@ -1814,7 +1904,7 @@ static void test_encode(int index, int generate, int debug) {
"111110100110101101"
"001000111011111111"
},
/* 63*/ { -1, -1, -1, "123456789012345678901", -1, 0, 16, 18, 1, "7 DECIMAL triplets, fills to final codeword, no padding",
/* 67*/ { -1, -1, -1, "123456789012345678901", -1, 0, 16, 18, 1, "7 DECIMAL triplets, fills to final codeword, no padding",
"111111111111001100"
"000110000110010101"
"100010110101101010"
@ -1832,7 +1922,7 @@ static void test_encode(int index, int generate, int debug) {
"111000110101100101"
"110001100000110100"
},
/* 64*/ { -1, -1, -1, "1234567890123456789012", -1, 0, 16, 18, 1, "7 DECIMAL triplets + singlet, fills to final codeword, no padding",
/* 68*/ { -1, -1, -1, "1234567890123456789012", -1, 0, 16, 18, 1, "7 DECIMAL triplets + singlet, fills to final codeword, no padding",
"111111111111001100"
"000110000110010101"
"100010110101101010"
@ -1850,7 +1940,61 @@ static void test_encode(int index, int generate, int debug) {
"100111000001100000"
"101000001010111101"
},
/* 65*/ { -1, -1, 10, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", -1, 0, 16, 49, 1, "T-48 90",
/* 69*/ { -1, -1, -1, "123456789012345678901234567890123678901AB", -1, 0, 28, 32, 1, "DECIMAL + 4 bits ASCII switch",
"11111111111100110010001101110110"
"00011000011001010100000101101010"
"10101011101000101111100111100001"
"01111000011110100000111011101111"
"00101001110001111101000100101000"
"10101011101011111100100011100001"
"10001010001000100010001000101000"
"00011000010001000100010001100001"
"10001010001000100010001000101000"
"00011000010001000100010001100001"
"00001000000000000000000000100000"
"11111111111111111111111111111111"
"00000000000000000000000000100000"
"11111111111111111111111111111111"
"00000000000000000000000000000000"
"01111111111111111111111111111110"
"01000000000000000000000000000010"
"01111111111111111111111111111110"
"10001010001000100010001000101000"
"00011000010001000100010001100001"
"10001010000110111001100000101011"
"00011000011011000011101111101001"
"11111001011001010000010011100010"
"10111001000000011101101001100000"
"10111010100111101101110011101010"
"10011010100110001011101000100101"
"11011010001110110010110100101110"
"01011111010001011011010000110111"
},
/* 70*/ { -1, -1, -1, "123456789012345678901234567890123678901234A", -1, 0, 22, 22, 0, "DECIMAL + single ASCII in last 8 bits; BWIPP different encodation TODO: investigate",
"1111111111110011001000"
"0001100001100101010000"
"1101100110101011101000"
"0101101010011100011110"
"1011101110011100010010"
"1000100011101111111010"
"0111100001111001000001"
"0000100000000000100000"
"1111111111111111111111"
"0000000000000000000000"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"1110100010110010101000"
"0110010011100000100000"
"0100100111101100101110"
"1010101110111110101001"
"1001001001100100101101"
"1111110100001111101111"
"0100010100010000111100"
},
/* 71*/ { -1, -1, 10, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", -1, 0, 16, 49, 1, "T-48 90",
"1111111111001100100011011011010101110100010111110"
"0001000110010101000001010101001110001111010000011"
"0111000100011001010100000010110100111000111101000"
@ -1868,10 +2012,10 @@ static void test_encode(int index, int generate, int debug) {
"1000000000000000000000001000000000000000000000001"
"1011111111111111111111111111111111111111111111101"
},
/* 66*/ { -1, -1, 10, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", -1, ZINT_ERROR_TOO_LONG, 0, 0, 1, "T-48 89",
/* 72*/ { -1, -1, 10, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", -1, ZINT_ERROR_TOO_LONG, 0, 0, 1, "T-48 89",
""
},
/* 67*/ { -1, -1, -1, "A123456789012345678901A", -1, 0, 22, 22, 1, "ASCII + 7 DECIMAL triplets + ASCII",
/* 73*/ { -1, -1, -1, "A123456789012345678901A", -1, 0, 22, 22, 1, "ASCII + 7 DECIMAL triplets + ASCII",
"0100111111111111001100"
"0010100001000110010101"
"1000101101011010101110"
@ -1895,7 +2039,7 @@ static void test_encode(int index, int generate, int debug) {
"1010001010001011101101"
"1101101001100001110101"
},
/* 68*/ { -1, -1, -1, "A1234567890123456789012A", -1, 0, 22, 22, 1, "ASCII + 7 DECIMAL triplets + singlet + ASCII",
/* 74*/ { -1, -1, -1, "A1234567890123456789012A", -1, 0, 22, 22, 1, "ASCII + 7 DECIMAL triplets + singlet + ASCII",
"0100111111111111001100"
"0010100001000110010101"
"1000101101011010101110"
@ -1919,7 +2063,7 @@ static void test_encode(int index, int generate, int debug) {
"0101101010001000100111"
"1110011111011111110100"
},
/* 69*/ { -1, -1, -1, "A12345678901234567890123A", -1, 0, 22, 22, 1, "ASCII + 7 DECIMAL triplets + doublet + ASCII",
/* 75*/ { -1, -1, -1, "A12345678901234567890123A", -1, 0, 22, 22, 1, "ASCII + 7 DECIMAL triplets + doublet + ASCII",
"0100111111111111001100"
"0010100001000110010101"
"1000101101011010101110"
@ -1943,7 +2087,7 @@ static void test_encode(int index, int generate, int debug) {
"0001111010010111100010"
"0001001001000000110100"
},
/* 70*/ { -1, -1, -1, "ABCDEFGHI123456789012A", -1, 0, 22, 22, 1, "3 C40 triplets + 4 DECIMAL triplets + ASCII 0 padding",
/* 76*/ { -1, -1, -1, "ABCDEFGHI123456789012A", -1, 0, 22, 22, 1, "3 C40 triplets + 4 DECIMAL triplets + ASCII 0 padding",
"1110110101111001100010"
"0110101001100111010100"
"1000100101111110001010"
@ -1967,7 +2111,7 @@ static void test_encode(int index, int generate, int debug) {
"0011001101000011100011"
"0100110101010110111011"
},
/* 71*/ { -1, -1, -1, "ABCDEFGHI12345678", -1, 0, 22, 22, 1, "3 C40 triplets + ASCII 2-digits end-of-data",
/* 77*/ { -1, -1, -1, "ABCDEFGHI12345678", -1, 0, 22, 22, 1, "3 C40 triplets + ASCII 2-digits end-of-data",
"1110110101111001100010"
"0110101001100111010100"
"1000100101111110001010"
@ -1991,7 +2135,7 @@ static void test_encode(int index, int generate, int debug) {
"1010111111111110101011"
"1101101100101010110101"
},
/* 72*/ { -1, -1, -1, "ABCDEFGH123456789012345678901A", -1, 0, 22, 22, 1, "2 C40 triplets + doublet + ASCII 2-digits ASCII 0 padding",
/* 78*/ { -1, -1, -1, "ABCDEFGH123456789012345678901A", -1, 0, 22, 22, 1, "2 C40 triplets + doublet + ASCII 2-digits ASCII 0 padding",
"1110110101111001100010"
"0110101001100111010100"
"1000100100111110011010"
@ -2015,7 +2159,31 @@ static void test_encode(int index, int generate, int debug) {
"0010110111111111101111"
"1010010000100000110111"
},
/* 73*/ { -1, -1, -1, "\200\200", -1, 0, 16, 18, 1, "BYTE",
/* 79*/ { -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\113\200", -1, 0, 22, 22, 1, "3 C40 triplets + doublet + extended ASCII - note extended ASCII not encodable in C40 mode",
"1110110101111001100010"
"0110101001100111010100"
"1000100101100110001011"
"0000101111001100101011"
"1000101111100010001000"
"0001101111000100010001"
"1000101000100010000001"
"0000100000000000100000"
"1111111111111111111111"
"0000000000000000000000"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"0100000000000000000010"
"0111111111111111111110"
"0001000100010001101001"
"1001001101110100100010"
"1111100010000001101100"
"0000001011000000100010"
"0010111110100000100000"
"1010000101100100100110"
"0101111100110010110010"
},
/* 80*/ { -1, -1, -1, "\200\200", -1, 0, 16, 18, 1, "BYTE",
"111011000010001000"
"011110001000000000"
"100010100010001000"
@ -2033,7 +2201,7 @@ static void test_encode(int index, int generate, int debug) {
"010011001011100111"
"110100011101110111"
},
/* 74*/ { -1, -1, -1, "\200\200\200\200\200\200\200\200", -1, 0, 16, 18, 1, "BYTE (no padding, byte count 0)",
/* 81*/ { -1, -1, -1, "\200\200\200\200\200\200\200\200", -1, 0, 16, 18, 1, "BYTE (no padding, byte count 0)",
"111011000010001000"
"011110000000000000"
"100010100010001000"
@ -2051,7 +2219,7 @@ static void test_encode(int index, int generate, int debug) {
"111101011011100111"
"101110100100111000"
},
/* 75*/ { -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063", -1, 0, 70, 76, 1, "249 BYTEs + 13 DECIMAL",
/* 82*/ { -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063", -1, 0, 70, 76, 1, "249 BYTEs + 13 DECIMAL",
"1110111111100010001000100011100010001000100010001110001000100010001000111000"
"0111101001000000000000000010000000000000000000001000000000000000000000100000"
"1000101000100010001000100010100010001000100010001010001000100010001000101000"
@ -2123,7 +2291,7 @@ static void test_encode(int index, int generate, int debug) {
"0000101101010101000011010110011110110100100111111011100001010010000111100100"
"1101111110001011101100010011101010100111101110111101101000010100111000111001"
},
/* 76*/ { -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063", -1, 0, 70, 76, 1, "250 BYTEs + 13 DECIMAL",
/* 83*/ { -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063", -1, 0, 70, 76, 1, "250 BYTEs + 13 DECIMAL",
"1110111111000010001000100011100010001000100010001110001000100010001000111000"
"0111101010000000000000000010000000000000000000001000000000000000000000100000"
"1000101000100010001000100010100010001000100010001010001000100010001000101000"
@ -2195,7 +2363,7 @@ static void test_encode(int index, int generate, int debug) {
"1111101101101101100101000110010011000011110001101001001011010001000001100100"
"1110110001110110001100000011110011001110000101001111000111011001010011111110"
},
/* 77*/ { -1, -1, -1, "\061\062\063\064\065\066\067\070\071\060\061\062\063\064\065\066\067\070\071\060\061\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063", -1, 0, 104, 98, 1, "21 DECIMAL + 501 BYTEs + 13 DECIMAL",
/* 84*/ { -1, -1, -1, "\061\062\063\064\065\066\067\070\071\060\061\062\063\064\065\066\067\070\071\060\061\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063", -1, 0, 104, 98, 1, "21 DECIMAL + 501 BYTEs + 13 DECIMAL",
"11111111111100110010001101011110101011101011111011111100001000100010011010001000100010001011001000"
"00010010011001010100000101110010011100011111011110101100010000000000010000000000000000000010000000"
"10001010001000100010001000110000100010001000100010100010001000100010010010001000100010001010001000"
@ -2301,7 +2469,7 @@ static void test_encode(int index, int generate, int debug) {
"11001110100000010100001001010010000101101110100110101100011011001110010101111001100100110010001101"
"01110011001111110111010101111010111001011100001111011101001011010000011011001100100000101011000101"
},
/* 78*/ { -1, -1, -1, "\061\062\063\064\065\066\067\070\071\060\061\062\063\064\065\066\067\070\071\060\061\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063\064\065\066\067\070\071\060\061\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063", -1, 0, 104, 98, 1, "21 DECIMAL + 251 BYTEs + 21 DECIMAL + 252 BYTEs 13 DECIMAL",
/* 85*/ { -1, -1, -1, "\061\062\063\064\065\066\067\070\071\060\061\062\063\064\065\066\067\070\071\060\061\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063\064\065\066\067\070\071\060\061\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\061\062\063", -1, 0, 104, 98, 1, "21 DECIMAL + 251 BYTEs + 21 DECIMAL + 252 BYTEs 13 DECIMAL",
"11111111111100110010001101011110101011101011111011111100001000100010011010001000100010001011001000"
"00010010011001010100000101110010011100011111011110101000010000000000010000000000000000000010000000"
"10001010001000100010001000110000100010001000100010100010001000100010010010001000100010001010001000"
@ -2407,7 +2575,7 @@ static void test_encode(int index, int generate, int debug) {
"01101010000000111001110100110111110011111001000110101010111111101011110001100001110101000110111101"
"01111111101011000101001010011010111100011101111011110000111111000110111010011101101111001111011011"
},
/* 79*/ { -1, 3, -1, "\351", -1, 0, 16, 18, 1, "é in ISO 8859-1",
/* 86*/ { -1, 3, -1, "\351", -1, 0, 16, 18, 1, "é in ISO 8859-1",
"100011010101011000"
"000110110111010010"
"100010100011100110"
@ -2425,7 +2593,7 @@ static void test_encode(int index, int generate, int debug) {
"001010011001100100"
"101100110110110101"
},
/* 80*/ { -1, 899, -1, "\134\134\351\142\154\134\141\150\134", -1, 0, 28, 32, 1, "<bksh>ébl<bksh>ah<bksh>",
/* 87*/ { -1, 899, -1, "\134\134\351\142\154\134\141\150\134", -1, 0, 28, 32, 1, "<bksh>ébl<bksh>ah<bksh>",
"10001101010101100010001110110101"
"00011011011101001010100101101101"
"01011001010101111001100110100110"
@ -2455,7 +2623,7 @@ static void test_encode(int index, int generate, int debug) {
"11011011010100010100111000101011"
"11011110101110100011111110110011"
},
/* 81*/ { GS1_MODE, -1, -1, "[90]12[91]1234567890123A", -1, 0, 22, 22, 1, "Step B4",
/* 88*/ { GS1_MODE, -1, -1, "[90]12[91]1234567890123A", -1, 0, 22, 22, 1, "Step B4",
"1110111101100011101110"
"1000101100111011000100"
"0000101011111001110001"
@ -2479,7 +2647,7 @@ static void test_encode(int index, int generate, int debug) {
"0100001001100001101110"
"1110110100001101111001"
},
/* 82*/ { GS1_MODE, -1, -1, "[90]12[91]12345", -1, 0, 16, 18, 1, "Step B5",
/* 89*/ { GS1_MODE, -1, -1, "[90]12[91]12345", -1, 0, 16, 18, 1, "Step B5",
"111011110110001110"
"100010110011101100"
"111010000010111101"
@ -2497,6 +2665,54 @@ static void test_encode(int index, int generate, int debug) {
"011100010001100101"
"101000101000110110"
},
/* 90*/ { GS1_MODE, -1, -1, "[10]AB[90]ABCDEFGHIJKLMNOP[91]ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 28, 32, 1, "Step P",
"11101110000100010011101101111110"
"10001011000010001110001100100110"
"01011011100110001010000101101001"
"10011010011101010000001111100011"
"10011010101101101110000101100001"
"10101001100101010101000010100111"
"01101001010111100010001100101001"
"00001000100011110101101000101010"
"00001010100011110001111101101011"
"00111011011110000010010011100100"
"00001000000000000000000000100000"
"11111111111111111111111111111111"
"00000000000000000000000000100000"
"11111111111111111111111111111111"
"00000000000000000000000000000000"
"01111111111111111111111111111110"
"01000000000000000000000000000010"
"01111111111111111111111111111110"
"11101011101111010110001000101000"
"01101011111111101100010001100001"
"10001010000010110100001000100011"
"00011000011100110001011011100011"
"11001011010100110100000101100011"
"10111000010010101001100000100100"
"01101001000001010101110001100011"
"00011011010110111001110010100100"
"01111000010000110101101110100100"
"00011110111111111110101011110110"
},
/* 91*/ { GS1_MODE, -1, -1, "[11]121212", -1, 0, 16, 18, 1, "Start FNC1 and Decimal",
"111011000100000101"
"110010110011011111"
"110010001110001000"
"100110001100010001"
"100010100001011101"
"000010000000100000"
"111111111111111111"
"000000000000000000"
"011111111111111110"
"010000000000000010"
"011111111111111110"
"000100010100101010"
"101010101001100101"
"110011110100100111"
"000111100011101101"
"100101110101111101"
},
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;