test_composite.c 393 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663
  1. /*
  2. libzint - the open source barcode library
  3. Copyright (C) 2019-2024 Robin Stuart <rstuart114@gmail.com>
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions
  6. are met:
  7. 1. Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. 2. Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in the
  11. documentation and/or other materials provided with the distribution.
  12. 3. Neither the name of the project nor the names of its contributors
  13. may be used to endorse or promote products derived from this software
  14. without specific prior written permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  16. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  19. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  21. OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  22. HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  23. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  24. OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  25. SUCH DAMAGE.
  26. */
  27. /* SPDX-License-Identifier: BSD-3-Clause */
  28. #include "testcommon.h"
  29. static void test_eanx_leading_zeroes(const testCtx *const p_ctx) {
  30. int debug = p_ctx->debug;
  31. struct item {
  32. int symbology;
  33. char *data;
  34. char *composite;
  35. int ret;
  36. int expected_rows;
  37. int expected_width;
  38. };
  39. /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
  40. static const struct item data[] = {
  41. /* 0*/ { BARCODE_EANX_CC, "1", "[21]A12345678", 0, 8, 72 }, /* EAN-8 */
  42. /* 1*/ { BARCODE_EANX_CC, "12", "[21]A12345678", 0, 8, 72 },
  43. /* 2*/ { BARCODE_EANX_CC, "123", "[21]A12345678", 0, 8, 72 },
  44. /* 3*/ { BARCODE_EANX_CC, "1234", "[21]A12345678", 0, 8, 72 },
  45. /* 4*/ { BARCODE_EANX_CC, "12345", "[21]A12345678", 0, 8, 72 },
  46. /* 5*/ { BARCODE_EANX_CC, "123456", "[21]A12345678", 0, 8, 72 },
  47. /* 6*/ { BARCODE_EANX_CC, "1234567", "[21]A12345678", 0, 8, 72 },
  48. /* 7*/ { BARCODE_EANX_CC, "12345678", "[21]A12345678", 0, 7, 99 }, /* EAN-13 */
  49. /* 8*/ { BARCODE_EANX_CC, "1+12", "[21]A12345678", 0, 8, 98 }, /* EAN-8 + EAN-2 */
  50. /* 9*/ { BARCODE_EANX_CC, "12+12", "[21]A12345678", 0, 8, 98 },
  51. /*10*/ { BARCODE_EANX_CC, "123+12", "[21]A12345678", 0, 8, 98 },
  52. /*11*/ { BARCODE_EANX_CC, "1234+12", "[21]A12345678", 0, 8, 98 },
  53. /*12*/ { BARCODE_EANX_CC, "12345+12", "[21]A12345678", 0, 8, 98 },
  54. /*13*/ { BARCODE_EANX_CC, "123456+12", "[21]A12345678", 0, 8, 98 },
  55. /*14*/ { BARCODE_EANX_CC, "1234567+12", "[21]A12345678", 0, 8, 98 },
  56. /*15*/ { BARCODE_EANX_CC, "12345678+12", "[21]A12345678", 0, 7, 125 }, /* EAN-13 + EAN-2 */
  57. /*16*/ { BARCODE_EANX_CC, "1+123", "[21]A12345678", 0, 8, 125 }, /* EAN-8 + EAN-5 */
  58. /*17*/ { BARCODE_EANX_CC, "12+123", "[21]A12345678", 0, 8, 125 },
  59. /*18*/ { BARCODE_EANX_CC, "123+123", "[21]A12345678", 0, 8, 125 },
  60. /*19*/ { BARCODE_EANX_CC, "1234+123", "[21]A12345678", 0, 8, 125 },
  61. /*20*/ { BARCODE_EANX_CC, "12345+123", "[21]A12345678", 0, 8, 125 },
  62. /*21*/ { BARCODE_EANX_CC, "123456+123", "[21]A12345678", 0, 8, 125 },
  63. /*22*/ { BARCODE_EANX_CC, "1234567+123", "[21]A12345678", 0, 8, 125 },
  64. /*23*/ { BARCODE_EANX_CC, "12345678+123", "[21]A12345678", 0, 7, 152 }, /* EAN-13 + EAN-5 */
  65. /*24*/ { BARCODE_EANX_CC, "1234567890128", "[21]A12345678", 0, 7, 99 }, /* EAN-13 + CHK */
  66. /*25*/ { BARCODE_EANX_CC, "1234567890128+12", "[21]A12345678", 0, 7, 125 }, /* EAN-13 + CHK + EAN-2 */
  67. /*26*/ { BARCODE_EANX_CC, "1234567890128+12345", "[21]A12345678", 0, 7, 152 }, /* EAN-13 + CHK + EAN-5 */
  68. };
  69. const int data_size = ARRAY_SIZE(data);
  70. int i, length, composite_length, ret;
  71. struct zint_symbol *symbol = NULL;
  72. testStartSymbol("test_eanx_leading_zeroes", &symbol);
  73. for (i = 0; i < data_size; i++) {
  74. if (testContinue(p_ctx, i)) continue;
  75. symbol = ZBarcode_Create();
  76. assert_nonnull(symbol, "Symbol not created\n");
  77. length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  78. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  79. strcpy(symbol->primary, data[i].data);
  80. composite_length = (int) strlen(data[i].composite);
  81. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  82. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  83. assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d\n", i, symbol->rows, data[i].expected_rows);
  84. assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n", i, symbol->width, data[i].expected_width);
  85. ZBarcode_Delete(symbol);
  86. }
  87. testFinish();
  88. }
  89. static void test_helper_generate(const struct zint_symbol *symbol, int ret, int i, char *data, char *composite, int option_1, char *comment, int bwipp_cmp) {
  90. char esc_data[1024];
  91. char esc_composite[4096];
  92. testUtilEscape(data, (int) strlen(data), esc_data, sizeof(esc_data));
  93. testUtilEscape(composite, (int) strlen(composite), esc_composite, sizeof(esc_composite));
  94. if (ret == 0) {
  95. if (bwipp_cmp == -1) {
  96. printf(" /*%2d*/ { %s, %d, \"%s\", \"%s\", %d, %d, %d, \"%s\",\n",
  97. i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite, ret, symbol->rows, symbol->width, comment);
  98. } else {
  99. printf(" /*%2d*/ { %s, %d, \"%s\", \"%s\", %d, %d, %d, %d, \"%s\",\n",
  100. i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite, ret, symbol->rows, symbol->width, bwipp_cmp, comment);
  101. }
  102. testUtilModulesPrint(symbol, " ", "\n");
  103. printf(" },\n");
  104. } else {
  105. if (bwipp_cmp == -1) {
  106. printf(" /*%2d*/ { %s, %d, \"%s\", \"%s\", %s, %d, %d, \"%s\", \"\" },\n",
  107. i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite, testUtilErrorName(ret), symbol->rows, symbol->width, comment);
  108. } else {
  109. printf(" /*%2d*/ { %s, %d, \"%s\", \"%s\", %s, %d, %d, %d, \"%s\", \"\" },\n",
  110. i, testUtilBarcodeName(symbol->symbology), option_1, esc_data, esc_composite, testUtilErrorName(ret), symbol->rows, symbol->width, bwipp_cmp, comment);
  111. }
  112. }
  113. }
  114. /* Replicate examples from GS1 General Specifications 21.0.1 and ISO/IEC 24723:2010 */
  115. static void test_examples(const testCtx *const p_ctx) {
  116. int debug = p_ctx->debug;
  117. struct item {
  118. int symbology;
  119. int input_mode;
  120. int option_1;
  121. char *data;
  122. char *composite;
  123. int ret;
  124. int expected_rows;
  125. int expected_width;
  126. int bwipp_cmp;
  127. char *comment;
  128. char *expected;
  129. };
  130. /* Verified manually against GS1 General Specifications 21.0.1 (GGS) and ISO/IEC 24723:2010, with noted exceptions, and verified via bwipp_dump.ps against BWIPP */
  131. static const struct item data[] = {
  132. /* 0*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "0401234567890", "[17]050101[10]ABC123", 0, 11, 56, 1, "GSS Figure 5.1-5. GS1 DataBar Stacked Omnidirectional barcode with a Composite Component",
  133. "01101100110101110001001100001000000110100111011110101001"
  134. "01101101110110001100010100001100001000010110011100101001"
  135. "01101101100111000101110001101001100011111010011101101001"
  136. "01101101000110111100010011001111110100111011011101001001"
  137. "01101001000111110111110100101010100000010000011101001101"
  138. "00000000100110111010100000101010101100110001100000000000"
  139. "01001111011001000100011111000001010011001110011010000000"
  140. "00000000100110111010100000101010101100110001100000000000"
  141. "00000101010101010101010101010101010101010101010000000000"
  142. "00001000110000101010000000101010111011001111000000000000"
  143. "10100111001111010101111111000001000100110000110101000000"
  144. },
  145. /* 1*/ { BARCODE_DBAR_LTD_CC, -1, 1, "1311234567890", "[17]010615[10]A123456", 0, 6, 79, 1, "GGS Figure 5.11.2-1. (24723:2010 Figure 1) GS1 DataBar Limited Composite symbol with CC-A",
  146. "0111100010110110001010011000111110100110011101110100111100111011101001101000000"
  147. "0100111110001101001010111000111101111010111101001111011100111011101011101000000"
  148. "0100110011010000001010110000111001000110111101111011110010100011101011001000000"
  149. "0111100010101000001010010000101110110111111001110011001110010011101010001000000"
  150. "0000001100000101010011001110101011010100110010101111000101100110100111000000000"
  151. "0101110011111010101100110001010100101011001101010000111010011001011000010100000"
  152. },
  153. /* 2*/ { BARCODE_GS1_128_CC, -1, 3, "[01]03812345678908", "[10]ABCD123456[410]3898765432108", 0, 7, 154, 1, "GGS Figure 5.11.2-2. GS1-128 Composite symbol with CC-C **NOT SAME** as zint uses encodation '10', same if '0' forced",
  154. "1111111101010100011110101011110000111101011001111101110111110111010010000010000100010110010000101100001111011110110011011110101001111000111111101000101001"
  155. "1111111101010100011111101010001110100001000111101001100101110010000011100001011000100100100111110110001011100001011111011111101010111000111111101000101001"
  156. "1111111101010100011101010011111100110001111010001101000101011110000010001111101100010111101101111101001001011000111110011101010001111110111111101000101001"
  157. "1111111101010100010101111001111000110010011001110001111010100111100010011110111101000110000110001000101100001011101111011111010111111010111111101000101001"
  158. "1111111101010100011101011100001100101000111111011101011110001001111011111011001000100111100111011101001101101111001000011101011100110000111111101000101001"
  159. "0000000001011000110000101000100110010011011011001110110100001100010010001010001001110111101001100100100001011100110110100001000100100001001001110001010000"
  160. "0000000110100111001111010111011001101100100100110001001011110011101101110101110110001000010110011011011110100011001001011110111011011110110110001110101100"
  161. },
  162. /* 3*/ { BARCODE_GS1_128_CC, -1, 3, "[01]93812345678901", "[10]ABCD123456[410]3898765432108", 0, 7, 154, 1, "24723:2010 Figure 2 GS1-128 Composite symbol with 5-row CC-C **NOT SAME** ditto as above",
  163. "1111111101010100011110101011110000111101011001111101110111110111010010000010000100010110010000101100001111011110110011011110101001111000111111101000101001"
  164. "1111111101010100011111101010001110100001000111101001100101110010000011100001011000100100100111110110001011100001011111011111101010111000111111101000101001"
  165. "1111111101010100011101010011111100110001111010001101000101011110000010001111101100010111101101111101001001011000111110011101010001111110111111101000101001"
  166. "1111111101010100010101111001111000110010011001110001111010100111100010011110111101000110000110001000101100001011101111011111010111111010111111101000101001"
  167. "1111111101010100011101011100001100101000111111011101011110001001111011111011001000100111100111011101001101101111001000011101011100110000111111101000101001"
  168. "0000000001011000110000101000100110010011010111000010110100001100010010001010001001110111101001100100100001001100100110100001000100001001001001110001010000"
  169. "0000000110100111001111010111011001101100101000111101001011110011101101110101110110001000010110011011011110110011011001011110111011110110110110001110101100"
  170. },
  171. /* 4*/ { BARCODE_EANX_CC, -1, 1, "331234567890", "[21]1234-abcd", 0, 7, 99, 1, "GGS Figure 5.11.8-1. EAN-13 symbol with a four-column CC-A component (note [21] not [99])",
  172. "110110111011010000100000110100110011101100001001110100100001011001100001100111000110001011011000101"
  173. "110110110011000110111100010111011001110000101001100100100000010111101001101011100010000011001000101"
  174. "110110100010011010001110000111111010001100101001100110111111010001101001010000011011111011101000101"
  175. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  176. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  177. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  178. "000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
  179. },
  180. /* 5*/ { BARCODE_EANX_CC, -1, 1, "331234567890", "[99]1234-abcd", 0, 7, 99, 1, "24723:2010 Figure 5 An EAN-13 composite symbol (with CC-A)",
  181. "110110111011100110111011110100010100000010001001110100111011010110000001100110010000100011011000101"
  182. "110110110011100010011101100111110001000101101001100100100001101011111101101011100010000011001000101"
  183. "110110100010001011101111110110011100100011101001100110100000011101011001011110001001000011101000101"
  184. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  185. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  186. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  187. "000101011110100110010011011010000100111010110001010101010000100010010010001110100111001010000101010"
  188. },
  189. /* 6*/ { BARCODE_UPCA_CC, -1, 2, "61414101234", "[91]abcdefghijklmnopqrstuvwxyz", 0, 14, 99, 1, "GGS Figure 5.11.8-2. UPC-A symbol with a four-column CC-B component **NOT SAME** (using [91] not [10] as length > 20 max for [10])",
  190. "110001001010000001110010110110011111101100101001111010100100101111000001110101001111110011000100101"
  191. "111001001011101110101000000111101101000111001011111010100011000110000101110011010000110011100100101"
  192. "111101001011110110001101000111101000100000101011110010101001111001000001011111010001110011110100101"
  193. "111101011011110100111100010111011111001011001011110110111110001001110101011111001110011011110101101"
  194. "111101010010001100011100110111001000010011101001110110100011011010000001001100000110001011110101001"
  195. "111001010010000001011110100111100110110100001001110100111001011000010001111010010100000011100101001"
  196. "111011010010011111101110100101110001000011001001100100100011110010000101011110000110011011101101001"
  197. "111010010011100011101000100100001011011000001001100110110001110110100001000110011101100011101001001"
  198. "111010011010110111111011000101111101100111101001000110110100111100001101111100001101010011101001101"
  199. "111010111010111000001000110110111110010001001001000010111100101111101101000110001000111011101011101"
  200. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  201. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  202. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  203. "000101010111100110010100011001100101000110011001010101110010110011011011001000010101110010000101010"
  204. },
  205. /* 7*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, 2, "61414101234", "[10]abcdefghijklmnopqrstuvwxyz", 0, 14, 99, 1, "GGS Figure 5.11.8-2. UPC-A symbol with a four-column CC-B component **NOT SAME** as zint uses encodation '10', same if '0' forced",
  206. "110001001010000001110010110110011111101100101001111010111000101011111101011010001110000011000100101"
  207. "111001001010110011100011000100010000100000101011111010111000111010010001011000111101110011100100101"
  208. "111101001011000001000111010111010000110100001011110010111011001111001101110101100000010011110100101"
  209. "111101011010001000100011110101111101111011101011110110100011111011001001000001010011110011110101101"
  210. "111101010010111011100001000101000110000110001001110110101001100110000001000100000010100011110101001"
  211. "111001010010111110110011110100010111111011101001110100110100111000001001101011100010000011100101001"
  212. "111011010011101000101111110100111100010010001001100100111000010111110101110100010111111011101101001"
  213. "111010010011010010001100000100001011100011101001100110100111101111010001110011100010100011101001001"
  214. "111010011011110010100100000110000001011100101001000110101101011111100001110010011101100011101001101"
  215. "111010111010111000100000110111110110111100101001000010101110000011011101011100001101110011101011101"
  216. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  217. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  218. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  219. "000101010111100110010100011001100101000110011001010101110010110011011011001000010101110010000101010"
  220. },
  221. /* 8*/ { BARCODE_EANX_CC, -1, -1, "1234567", "[21]A12345678", 0, 8, 72, 1, "GGS Figure 5.11.8-3. (24723:2010 Figure 4) EAN-8 symbol with a three-column CC-A",
  222. "101001111000001001010011000111110101110111101001101001111110011101001101"
  223. "111110010011100101010111000101110011011100001111110100011001011101011101"
  224. "110011001000010001010110000101000001000010001001000110110000011101011001"
  225. "101011110010000001010010000111011100111101001111001001000010011101010001"
  226. "000010000000000000000000000000000000000000000000000000000000000000000010"
  227. "000100000000000000000000000000000000000000000000000000000000000000000001"
  228. "000010000000000000000000000000000000000000000000000000000000000000000010"
  229. "000010100110010010011011110101000110101010011101010000100010011100101010"
  230. },
  231. /* 9*/ { BARCODE_UPCE_CC, -1, 1, "0121230", "[15]021231", 0, 9, 55, 1, "GGS Figure 5.11.8-4. (24723:2010 Figure 3) UPC-E symbol with a two-column CC-A",
  232. "1101100110111010011111010001100111100010110011110101001"
  233. "1101101110110010010000110001101000011011100011100101001"
  234. "1101101100111101001000000101000101111000010011101101001"
  235. "1101101000111011110100011101001110011011100011101001001"
  236. "1101001000111000010110111101001110001110010011101001101"
  237. "0001000000000000000000000000000000000000000000000000010"
  238. "0010000000000000000000000000000000000000000000000000001"
  239. "0001000000000000000000000000000000000000000000000000010"
  240. "0001010110011001001100110010011011011110101001110101010"
  241. },
  242. /* 10*/ { BARCODE_DBAR_OMN_CC, -1, 1, "0361234567890", "[11]990102", 0, 5, 100, 1, "GGS Figure 5.11.8-5. (24723:2010 Figure 8) GS1 DataBar Omnidirectional symbol with a four-column CC-A",
  243. "1101101110110000101000110001111001010111100010011101001110011101100110011001001100111000110110001010"
  244. "1101101100110111011111001001000011010111111010011001001101000000111010010010111111001110110010001010"
  245. "1101101000110010010111110001011001101111000010011001101111010011110010010000011001011100111010001010"
  246. "0000000000010110001110100000000101001011010111111011001101010000011010000000010100101000110011110000"
  247. "0000010011101001110001001111111000010100101000000100110010101111100101111111100011010111001100001101"
  248. },
  249. /* 11*/ { BARCODE_DBAR_STK_CC, -1, 1, "0341234567890", "[17]010200", 0, 9, 56, 1, "GGS Figure 5.11.8-6. (24723:2010 Figure 6) GS1 DataBar Stacked symbol with a two-column CC-A",
  250. "01101100110101110011100111101010000100001111011110101001"
  251. "01101101110110110001000010001110111101100100011100101001"
  252. "01101101100110100001111011001111110011010110011101101001"
  253. "01101101000100110000101110001011100000110111011101001001"
  254. "01101001000101110111110111001001100110100000011101001101"
  255. "00000001011011100010000010101010100000101101010000000000"
  256. "01001110100100011101111100000001011111010010100010000000"
  257. "00000011010111101010000010101010101001001101010000000000"
  258. "10101100111000010101111111110111000110110011100101000000"
  259. },
  260. /* 12*/ { BARCODE_DBAR_LTD_CC, -1, 2, "0351234567890", "[91]abcdefghijklmnopqrstuv", 0, 17, 88, 1, "GGS Figure 5.11.8-7. (24723:2010 Figure 7) GS1 DataBar Limited symbol with a three-column CC-B **NOT SAME** (using [91] not [21] as length > 20 max for [21])",
  261. "1101110100111011111011101001011000100100000100001000101111101101001111011011101001000000"
  262. "1101100100111111010100111001011000110111101100001100101010000111100010011011001001000000"
  263. "1101100110100111100001001001010000110111011100101111001101110010001110011011001101000000"
  264. "1101101110111010000010011101010001110111010000100111001000011001100100011011011101000000"
  265. "1101101100111101001000000101010001100100011011111001001111101100100010011011011001000000"
  266. "1101101000101111100111001101010011100101111100011101101000101000011110011011010001000000"
  267. "1101001000100011011010000001010011000100010000001000101101011100011110011010010001000000"
  268. "1101011000101001111110011101010111000111101001010000001110101100100000011010110001000000"
  269. "1101011100101111100001100101010110000110001111000101101111110100110100011010111001000000"
  270. "1101011110110001000010001101010010000110001001011000001000100001010000011010111101000000"
  271. "1101001110100000100111100101011010000111100101000001001111010000100010011010011101000000"
  272. "1101001100110011100100111001001010000101100011101111101000011000100111011010011001000000"
  273. "1101000100101111000111101001001011000110000100001011001010000110001100011010001001000000"
  274. "1101000110111011011100000101001011100110100001110000101111011011100110011010001101000000"
  275. "1101000010111110100111010001011011100100101100011111001011111011100011011010000101000000"
  276. "0000000000000111101110001101000111010101011010100110010111010010011100011010111000000000"
  277. "0000000000101000010001110010111000101010100101011001101000101101100011100101000010100000"
  278. },
  279. /* 13*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, 2, "0351234567890", "[21]abcdefghijklmnopqrstuv", 0, 17, 88, 1, "GGS Figure 5.11.8-7. (24723:2010 Figure 7) GS1 DataBar Limited symbol with a three-column CC-B, same",
  280. "1101110100111011111011101001011000100100000100001000101111010011011111011011101001000000"
  281. "1101100100101111100101110001011000110111110001010011001111101100001001011011001001000000"
  282. "1101100110101111000110110001010000110111011100101111001101110010001110011011001101000000"
  283. "1101101110111010000010011101010001110111010000100111001000011001100100011011011101000000"
  284. "1101101100111101001000000101010001100100011011111001001111101100100010011011011001000000"
  285. "1101101000101111100111001101010011100101111100011101101000101000011110011011010001000000"
  286. "1101001000100011011010000001010011000100010000001000101101011100011110011010010001000000"
  287. "1101011000101001111110011101010111000111101001010000001110101100100000011010110001000000"
  288. "1101011100110100001001111101010110000101111000111011101011100000100110011010111001000000"
  289. "1101011110110001101100001101010010000100110011101100001101110001110011011010111101000000"
  290. "1101001110110100001110000101011010000100100111101000001011110010001111011010011101000000"
  291. "1101001100111001101011111001001010000111000101111100101011111011000001011010011001000000"
  292. "1101000100110100010001100001001011000111101001001111001001001111011110011010001001000000"
  293. "1101000110100010001111000101001011100111011011100000101111100110101000011010001101000000"
  294. "1101000010111110010111000101011011100100001001011110001011111000110100011010000101000000"
  295. "0000000000000111101110001101000111010101011010100110010111010010011100011010111000000000"
  296. "0000000000101000010001110010111000101010100101011001101000101101100011100101000010100000"
  297. },
  298. /* 14*/ { BARCODE_DBAR_EXP_CC, -1, 1, "[01]93712345678904[3103]001234", "[91]1A2B3C4D5E", 0, 5, 151, 1, "GGS Figure 5.11.8-8. (24723:2010 Figure 9) GS1 DataBar Expanded symbol with a four-column CC-A, same, verified against BWIPP and tec-it",
  299. "0011011011101110011010011000011100011100110110100111010011010001000011000101101110011000001101100010100000000000000000000000000000000000000000000000000"
  300. "0011011011001101110111110100011010001111001100100110010010111111001001100100101111110011101100100010100000000000000000000000000000000000000000000000000"
  301. "0011011010001010111011111100011111011011110010100110011011000011010011110100001011001111101110100010100000000000000000000000000000000000000000000000000"
  302. "0000011011111011000100000000101001010000011101001110100110001100111101000010101000011010001110001000100001010000111001010000001010010111000110010110000"
  303. "0101100100000100111011111111000010101111100010110001011001110011000010111100000011100101110001110111011110101111000110001111110000101000111001101000010"
  304. },
  305. /* 15*/ { BARCODE_GS1_128_CC, -1, 1, "[01]03212345678906", "[21]A1B2C3D4E5F6G7H8", 0, 6, 145, 1, "GGS Figure 5.11.8-9. (24723:2010 Figure 11) GS1-128 symbol with a four-column CC-A",
  306. "0000000000000000000001101001000110100001000001101101011110111110010010001101010000010010000011101110100010000111011001010000000000000000000000000"
  307. "0000000000000000000001101011000110101111001100001111010001101100010010000101111000011001101011100101100001000110011001010000000000000000000000000"
  308. "0000000000000000000001101011100100011001100111101011000101110000010110000101001100110011110011011110011001110110111001010000000000000000000000000"
  309. "0000000000000000000001101011110111000111011011001110010001011100010111000101011000011100110010000100000100010110111101010000000000000000000000000"
  310. "0010110001100001010001001100100110110110011100100011011000100100010100010011101111010011001001000010110011011100010100001000100010010011100010100"
  311. "1101001110011110101110110011011001001001100011011100100111011011101011101100010000101100110110111101001100100011101011110111011101101100011101011"
  312. },
  313. /* 16*/ { BARCODE_DBAR_EXPSTK_CC, -1, 1, "[01]00012345678905[10]ABCDEF", "[21]12345678", 0, 13, 102, 1, "24723:2010 Figure 10 — A GS1 DataBar Expanded Stacked Composite symbol (with CC-A) **NOT SAME** bottom 1st and top 2nd linear row separators different; zint same as BWIPP and hard to see how figure in standard could be correct",
  314. "001101101110110100001000001101001100111011000010011101001000110011100110010100111011100000110110001010"
  315. "001101101100101111110100011001111101101000001010011001001011111011011110011010111000100000110010001010"
  316. "001101101000100101001111000001000111011101111010011001101011110110110000011010001011111000111010001010"
  317. "000001000111011100010000000010100100001101100000101010000110010000010100000101010001110100111100100000"
  318. "010110111000100011101111111100001011110010011111010101111001101111101011111000000110001011000011011101"
  319. "000001000111011100010000000010100100001101100000101010000110010000010100000101010001110100111100100000"
  320. "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
  321. "000000110001000010100001000000001010010000001000110101111011001110001001010000001010000101001000010000"
  322. "101111001110111101011100111111110101101111110111001010000100110001110100001111110001111010110111100010"
  323. "000000110001000010100001000000001010010000001000110101111011001110001001010000001010000101001000010000"
  324. "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
  325. "000000111001111101010100001010100101011111000010100000000000000000000000000000000000000000000000000000"
  326. "010111000110000010100011110000001010100000111101000100000000000000000000000000000000000000000000000000"
  327. },
  328. /* 17*/ { BARCODE_GS1_128_CC, -1, 3, "[00]030123456789012340", "[02]13012345678909[37]24[10]1234567ABCDEFG", 0, 7, 174, 1, "24723:2010 Figure 12 — A GS1-128 Composite symbol (with CC-C)",
  329. "111111110101010001111010101111000011010111011110000111011111011101001000001000010001011110101100111110111010010001110001000100011000011011111010100111110111111101000101001000"
  330. "111111110101010001111110101000111010000100111101000110011110101111101111010001010000011111000110010100111001011100011001001001111101100011111101010111000111111101000101001000"
  331. "111111110101010001010100011110000011001111100001010110100010111110001110111101011100011000001101011110101111001000000101100001011111101011101010001111110111111101000101001000"
  332. "111111110101010001010111100111100011110100001011110101011111011111001101010000110000011010011100011110101111001111010001100011101101000011101001011100000111111101000101001000"
  333. "111111110101010001110101110000110011111010100011000100100001111000101110000001011001011110010110001100111100101101100001111011000110100011101011100110000111111101000101001000"
  334. "000000000101100011000010100010010011001101101100111001100100110001001000101000100111011110100110010010000100110010011000100100010011101011101000010001000100001010011100010100"
  335. "000000011010011100111101011101101100110010010011000110011011001110110111010111011000100001011001101101111011001101100111011011101100010100010111101110111011110101100011101011"
  336. },
  337. /* 18*/ { BARCODE_DBAR_STK_CC, -1, 1, "12345678901231", "[91]12345678901234567890", 0, 10, 56, 1, "Example with CC-A 2 cols, 6 rows",
  338. "01100100010111100110100111001011101110001000011100101101"
  339. "01110100010110001011101000001000111010111110011000101101"
  340. "01110110010110101100111111001000111100001001011000101001"
  341. "01100110010111100100010111101101100100100000011001101001"
  342. "01101110010111110011010010001011111101000011011011101001"
  343. "01101111010111111001011010001000001100010111011011001001"
  344. "00000110001100011010100000000100101101110000100000000000"
  345. "01001001110011100100011111111001010010001111011010000000"
  346. "00000110001101011010101010101010101101010000100000000000"
  347. "10101001111010000101100000000111000010100111011101000000"
  348. },
  349. /* 19*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012", 0, 13, 56, 1, "Example with CC-A 2 cols, 7 rows",
  350. "01110110110100100011111001101110001011100110011100010101"
  351. "01110010110111000110101111101001111100110010011000010101"
  352. "01100010110111010110011110001110001110110011011000110101"
  353. "01100010100110010111101100001001011111001100011000100101"
  354. "01100110100101110000001011001110111010011110011100100101"
  355. "01101110100110100000010001101100011010010000011110100101"
  356. "01101100100111001011000100001111000001001010011110101101"
  357. "00000110001100011010100000000100101101110000100000000000"
  358. "01001001110011100100011111111001010010001111011010000000"
  359. "00000110001100011010100000000100101101110000100000000000"
  360. "00000101010101010101010101010101010101010101010000000000"
  361. "00000110000101111010010101010000111101011000100000000000"
  362. "10101001111010000101100000000111000010100111011101000000"
  363. },
  364. /* 20*/ { BARCODE_UPCE_CC, -1, 1, "1234567", "[91]1234567890123456789012345678", 0, 12, 55, 1, "Example with CC-A 3 cols, 8 rows",
  365. "1110111010100100011111001101110001011100110011011011101"
  366. "1110011010111000110101111101001111100110010011011011001"
  367. "1111011010111010110011110001110001110110011011011010001"
  368. "1111001010110010111101100001101101111000010011010010001"
  369. "1110001010100011111011001001000000100101111011010110001"
  370. "1100001010111001111011000101110011001100111011010111001"
  371. "1100011010111011100111100101111110011100101011010111101"
  372. "1100010010101111100011010001111110010111011011010011101"
  373. "0001000000000000000000000000000000000000000000000000010"
  374. "0010000000000000000000000000000000000000000000000000001"
  375. "0001000000000000000000000000000000000000000000000000010"
  376. "0001010010011011110101000110111001000010100100010101010"
  377. },
  378. /* 21*/ { BARCODE_DBAR_STK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901", 0, 13, 56, 1, "Example with CC-A 2 cols, 9 rows",
  379. "01100011010100100011111001101110001011100110011010111101"
  380. "01100010010111000110101111101001111100110010011010011101"
  381. "01110010010111010110011110001110001110110011011010011001"
  382. "01111010010110010111101100001111001000101000011010001001"
  383. "01111010110100111000010011001000111110001101011010001101"
  384. "01111010100111000100010011101010000010000100011010000101"
  385. "01110010100101100111111011001100010111000010011011000101"
  386. "01110110100100011001000111001000010010111100011001000101"
  387. "01110100100111001110011001101011000011101100011101000101"
  388. "00000110001100011010100000000100101101110000100000000000"
  389. "01001001110011100100011111111001010010001111011010000000"
  390. "00000110001101011010101010101010101101010000100000000000"
  391. "10101001111010000101100000000111000010100111011101000000"
  392. },
  393. /* 22*/ { BARCODE_DBAR_OMNSTK_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901234567", 0, 16, 56, 1, "Example with CC-A 2 cols, 10 rows",
  394. "01101001000111100110100111001011101110001000011101001101"
  395. "01101011000110001011101000001000111010111110011101011101"
  396. "01101011100110101100111111001000111100001001011101011001"
  397. "01101011110111100100010111101000100110000110011101010001"
  398. "01101001110111000101110110001111011011100110011001010001"
  399. "01101001100101111100001100101000111100010100011001011001"
  400. "01101000100101000001101100001111101111001011011001011101"
  401. "01101000110111000101100100001111001001000001011001001101"
  402. "01101000010101100111011111001000011101001100011001101101"
  403. "01101100010110001101010000001000100001110111011101101101"
  404. "00000110001100011010100000000100101101110000100000000000"
  405. "01001001110011100100011111111001010010001111011010000000"
  406. "00000110001100011010100000000100101101110000100000000000"
  407. "00000101010101010101010101010101010101010101010000000000"
  408. "00000110000101111010010101010000111101011000100000000000"
  409. "10101001111010000101100000000111000010100111011101000000"
  410. },
  411. /* 23*/ { BARCODE_UPCE_CC, -1, 1, "1234567", "[91]123456789012345678901234567890123456789012334", 0, 16, 55, 1, "Example with CC-A 2 cols, 12 rows",
  412. "1110010100100100011111001101110001011100110011011000101"
  413. "1110110100111000110101111101001111100110010011001000101"
  414. "1110100100111010110011110001110001110110011011101000101"
  415. "1110100110110010111101100001001000011110001011101100101"
  416. "1110101110100011010011100001100010100111110011001100101"
  417. "1110101100111101111001001001100001101100011011011100101"
  418. "1110101000111010001100010001101111010111110011011110101"
  419. "1100101000100110000001011101000111100100010011001110101"
  420. "1100101100100010011101110001110000110100110011101110101"
  421. "1100101110111101000000100101111001010000001011100110101"
  422. "1100100110111110010111101101100011100100111011110110101"
  423. "1100110110100011101110100001000110011101100011110010101"
  424. "0001000000000000000000000000000000000000000000000000010"
  425. "0010000000000000000000000000000000000000000000000000001"
  426. "0001000000000000000000000000000000000000000000000000010"
  427. "0001010010011011110101000110111001000010100100010101010"
  428. },
  429. /* 24*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345", 0, 7, 79, 1, "Example with CC-A 3 cols, 5 rows",
  430. "0111100110100111001001101000101110111000100001011101110010000011000010101000000"
  431. "0100011101011111001011101000111010110010000001100111101011111011000110101000000"
  432. "0101100111011111001011001000110110000010111101110001011111001011000100101000000"
  433. "0101100111100011101011001100110011000011001101000100011001100011100100101000000"
  434. "0111110101011000001011000100110001011110001101101110111110100011110100101000000"
  435. "0000101110100000101011100000101010100011011010110101011010111110001110000000000"
  436. "0101010001011111010100011111010101011100100101001010100101000001110001110100000"
  437. },
  438. /* 25*/ { BARCODE_EANX_CC, -1, 1, "1234567", "[91]1234567890123456789012345678901", 0, 10, 72, 1, "Example with CC-A 3 cols, 6 rows",
  439. "100100011111001101011000100111000101110011001100010111010000011110100101"
  440. "100111110011001001011000110110101100111111001000111100001001011110101101"
  441. "111100100010111101010000110111011000001011001000010100001000011110101001"
  442. "101111110010011001010001110111100010110011001111101000110111011100101001"
  443. "101110111000111101010001100100001001011110001000110010001110011101101001"
  444. "101110111000010001010011100111001110011001101011000011101100011101001001"
  445. "000010000000000000000000000000000000000000000000000000000000000000000010"
  446. "000100000000000000000000000000000000000000000000000000000000000000000001"
  447. "000010000000000000000000000000000000000000000000000000000000000000000010"
  448. "000010100110010010011011110101000110101010011101010000100010011100101010"
  449. },
  450. /* 26*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678901234567", 0, 9, 79, 1, "Example with CC-A 3 cols, 7 rows",
  451. "0100010001101111101011010000110001101000111101110001101011111011001010001000000"
  452. "0110000010011011101001010000111010110011110001110001110110011011001011001000000"
  453. "0110010111101100001001011000100100001111000101110001011101100011001011101000000"
  454. "0110001010011111001001011100101111100001100101000111100010100011001001101000000"
  455. "0101000001101100001011011100111110111100101101100001101100110011001101101000000"
  456. "0110010000111010001011011110101111101001110001011000010111111011101101101000000"
  457. "0101000110001111101011001110101100110011110001001101101111000011100101101000000"
  458. "0000101110100000101011100000101010100011011010110101011010111110001110000000000"
  459. "0101010001011111010100011111010101011100100101001010100101000001110001110100000"
  460. },
  461. /* 27*/ { BARCODE_DBAR_LTD_CC, -1, 1, "12345678901231", "[91]123456789012345678901234567890123456789012345", 0, 10, 79, 1, "Example with CC-A 3 cols, 8 rows",
  462. "0100010001101111101011001110110001101000111101110001101011111011100101101000000"
  463. "0110000010011011101001001110111010110011110001110001110110011011000101101000000"
  464. "0110010111101100001001101110100100001111000101110001011101100011000101001000000"
  465. "0110001010011111001000101110101111100001100101000111100010100011001101001000000"
  466. "0101000001101100001000100110111001110001010001111011101100111011011101001000000"
  467. "0110000010111000101000110110111110001010001101100000101111011011011001001000000"
  468. "0110001101001111001000010110100000011010011101101011001111110011011001101000000"
  469. "0111011000001001101000010010110111101110100001001100111000011011011011101000000"
  470. "0000101110100000101011100000101010100011011010110101011010111110001110000000000"
  471. "0101010001011111010100011111010101011100100101001010100101000001110001110100000"
  472. },
  473. /* 28*/ { BARCODE_UPCA_CC, -1, 1, "12345678901", "[91]12345678901234567890", 0, 7, 99, 1, "Example with CC-A 4 cols, 3 rows",
  474. "110110111011110011010011100101110111000100001001110100101110111001000001100000100110111011011000101"
  475. "110110110011101011001000000110011110101111101001100100110010111101100001110010111011000011001000101"
  476. "110110100010011101000001100100111111011101001001100110111111001011010001000001100010111011101000101"
  477. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  478. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  479. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  480. "000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
  481. },
  482. /* 29*/ { BARCODE_DBAR_OMN_CC, -1, 1, "12345678901231", "[91]1234567890123456789012345678", 0, 6, 100, 1, "Example with CC-A 4 cols, 4 rows",
  483. "1101001000111100110100111001011101110001000010010001101011101110010000011000001001101110111011001010"
  484. "1101011000111010110010000001100111101011111010010000101100101111011000011011011110000100110011001010"
  485. "1101011100100011111011001001000000100101111010110000101100011111010010011000110101111000110111001010"
  486. "1101011110100011011001000001110011100010001010111000101101111011110011011100101000111000110111101010"
  487. "0000000001100011000110101000000001001011011100001001010110000101111010010101010000111101011000100000"
  488. "0000010010011100111001000111111110010100100011110110101001111010000101100000000111000010100111011101"
  489. },
  490. /* 30*/ { BARCODE_DBAR_EXP_CC, -1, 1, "[01]12345678901231", "[91]1234567890123456789012345678901234567", 0, 7, 134, 1, "Example with CC-A 4 cols, 5 rows",
  491. "00110101111011110011010011100101110111000100001011100010101110111001000001100000100110111011011110101000000000000000000000000000000000"
  492. "00110100111011101011001000000110011110101111101011100110110010111101100001001000011110001011001110101000000000000000000000000000000000"
  493. "00110100110010001101001110000110001010011111001011100100101111100001100101000111100010100011101110101000000000000000000000000000000000"
  494. "00110100010010100000110110000111110111100101101011101100110001000100110001101100010001000011100110101000000000000000000000000000000000"
  495. "00110100011011001011110110000100111001001111101001101100111110011000101001001101111110011011110110101000000000000000000000000000000000"
  496. "00001011100111110001000000001010010011000000101001100011100100111011010000101010000111000011110101001101011110000010010100000010100000"
  497. "01010100011000001110111111110000101100111111010110011100011011000100101111000000111000111100001010110010100001111101100011111100001010"
  498. },
  499. /* 31*/ { BARCODE_DBAR_EXPSTK_CC, -1, 1, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345", 0, 12, 102, 1, "Example with CC-A 4 cols, 6 rows",
  500. "001100010110111100110100111001011101110001000010011100101011101110010000011000001001101110110101111010"
  501. "001100010100111010110010000001100111101011111010011110101100101111011000010010000111100010110100111010"
  502. "001100110100100011010011100001100010100111110010111110101011111000011001010001111000101000110100110010"
  503. "001101110100101000001101100001110011100010100010111100101111011101100111010000010110110000110100010010"
  504. "001101100100111110001010001101100000101111011010111101101111000101110111010011110010111100110100011010"
  505. "001101100110110101100111111001110001001111101010011101101001111000101000011001110100111000110100001010"
  506. "000001101110011110010000000010100100001100110001001000111001001110110100001010100001110000111101010000"
  507. "010110010001100001101111111100001011110011001110110111000110110001001011110000001110001111000010101101"
  508. "000001101110011110010000000010100100001100110001001000111001001110110100001010100001110000111101010000"
  509. "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
  510. "000000101111000001001010000001010010111100111110110000000000000000000000000000000000000000000000000000"
  511. "001001010000111110110001111110000101000011000001001010000000000000000000000000000000000000000000000000"
  512. },
  513. /* 32*/ { BARCODE_EANX_CC, -1, 1, "123456789012", "[91]123456789012345678901234567890123456789012345678901234", 0, 11, 99, 1, "Example with CC-A 4 cols, 7 rows",
  514. "110010111010010001111100110111000101110011001000011010110001011101000001000111010111110011011011001"
  515. "110010011011010110011111100100011110000100101000111010101100111011111001011100010011000011011010001"
  516. "110011011011011101110011000101100011010000001000110010111101111001001001100001101100011011010010001"
  517. "111011011011101000110001000110111101011111001000100010101110010111110001110100011000001011010110001"
  518. "111001011010011110001010000100111110000110101001100010111001101001111101000011110100001011010111001"
  519. "110001011011001110001100010111011111011100101001110010111010000101110001110011000010110011010111101"
  520. "110001010011110100110011000111101000010010001001111010111110100010011001001001111001000011010011101"
  521. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  522. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  523. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  524. "000101001001101111010011101011000100001010010001010101001000111010011100101100110110110010010001010"
  525. },
  526. /* 33*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]1234567890123", 0, 12, 55, 1, "Example with CC-B 2 cols, 8 rows",
  527. "1100100010111011111011101001000001000010001011001000101"
  528. "1110100010110100001111011001100101110000100011101000101"
  529. "1110110010101100100111000001011111011000001011101100101"
  530. "1100110010110000110010100001010001000010000011001100101"
  531. "1101110010111110110001001001100100111110111011011100101"
  532. "1101111010100001111000101001110111111001001011011110101"
  533. "1100111010100010001000000101110010000101110011001110101"
  534. "1110111010111110001010110001111000100101000011101110101"
  535. "0001000000000000000000000000000000000000000000000000010"
  536. "0010000000000000000000000000000000000000000000000000001"
  537. "0001000000000000000000000000000000000000000000000000010"
  538. "0001010010011011110101000110111001000010100100010101010"
  539. },
  540. /* 34*/ { BARCODE_DBAR_STK_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567", 0, 15, 56, 1, "Example with CC-B 2 cols, 11 rows",
  541. "01100100010111011111011101001000001000010001011100110101"
  542. "01110100010110100001111011001100101110000100011110110101"
  543. "01110110010101100100111000001011111011000001011110010101"
  544. "01100110010110000110010100001111100101011111011100010101"
  545. "01101110010111011001111001101110100011000010011000010101"
  546. "01101111010101100010111000001111101001110100011000110101"
  547. "01100111010111011010110000001000110000111011011000100101"
  548. "01110111010100010111110110001001001111010000011100100101"
  549. "01110011010100111101000001001010110001111100011110100101"
  550. "01111011010100010000111011101001100001100100011110101101"
  551. "01111001010111101010000100001001110010111110011110101001"
  552. "00000110001100011010100000000100101101110000100000000000"
  553. "01001001110011100100011111111001010010001111011010000000"
  554. "00000110001101011010101010101010101101010000100000000000"
  555. "10101001111010000101100000000111000010100111011101000000"
  556. },
  557. /* 35*/ { BARCODE_DBAR_OMNSTK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123", 0, 20, 56, 1, "Example with CC-B 2 cols, 14 rows",
  558. "01110111010100011111010011101101111110101110011101110101"
  559. "01110011010100100101111000001001000100001111011100110101"
  560. "01111011010101101111001110001111011110101000011110110101"
  561. "01111001010110001110111110101110100011100011011110010101"
  562. "01110001010110011001000111101001010000111100011100010101"
  563. "01100001010110010001000011001101001111011111011000010101"
  564. "01100011010110110111101000001111101100011011011000110101"
  565. "01100010010100111100000100101011000101110000011000100101"
  566. "01110010010100101110001110001111101101011110011100100101"
  567. "01111010010111010000110100001001111101001110011110100101"
  568. "01111010110100111100011011001011110001101100011110101101"
  569. "01111010100111101110101100001111010001011110011110101001"
  570. "01110010100100010111100000101101100111110011011100101001"
  571. "01110110100101100100000111001000000110100111011101101001"
  572. "00000110001100011010100000000100101101110000100000000000"
  573. "01001001110011100100011111111001010010001111011010000000"
  574. "00000110001100011010100000000100101101110000100000000000"
  575. "00000101010101010101010101010101010101010101010000000000"
  576. "00000110000101111010010101010000111101011000100000000000"
  577. "10101001111010000101100000000111000010100111011101000000"
  578. },
  579. /* 36*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567", 0, 21, 55, 1, "Example with CC-B 2 cols, 17 rows",
  580. "1100110100100000011100101101100111111011001011001101001"
  581. "1101110100111110110100111101110110010000110011011101001"
  582. "1101100100111001011001000001110001101110100011011001001"
  583. "1101100110110111111001101001100101100111111011011001101"
  584. "1101101110100010110001100001010000011000110011011011101"
  585. "1101101100100101111101100001111110100101110011011011001"
  586. "1101101000100010110001111101011100100001100011011010001"
  587. "1101001000111110111100101101100100010000110011010010001"
  588. "1101011000111010000110010001110110111000100011010110001"
  589. "1101011100101110110000111001011110110011000011010111001"
  590. "1101011110110111100111010001000010010000100011010111101"
  591. "1101001110101001111000100001110100110000010011010011101"
  592. "1101001100111010011111101101101110010000111011010011001"
  593. "1101000100110001000110011101101100111001110011010001001"
  594. "1101000110100111110100011101100100000111001011010001101"
  595. "1101000010101111000001101101001000000101111011010000101"
  596. "1101100010110001100001101101011101110001000011011000101"
  597. "0001000000000000000000000000000000000000000000000000010"
  598. "0010000000000000000000000000000000000000000000000000001"
  599. "0001000000000000000000000000000000000000000000000000010"
  600. "0001010010011011110101000110111001000010100100010101010"
  601. },
  602. /* 37*/ { BARCODE_DBAR_STK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890", 0, 24, 56, 1, "Example with CC-B 2 cols, 20 rows",
  603. "01111010100111011111011101001000001000010001011110101001"
  604. "01110010100110100001111011001100101110000100011100101001"
  605. "01110110100101100100111000001011111011000001011101101001"
  606. "01110100100110000110010100001111100101011111011101001001"
  607. "01110100110111011001111001101110100011000010011101001101"
  608. "01110101110101100010111000001111101001110100011101011101"
  609. "01110101100101100011000010001100110110110000011101011001"
  610. "01110101000100011001111100101001011111011000011101010001"
  611. "01100101000101101001110000001100010100011111011001010001"
  612. "01100101100100010110000011001000100001000001011001011001"
  613. "01100101110111110001100010101101110011111010011001011101"
  614. "01100100110100100101111000001100111001011100011001001101"
  615. "01100110110111101001001111001001000010010000011001101101"
  616. "01110110110100100001111010001010011111101110011101101101"
  617. "01110010110111010001011111101011110111101111011100101101"
  618. "01100010110100001001110111001000110110000100011000101101"
  619. "01100010100111100100100001001000110011111001011000101001"
  620. "01100110100110111010001110001001101001110000011001101001"
  621. "01101110100101010000010000001110100010011100011011101001"
  622. "01101100100101111101011100001001110100111110011011001001"
  623. "00000110001100011010100000000100101101110000100000000000"
  624. "01001001110011100100011111111001010010001111011010000000"
  625. "00000110001101011010101010101010101101010000100000000000"
  626. "10101001111010000101100000000111000010100111011101000000"
  627. },
  628. /* 38*/ { BARCODE_DBAR_OMNSTK_CC, -1, 2, "12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012", 0, 29, 56, 1, "Example with CC-B 2 cols, 23 rows",
  629. "01110011010100000011100101101100111111011001011110100101"
  630. "01111011010111110110100111101110110010000110011110101101"
  631. "01111001010111001011001000001110001101110100011110101001"
  632. "01110001010110111111001101001100101100111111011100101001"
  633. "01100001010100010110001100001010000011000110011101101001"
  634. "01100011010100101111101100001111110100101110011101001001"
  635. "01100010010100010110001111101011100100001100011101001101"
  636. "01110010010111110111100101101100100010000110011101011101"
  637. "01111010010111010000110010001110110111000100011101011001"
  638. "01111010110101110110000111001011110110011000011101010001"
  639. "01111010100110111100111010001000010010000100011001010001"
  640. "01110010100110100001111011001100110111100010011001011001"
  641. "01110110100111101011111001101000101000111100011001011101"
  642. "01110100100111001101110111101011011000100000011001001101"
  643. "01110100110111111010100011101110011001110100011001101101"
  644. "01110101110100000010101111001001110111001111011101101101"
  645. "01110101100111010010001110001101110011000100011100101101"
  646. "01110101000100010111100000101010011110000100011000101101"
  647. "01100101000101100110001111001011010000001110011000101001"
  648. "01100101100110001000010110001011110111101000011001101001"
  649. "01100101110111111010010011101000101111100011011011101001"
  650. "01100100110110111101000001101110111101001110011011001001"
  651. "01100110110110000010010011001101110001100100011011001101"
  652. "00000110001100011010100000000100101101110000100000000000"
  653. "01001001110011100100011111111001010010001111011010000000"
  654. "00000110001100011010100000000100101101110000100000000000"
  655. "00000101010101010101010101010101010101010101010000000000"
  656. "00000110000101111010010101010000111101011000100000000000"
  657. "10101001111010000101100000000111000010100111011101000000"
  658. },
  659. /* 39*/ { BARCODE_UPCE_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 30, 55, 1, "Example with CC-B 2 cols, 26 rows",
  660. "1100101000100000011100101101000001111001010011000101001"
  661. "1100101100111110110100111101110110010000110011001101001"
  662. "1100101110111001011001000001110001101110100011011101001"
  663. "1100100110110111111001101001100101100111111011011001001"
  664. "1100110110100010110001100001010000011000110011011001101"
  665. "1110110110100101111101100001111110100101110011011011101"
  666. "1110010110100010110001111101011100100001100011011011001"
  667. "1100010110111110111100101101100100010000110011011010001"
  668. "1100010100111010000110010001110110111000100011010010001"
  669. "1100110100101110110000111001011110110011000011010110001"
  670. "1101110100110111100111010001000010010000100011010111001"
  671. "1101100100110100001111011001100110111100010011010111101"
  672. "1101100110111101011111001101000101000111100011010011101"
  673. "1101101110111001101110111101011011000100000011010011001"
  674. "1101101100111111010100011101110011001110100011010001001"
  675. "1101101000100000010101111001001110111001111011010001101"
  676. "1101001000110100010110000001100110001000001011010000101"
  677. "1101011000100110011111000101101011110110000011011000101"
  678. "1101011100100110011011110001100111111001101011001000101"
  679. "1101011110101001110001110001010011000011000011101000101"
  680. "1101001110111101011100011101110101100010000011101100101"
  681. "1101001100110011111000101001000011001101111011001100101"
  682. "1101000100101000001001000001100011001001000011011100101"
  683. "1101000110100010111111011101101000000111010011011110101"
  684. "1101000010111111010001100101011001100111100011001110101"
  685. "1101100010111011000110011101100001000001011011101110101"
  686. "0001000000000000000000000000000000000000000000000000010"
  687. "0010000000000000000000000000000000000000000000000000001"
  688. "0001000000000000000000000000000000000000000000000000010"
  689. "0001010010011011110101000110111001000010100100010101010"
  690. },
  691. /* 40*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456", 0, 8, 88, 1, "Example with CC-B 3 cols, 6 rows",
  692. "1100100010111011111011101001011001110100000100001000101110100001000111011001000101000000"
  693. "1110100010111010111101110001001001110101000011110010001101011100000010011101000101000000"
  694. "1110110010110011010000111101001101110110111110100010001011001001110000011101100101000000"
  695. "1100110010111000100100011101000101110111011110001101001110011101100110011001100101000000"
  696. "1101110010111100101110011101000100110111101000100001001111010001000010011011100101000000"
  697. "1101111010100111100100100001000110110100001111001101101011100111001111011011110101000000"
  698. "0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
  699. "0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
  700. },
  701. /* 41*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]123456789012345678", 0, 12, 82, 1, "Example with CC-B 3 cols, 8 rows",
  702. "1100111010111011111011101001000010110100000100001000101111101101001111011001110101"
  703. "1110111010110010111000010001000010010111001011001000001110001101110100011101110101"
  704. "1110011010110111111001101001000011010101000101111000001100100110111111011100110101"
  705. "1111011010111011010000110001000111010110000110110011001110011010011000011110110101"
  706. "1111001010111011011100100001000110010111011101111001001010011110000100011110010101"
  707. "1110001010111111010110001001000100010111001011111101101001111000011011011100010101"
  708. "1100001010111100100010111101001100010111001111001100101001110001110010011000010101"
  709. "1100011010110011001111010001001110010111110111101110101011100111111001011000110101"
  710. "0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
  711. "0000000000000100000000000000000000000000000000000000000000000000000000000000000001"
  712. "0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
  713. "0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
  714. },
  715. /* 42*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]12345678901234567890123456789", 0, 12, 88, 1, "Example with CC-B 3 cols, 10 rows",
  716. "1100010010100000011100101101001111010110011111101100101001001011110000011000100101000000"
  717. "1110010010111011001000011001011111010101101111001110001111011110101000011100100101000000"
  718. "1111010010110001110111110101011110010111010001110001101110110011110011011110100101000000"
  719. "1111010110100101000011110001011110110101100010111000001111101001110100011110101101000000"
  720. "1111010100111011010001100001001110110110100001001100001110011110110010011110101001000000"
  721. "1110010100101111110010001101001110100100110011111000101111010110000110011100101001000000"
  722. "1110110100100001010000111101001100100101111010000001001001001110111111011101101001000000"
  723. "1110100100110010001000011001001100110111011100110011001110111010001000011101001001000000"
  724. "1110100110111000110011100101001000110110001001111011001111011000110001011101001101000000"
  725. "1110101110110111110100010001001000010101111001100001101101110100111000011101011101000000"
  726. "0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
  727. "0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
  728. },
  729. /* 43*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]12345678901234567890123456789012345678901", 0, 16, 82, 1, "Example with CC-B 3 cols, 12 rows",
  730. "1110101100111011111011101001011000010100000100001000101111101101001111011101011001"
  731. "1110101000110010111000010001011100010111001011001000001110001101110100011101010001"
  732. "1100101000110111111001101001011100110110010110011111101100110010001111011001010001"
  733. "1100101100101000001100011001011100100110010001000011001101001111011111011001011001"
  734. "1100101110110110111101000001011101100111110110001101101000110011111001011001011101"
  735. "1100100110101100010111000001001101100101101001110000001011010000011100011001001101"
  736. "1100110110101110011111011101000101100111100111001011001100011000011011011001101101"
  737. "1110110110111110100100110001000101000100111111010110001000010011111011011101101101"
  738. "1110010110101101100000111101001101000101101110001111101011000000101110011100101101"
  739. "1100010110101101100001000001011101000110011000100001001101110110001000011000101101"
  740. "1100010100100001110101111101011001000101111011001111101111000110110001011000101001"
  741. "1100110100100000110010011101011001100110000100101111101101111000101100011001101001"
  742. "0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
  743. "0000000000000100000000000000000000000000000000000000000000000000000000000000000001"
  744. "0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
  745. "0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
  746. },
  747. /* 44*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567", 0, 17, 88, 1, "Example with CC-B 3 cols, 15 rows",
  748. "1101110100111011111011101001011000100100000100001000101111101101001111011011101001000000"
  749. "1101100100110010111000010001011000110111001011001000001110001101110100011011001001000000"
  750. "1101100110110111111001101001010000110110010110011111101100110010001111011011001101000000"
  751. "1101101110101000001100011001010001110110010001000011001101001111011111011011011101000000"
  752. "1101101100110110111101000001010001100111110110001101101000110011111001011011011001000000"
  753. "1101101000101100010111000001010011100101101001110000001100010100011111011011010001000000"
  754. "1101001000100010110000011001010011000100010000100000101101111001110100011010010001000000"
  755. "1101011000110111001111101001010111000101001111000100001110100110000010011010110001000000"
  756. "1101011100100000111101000101010110000100000011010011101101011011111100011010111001000000"
  757. "1101011110101110011111011101010010000111100110100111001000011000111011011010111101000000"
  758. "1101001110111011101111001001011010000111001000000110101101111010011111011010011101000000"
  759. "1101001100111000111101011101001010000101110110001110001000001101001110011010011001000000"
  760. "1101000100100110011110011101001011000100011001111011101000011011100011011010001001000000"
  761. "1101000110111101000010000101001011100111000010000110101011111101000110011010001101000000"
  762. "1101000010101111110011101001011011100111011010111110001100010111111010011010000101000000"
  763. "0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
  764. "0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
  765. },
  766. /* 45*/ { BARCODE_EANX_CC, -1, 2, "1234567", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]12345678901234567890123", 0, 30, 82, 1, "Example with CC-B 3 cols, 26 rows",
  767. "1100100010111011111011101001000011010100000100001000101111101101001111011110100101"
  768. "1110100010110010111000010001000111010111001011001000001110001101110100011110101101"
  769. "1110110010110111111001101001000110010110010110011111101100110010001111011110101001"
  770. "1100110010101000001100011001000100010110010001000011001101001111011111011100101001"
  771. "1101110010110110111101000001001100010111110110001101101000110011111001011101101001"
  772. "1101111010101100010111000001001110010101101001110000001100010100011111011101001001"
  773. "1100111010100010110000011001001111010100010000100000101101111001110100011101001101"
  774. "1110111010110111001111101001011111010110100001111011001100110111100010011101011101"
  775. "1110011010111101011111001101011110010100010100011110001001100011001111011101011001"
  776. "1111011010101101100010000001011110110111010100011100001011100011110110011101010001"
  777. "1111001010101111010111100001001110110111100010011011001111110100100111011001010001"
  778. "1110001010101111010010000001001110100110111100001011001110100101111110011001011001"
  779. "1100001010110001010011000001001100100110010001100011101110111001000001011001011101"
  780. "1100011010100111011111101001001100110111110011011001101000111010011111011001001101"
  781. "1100010010111101000111101001001000110101100100000011101010110001111100011001101101"
  782. "1110010010101000001000010001001000010110010001100011101011011100011000011101101101"
  783. "1111010010111100011001101001011000010111011101111010001101100001111010011100101101"
  784. "1111010110100001001011110001011100010110001110001011101110111000101111011000101101"
  785. "1111010100111001011101111101011100110111101110100110001001000011011000011000101001"
  786. "1110010100100111011111101001011100100101011110000100001110010001100100011001101001"
  787. "1110110100101111001001000001011101100110001110100111001100111010011100011011101001"
  788. "1110100100110100000010011001001101100100001001100001101011000111101110011011001001"
  789. "1110100110111001000110100001000101100110101111000001101000110010111111011011001101"
  790. "1110101110110000110101111001000101000101110011001110001000011100100011011011011101"
  791. "1110101100110000110000100101001101000101011110011110001101000111011110011011011001"
  792. "1110101000111011011110011001011101000110011011110001001111000101100110011011010001"
  793. "0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
  794. "0000000000000100000000000000000000000000000000000000000000000000000000000000000001"
  795. "0000000000000010000000000000000000000000000000000000000000000000000000000000000010"
  796. "0000000000000010100110010010011011110101000110101010011101010000100010011100101010"
  797. },
  798. /* 46*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234", 0, 34, 88, 1, "Example with CC-B 3 cols, 32 rows",
  799. "1110110100100000011100101101011101100110011111101100101001001011110000011011101001000000"
  800. "1110100100111011001000011001001101100101101111001110001111011110101000011011001001000000"
  801. "1110100110110001110111110101000101100111010001110001101110110011110011011011001101000000"
  802. "1110101110100101000011110001000101000101100010111000001111101001110100011011011101000000"
  803. "1110101100101100011000010001001101000110011011011000001111101111001011011011011001000000"
  804. "1110101000100101111101100001011101000111010000110010001110110111000100011011010001000000"
  805. "1100101000101110110000111001011001000101111011001100001000011101000110011010010001000000"
  806. "1100101100100001001000010001011001100111110110100111101011100111001000011010110001000000"
  807. "1100101110110101110000001001011000100111100100110001101001000011110100011010111001000000"
  808. "1100100110101101110111110001011000110111010100011111101000110000101110011010111101000000"
  809. "1100110110111101111001000101010000110111001100010001101101000101100000011010011101000000"
  810. "1110110110111001101110010001010001110100110011111000101010111100001000011010011001000000"
  811. "1110010110110111010001110001010001100101100011001111001000110010001110011010001001000000"
  812. "1100010110111101111001010001010011100110111001101000001000011011101100011010001101000000"
  813. "1100010100111010000111011001010011000100111010011111001100011011110100011010000101000000"
  814. "1100110100100011110110001101010111000110011111010000101100100111111001011011000101000000"
  815. "1101110100100010111101111001010110000101000011100011101000110000110100011001000101000000"
  816. "1101100100111110001100101001010010000110101111101110001110010011110111011101000101000000"
  817. "1101100110101111101100000101011010000100000011001011101000011011011110011101100101000000"
  818. "1101101110110101000011000001001010000111011110011001001101110110010000011001100101000000"
  819. "1101101100111110110100010001001011000111000100110100001011110010111100011011100101000000"
  820. "1101101000100111111001110101001011100111011100100111101000101000001111011011110101000000"
  821. "1101001000110000101110111101011011100111000111011011001101001001100000011001110101000000"
  822. "1101011000100101111010000001011011110100000010111101001100110111100001011101110101000000"
  823. "1101011100110011000100111101011001110111110100111001001011111011000010011100110101000000"
  824. "1101011110110000110000101001001001110100000101110111001100010011101111011110110101000000"
  825. "1101001110111111011100010101001101110110001101111010001010011111000110011110010101000000"
  826. "1101001100100100010000111101000101110101111101100100001001101101111000011100010101000000"
  827. "1101000100111011010011000001000100110110010010011000001001000110000110011000010101000000"
  828. "1101000110111110011101101001000110110110000010011100101010011110100000011000110101000000"
  829. "1101000010110010001011111001000010110101111000100100001100111101000110011000100101000000"
  830. "1101100010111110010101111101000010010100111001110100001110010011001111011100100101000000"
  831. "0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
  832. "0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
  833. },
  834. /* 47*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]1234567890123456789012345678901234567890123456789012345678", 0, 40, 88, 1, "Example with CC-B 3 cols, 38 rows",
  835. "1100010010100000011100101101000101100110011111101100101001001011110000011010011101000000"
  836. "1110010010111011001000011001000101000101101111001110001111011110101000011010011001000000"
  837. "1111010010110001110111110101001101000111010001110001101110110011110011011010001001000000"
  838. "1111010110100101000011110001011101000101100010111000001111101001110100011010001101000000"
  839. "1111010100101100011000010001011001000110011011011000001111101111001011011010000101000000"
  840. "1110010100100101111101100001011001100111010000110010001110110111000100011011000101000000"
  841. "1110110100101110110000111001011000100101111011001100001000011101000110011001000101000000"
  842. "1110100100100001001000010001011000110111110110100111101011100111001000011101000101000000"
  843. "1110100110110101110000001001010000110111100100110001101001000011110100011101100101000000"
  844. "1110101110101101110111110001010001110111010100011111101000110000101110011001100101000000"
  845. "1110101100111101111001000101010001100111001100010001101101000101100000011011100101000000"
  846. "1110101000111001101110010001010011100100110011111000101010111100001000011011110101000000"
  847. "1100101000110111010001110001010011000101100011001111001000110010001110011001110101000000"
  848. "1100101100111101111001010001010111000110111001101000001000011011101100011101110101000000"
  849. "1100101110111010000111011001010110000100111010011111001100011011110100011100110101000000"
  850. "1100100110100011110100010001010010000101111110011100101101001000011111011110110101000000"
  851. "1100110110110111011000100001011010000111000111001010001001000111011100011110010101000000"
  852. "1110110110100000100011110101001010000110101110000010001011110001011110011100010101000000"
  853. "1110010110110001110100111001001011000110001100010111101111011101011111011000010101000000"
  854. "1100010110111011001000110001001011100111101011011111001110001010001110011000110101000000"
  855. "1100010100111010011010000001011011100110000101110001001111001010000001011000100101000000"
  856. "1100110100100010001001111001011011110110100000101111101110001111010111011100100101000000"
  857. "1101110100110111101110001001011001110101011111011111001101010000110000011110100101000000"
  858. "1101100100111101001010000001001001110111000100001101001100000100111001011110101101000000"
  859. "1101100110100110110111100001001101110110111110001000101100111000100111011110101001000000"
  860. "1101101110110100001001100001000101110101000001000100001000001010100000011100101001000000"
  861. "1101101100111101000100000101000100110100111011111100101110101111101111011101101001000000"
  862. "1101101000110111010000011101000110110100000010101111001000111001101110011101001001000000"
  863. "1101001000111110110010111101000010110101101100010000001100101100111000011101001101000000"
  864. "1101011000111000010011010001000010010110001100111101001100000101110001011101011101000000"
  865. "1101011100100111100000100101000011010101110011001110001001111100110100011101011001000000"
  866. "1101011110111000101011100001000111010110000101011000001110010100111000011101010001000000"
  867. "1101001110100100011111001101000110010110110011110001001110110011100100011001010001000000"
  868. "1101001100110111100001001101000100010110010010111110001111110010110010011001011001000000"
  869. "1101000100100000100001000101001100010110100100000110001101110110010000011001011101000000"
  870. "1101000110111100001001000101001110010110110111110011001000101111010000011001001101000000"
  871. "1101000010100000101000111101001111010100110011011110001011111001110011011001101101000000"
  872. "1101100010100110000110100001011111010110010000001011001100100011001110011101101101000000"
  873. "0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
  874. "0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
  875. },
  876. /* 48*/ { BARCODE_DBAR_LTD_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234567890123456789012345678901", 0, 46, 88, 1, "Example with CC-B 3 cols, 44 rows",
  877. "1100100010111011111011101001011000010110001110001101001111101101001111011010001001000000"
  878. "1110100010110010111000010001011100010111001011001000001110001101110100011010001101000000"
  879. "1110110010110111111001101001011100110110010110011111101100110010001111011010000101000000"
  880. "1100110010101000001100011001011100100110010001000011001101001111011111011011000101000000"
  881. "1101110010110110111101000001011101100111110110001101101000110011111001011001000101000000"
  882. "1101111010101100010111000001001101100101101001110000001100010100011111011101000101000000"
  883. "1100111010100010110000011001000101100100010000100000101101111001110100011101100101000000"
  884. "1110111010110111001111101001000101000110100001111011001100110111100010011001100101000000"
  885. "1110011010111101011111001101001101000100010100011110001001100011001111011011100101000000"
  886. "1111011010101101100010000001011101000111010100011100001011100011110110011011110101000000"
  887. "1111001010101111010111100001011001000111100010011011001111110100100111011001110101000000"
  888. "1110001010101111010010000001011001100110111100001011001110100101111110011101110101000000"
  889. "1100001010110001010011000001011000100110010001100011101110111001000001011100110101000000"
  890. "1100011010100111011111101001011000110111110011011001101000111010011111011110110101000000"
  891. "1100010010111011010001111101010000110110011110001001101000111000100011011110010101000000"
  892. "1110010010100011000011001001010001110110001110110000101110100110001111011100010101000000"
  893. "1111010010111110001010110001010001100111000000101100101111101101000010011000010101000000"
  894. "1111010110110011111000100101010011100111101011111011001000111101110111011000110101000000"
  895. "1111010100110001101100001101010011000101110011110011001011000001100010011000100101000000"
  896. "1110010100111001011100110001010111000111000001001100101101000011100010011100100101000000"
  897. "1110110100100010000010111101010110000100011010000011101111110100110010011110100101000000"
  898. "1110100100111101000101111001010010000100010011101110001011000001100100011110101101000000"
  899. "1110100110111110100000101101011010000111101000001101101110100001101000011110101001000000"
  900. "1110101110101100000110111101001010000100011110100001001101110100001110011100101001000000"
  901. "1110101100100100000101000001001011000110110000100000101011011100011000011101101001000000"
  902. "1110101000111110011101100101001011100111000010110000101110100000111011011101001001000000"
  903. "1100101000111010111111011001011011100111001111001011101001111000110011011101001101000000"
  904. "1100101100111101110110111001011011110110010000010110001010100000010000011101011101000000"
  905. "1100101110101101011111100001011001110100111011111100101011110001011110011101011001000000"
  906. "1100100110111010011111000101001001110100001010111100001110010111110001011101010001000000"
  907. "1100110110100110110000010001001101110110100110111000001111011000100111011001010001000000"
  908. "1110110110100100011110010001000101110101101111100001001001011110000010011001011001000000"
  909. "1110010110110111111001100101000100110101111011100011101000010001011110011001011101000000"
  910. "1100010110110001101100001101000110110111010110011110001110011000101100011001001101000000"
  911. "1100010100100001011111001101000010110110010011100100001101101111000100011001101101000000"
  912. "1100110100111010001111101001000010010101111000001101101110010010111111011101101101000000"
  913. "1101110100100110001110011001000011010100001101110110001001101100000100011100101101000000"
  914. "1101100100100011001111101001000111010110000101110001001111000101110111011000101101000000"
  915. "1101100110110111101000110001000110010101111100001100101100101111110100011000101001000000"
  916. "1101101110100001011000110001000100010110100011101111001100111001101000011001101001000000"
  917. "1101101100111110010011011101001100010111101110011100101110011001110100011011101001000000"
  918. "1101101000111011010011111001001110010100011110000010101101111100100010011011001001000000"
  919. "1101001000100100000100100001001111010100110000110000101101101000100000011011001101000000"
  920. "1101011000110000100111101101011111010111100010100001001100001011100010011011011101000000"
  921. "0000000000000101110100000101011100000101010100011011010110101011010111110001110000000000"
  922. "0000000000101010001011111010100011111010101011100100101001010100101000001110001110100000"
  923. },
  924. /* 49*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]1234567890123", 0, 8, 99, 1, "Example with CC-B 4 cols, 4 rows",
  925. "110100111010001111101001110110111111010111001001110110110100001111011001100101110000100011010010001"
  926. "110100110010110010011100000101111101100000101001110100110111111001101001110100111110010011010110001"
  927. "110100010011100110100001100110010000010110001001100100100111101111010001110001110100010011010111001"
  928. "110100011011000101110000010111011011100100001001100110111110001010110001111000100101000011010111101"
  929. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  930. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  931. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  932. "000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
  933. },
  934. /* 50*/ { BARCODE_EANX_CC, -1, 2, "123456789012", "[91]1234567890123456789012345", 0, 10, 99, 1, "Example with CC-B 4 cols, 6 rows",
  935. "110010001011101111101110100110001110001101001011001110111110110100111101110110010000110011001000101"
  936. "111010001011100101100100000111000110111010001001001110110001110111110101110100011100011011101000101"
  937. "111011001011001100100011110100101000011110001001101110101100010111000001010011000111110011101100101"
  938. "110011001011000010010110000100111101111101101000101110111110101001111101100110000101000011001100101"
  939. "110111001011111001000010110111110011010000101000100110111111001010111001110100001101000011011100101"
  940. "110111101010011100001000110110011100010111001000110110100000100010111101111110010011010011011110101"
  941. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  942. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  943. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  944. "000101001001101111010011101011000100001010010001010101001000111010011100101100110110110010010001010"
  945. },
  946. /* 51*/ { BARCODE_GS1_128_CC, -1, 2, "[01]12345678901231", "[91]12345678901234567890123456789012345678901", 0, 10, 145, 1, "Example with CC-B 4 cols, 8 rows",
  947. "0000000000000000000001100111010111011111011101001000001000010001010000101101111101101001111011101100100001100110011101010000000000000000000000000"
  948. "0000000000000000000001110111010111001011001000001110001101110100010000100101100011101111101011101000111000110111011101010000000000000000000000000"
  949. "0000000000000000000001110011010110011001000111101001010000111100010000110101011000101110000011111010011101000111001101010000000000000000000000000"
  950. "0000000000000000000001111011010101100011000010001100110110110000010001110101111101111001011011001000100001100111101101010000000000000000000000000"
  951. "0000000000000000000001111001010111010000110010001101000011100010010001100101000001001111010011100110001110010111100101010000000000000000000000000"
  952. "0000000000000000000001110001010110001010111110001001010011110000010001000101011111101111011011011111100110010111000101010000000000000000000000000"
  953. "0000000000000000000001100001010101000110001100001101100001000100010011000101011110011111011011000010001011000110000101010000000000000000000000000"
  954. "0000000000000000000001100011010110111000111110101111100010010011010011100101000011010111111011001100001111010110001101010000000000000000000000000"
  955. "0010110001100001010001001100100110100110001101110100111000111010010011110101100100001001010011000110010011100100010100001000101001110011100010100"
  956. "1101001110011110101110110011011001011001110010001011000111000101101100001010011011110110101100111001101100011011101011110111010110001100011101011"
  957. },
  958. /* 52*/ { BARCODE_DBAR_OMN_CC, -1, 2, "12345678901231", "[91]123456789012345678901234567890123456789012345678901234567", 0, 12, 100, 1, "Example with CC-B 4 cols, 10 rows",
  959. "1100010010100000011100101101100111111011001010011110101001001011110000010010001000011110110001001010"
  960. "1110010010101101111001110001111011110101000010111110101100001100101000011111001010111110111001001010"
  961. "1111010010111011001111001101110100011000010010111100101001011111011000011111101001011100111101001010"
  962. "1111010110100010110001111101011100100001100010111101101001111000001001010110001011100000111101011010"
  963. "1111010100100101110001110001100100001001100010011101101000101100000110010001000010000010111101010010"
  964. "1110010100111110001100010101101110011111010010011101001010011110001000011101001100000100111001010010"
  965. "1110110100100000111101101101101110000101110010011001001100011110100011010000100101111000111011010010"
  966. "1110100100100110111000110001000100001100110010011001101000101000000100011100010010011100111010010010"
  967. "1110100110110110011110000101110000100011010010010001101111101100001010010110011111000100111010011010"
  968. "1110101110101111000010010001011110000010001010010000101001010000111100011011110001011000111010111010"
  969. "0000000001100011000110101000000001001011011100001001010110000101111010010101010000111101011000100000"
  970. "0000010010011100111001000111111110010100100011110110101001111010000101100000000111000010100111011101"
  971. },
  972. /* 53*/ { BARCODE_DBAR_EXP_CC, -1, 2, "[01]12345678901231", "[91]1234567890123456789012345678901234567890123456789012345678901234567890123", 0, 14, 134, 1, "Example with CC-B 4 cols, 12 rows",
  973. "00111010110011101111101110100100000100001000101011000010111110110100111101110110010000110011101011001000000000000000000000000000000000"
  974. "00111010100011100101100100000111000110111010001011100010110001110111110101110100011100011011101010001000000000000000000000000000000000"
  975. "00110010100011001100100011110100101000011110001011100110101100010111000001111101001110100011001010001000000000000000000000000000000000"
  976. "00110010110010110001100001000110011011011000001011100100111110111100101101100100010000110011001011001000000000000000000000000000000000"
  977. "00110010111011101000011001000111011011100010001011101100110110011110000101001101111101000011001011101000000000000000000000000000000000"
  978. "00110010011010000111010001100110001110101110001001101100100100101111000001100111001011100011001001101000000000000000000000000000000000"
  979. "00110011011011110100100111100100100001001000001000101100111001101110111101101000011000111011001101101000000000000000000000000000000000"
  980. "00111011011011101001100000010111010011000100001000101000111110111101110101001111010111100011101101101000000000000000000000000000000000"
  981. "00111001011010100101111000000111010111110100001001101000101111011000011001100011001001111011100101101000000000000000000000000000000000"
  982. "00110001011011101110001000010111001110010100001011101000100001000100001001100111100111010011000101101000000000000000000000000000000000"
  983. "00110001010010000001011110100111100110110100001011001000111011011100010001101000111000010011000101001000000000000000000000000000000000"
  984. "00110011010011111101001110110110110001011110001011001100110001111010011001000001110110111011001101001000000000000000000000000000000000"
  985. "00001011100111110001000000001010010011000000101001100011100100111011010000101010000111000011110101001101011110000010010100000010100000"
  986. "01010100011000001110111111110000101100111111010110011100011011000100101111000000111000111100001010110010100001111101100011111100001010"
  987. },
  988. /* 54*/ { BARCODE_UPCA_CC, -1, 2, "123456789012", "[91]12345678901234567890123456789012345678901234567890123456789012345678901234", 0, 19, 99, 1, "Example with CC-B 4 cols, 15 rows",
  989. "110111010011101111101110100100000100001000101011000100111110110100111101110110010000110011011101001"
  990. "110110010011100101100100000111000110111010001011000110110001110111110101110100011100011011011001001"
  991. "110110011011001100100011110100101000011110001010000110101100010111000001111101001110100011011001101"
  992. "110110111010110001100001000110011011011000001010001110111110111100101101100100010000110011011011101"
  993. "110110110011101000011001000111011011100010001010001100110110011110000101001101111101000011011011001"
  994. "110110100010000111010001100110001110101110001010011100100100101111000001100111001011100011011010001"
  995. "110100100011110100100111100100100001001000001010011000111001101110111101011011000100000011010010001"
  996. "110101100011111101010001110111100010001101101010111000111011000111000101111000001001010011010110001"
  997. "110101110011001001111110010100010001001111001010110000110100000101111101110001111010111011010111001"
  998. "110101111011011110111000100101011111011111001010010000110101000011000001011000111011000011010111101"
  999. "110100111011001000011110110110100000011100101011010000110000011011110101000100011110100011010011101"
  1000. "110100110011110100011110010110111111011001001001010000111110101111001101100110100011110011010011001"
  1001. "110100010011011100011000010111011101110011101001011000100110111011000001001110111101100011010001001"
  1002. "110100011011101100001110100100001111010111101001011100111101010000010001111100011010100011010001101"
  1003. "110100001011010011001111110111001011111101101011011100101001100111110001011100110001110011010000101"
  1004. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  1005. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  1006. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  1007. "000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
  1008. },
  1009. /* 55*/ { BARCODE_DBAR_EXPSTK_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]1234567890123456789012345678901234567890123456", 0, 26, 102, 1, "Example with CC-B 4 cols, 20 rows",
  1010. "001100100010111011111011101001000001000010001010111100101111101101001111011101100100001100111001011010"
  1011. "001110100010111001011001000001110001101110100010111101101100011101111101011101000111000110110001011010"
  1012. "001110110010110011001000111101001010000111100010011101101011000101110000011111010011101000110001010010"
  1013. "001100110010101100011000010001100110110110000010011101001111101111001011011001000100001100110011010010"
  1014. "001101110010111010000110010001110110111000100010011001001101100111100001010011011111010000110111010010"
  1015. "001101111010100001110100011001100011101011100010011001101001001011110000011001110010111000110110010010"
  1016. "001100111010111101001001111001001000010010000010010001101110011011101111010110110001000000110110011010"
  1017. "001110111010111111010100011101110011001110100010010000101011110101111000011110001001101100110110111010"
  1018. "001110011010111110100111001001011110100100000010110000101101111000010110011101001011111100110110110010"
  1019. "001111011010110001010011000001100100011000111010111000101110111001000001011110111100101000110110100010"
  1020. "001111001010111110011011001101000111010011111010111001101110100001110110010011101001111100110100100010"
  1021. "001110001010100011100010001101000111101000100010111001001011111100111001011010010000111110110101100010"
  1022. "001100001010110111011000100001110001110010100010111011001001000111011100011000111011010000110101110010"
  1023. "001100011010111101011000011001110101111001110010011011001100001000111010011100010110001000110101111010"
  1024. "001100010010111001111110100101001001100011111010001011001110101011111100011101100111111010110100111010"
  1025. "001110010010100110000110000101000001000110011010001010001110001010111000011010010001100000110100110010"
  1026. "001111010010111100000101010001000110111111011010011010001001110111111010010011111000101110110100010010"
  1027. "001111010110111110001011101001001110011101111010111010001111110100011010010011100100110000110100011010"
  1028. "001111010100111110111010011101001000110000011010110010001101011100011110010000110111101110110100001010"
  1029. "001110010100100111111010110001010011111000011010110011001110010001110110011110010000110110110110001010"
  1030. "000001101110011110010000000010100100001100110001001000111001001110110100001010100001110000111101010000"
  1031. "010110010001100001101111111100001011110011001110110111000110110001001011110000001110001111000010101101"
  1032. "000001101110011110010000000010100100001100110001001000111001001110110100001010100001110000111101010000"
  1033. "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
  1034. "000000101111000001001010000001010010111100111110110000000000000000000000000000000000000000000000000000"
  1035. "001001010000111110110001111110000101000011000001001010000000000000000000000000000000000000000000000000"
  1036. },
  1037. /* 56*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]12345678901234567890123456789012345678901234567", 0, 30, 99, 1, "Example with CC-B 4 cols, 26 rows",
  1038. "110010001011101111101110100110001110001101001000011010111110110100111101110110010000110011110100101"
  1039. "111010001011100101100100000111000110111010001000111010110001110111110101110100011100011011110101101"
  1040. "111011001011001100100011110100101000011110001000110010101100010111000001111101001110100011110101001"
  1041. "110011001010110001100001000110011011011000001000100010111110111100101101100100010000110011100101001"
  1042. "110111001011101000011001000111011011100010001001100010110110011110000101001101111101000011101101001"
  1043. "110111101010000111010001100110001110101110001001110010100100101111000001100111001011100011101001001"
  1044. "110011101011110100100111100100100001001000001001111010111001101110111101011011000100000011101001101"
  1045. "111011101011111101010001110111001100111010001011111010101111010111100001111000100110110011101011101"
  1046. "111001101011111010011100100101111010010000001011110010110111100001011001110100101111110011101011001"
  1047. "111101101011000101001100000110010001100011101011110110111011100100000101111011110010100011101010001"
  1048. "111100101011111001101100110100011101001111101001110110111010000111011001001110100111110011001010001"
  1049. "111000101010001110001000110100011110100010001001110100101111110011100101101001000011111011001011001"
  1050. "110000101011011101100010000111000111001010001001100100100100011101110001100011101101000011001011101"
  1051. "110001101011010111000001000101111001101111101001100110111000101101000001111010001010000011001001101"
  1052. "110001001010111011001110000101000010111100001001000110100011101000110001000110011011110011001101101"
  1053. "111001001010000010011000110100010100000100001001000010101011100011100001000010110000011011101101101"
  1054. "111101001011111001000100110111000000100110101011000010110010011100000101111001010000001011100101101"
  1055. "111101011010001000100111100110100000101111101011100010111000111101011101101111100110011011000101101"
  1056. "111101010010110001111011100110001100101000001011100110101000011100011101100001001000011011000101001"
  1057. "111001010011010001111000110110101111100011101011100100111010001100000101000000101111001011001101001"
  1058. "111011010010011100010110000101111110011101001011101100110111110000101001100011110100110011011101001"
  1059. "111010010010000100110000110110100000100110001001101100100010111001110001000001001110111011011001001"
  1060. "111010011011100001001101000100001111010111101000101100101111110011011101100111101011111011011001101"
  1061. "111010111010011100011011100101101000000111001000101000100010110001111101100111110010010011011011101"
  1062. "111010110011000011011101110100010100001000001001101000101110011110110001010001100011000011011011001"
  1063. "111010100011100001001100100100101111001000001011101000111001100111001001101000011110110011011010001"
  1064. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  1065. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  1066. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  1067. "000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
  1068. },
  1069. /* 57*/ { BARCODE_DBAR_EXP_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234", 0, 34, 134, 1, "Example with CC-B 4 cols, 32 rows",
  1070. "00111011010010000001110010110110011111101100101011101100100100101111000001001000100001111011011101001000000000000000000000000000000000"
  1071. "00111010010010110111100111000111101111010100001001101100110000110010100001111100101011111011011001001000000000000000000000000000000000"
  1072. "00111010011011101100111100110111010001100001001000101100100101111101100001111110100101110011011001101000000000000000000000000000000000"
  1073. "00111010111010001011000111110101110010000110001000101000100111100000100101011000101110000011011011101000000000000000000000000000000000"
  1074. "00111010110010010111000111000110010000100110001001101000100010110000011001000100001000001011011011001000000000000000000000000000000000"
  1075. "00111010100011111000110001010110111001111101001011101000110100001111011001100110111100010011011010001000000000000000000000000000000000"
  1076. "00110010100011110101111100110100010100011110001011001000100110001100111101011011101111100011010010001000000000000000000000000000000000"
  1077. "00110010110011101010001110000101110001111011001011001100111101111001000101110011000100011011010110001000000000000000000000000000000000"
  1078. "00110010111011111101001001110111001101110010001011000100100110011111000101010111100001000011010111001000000000000000000000000000000000"
  1079. "00110010011011011101000111000101100011001111001011000110100011001000111001011111000011010011010111101000000000000000000000000000000000"
  1080. "00110011011011011100110100000100001101110110001010000110100101111101111101110111101110011011010011101000000000000000000000000000000000"
  1081. "00111011011011000110111101000110000100001110101010001110100011100101111101010111110011000011010011001000000000000000000000000000000000"
  1082. "00111001011010111000001101110100001111011011001010001100101100011101111101100111110001001011010001001000000000000000000000000000000000"
  1083. "00110001011011010010011000000110011100001101001010011100110001101100001101011100111100110011010001101000000000000000000000000000000000"
  1084. "00110001010011111011001100110111001011100110001010011000111000001001100101101000011100010011010000101000000000000000000000000000000000"
  1085. "00110011010010001000001011110100011010000011101010111000111111010011001001111101001110001011011000101000000000000000000000000000000000"
  1086. "00110111010010001001110111000101100000110010001010110000111011010000011001101101101100000011001000101000000000000000000000000000000000"
  1087. "00110110010011101000011010000111001001101000001010010000110011100111110101111001000110011011101000101000000000000000000000000000000000"
  1088. "00110110011011100100111110100111100100111101001011010000111011100101111001100101111110001011101100101000000000000000000000000000000000"
  1089. "00110110111011011110111001000111010110111100001001010000100011000111001101110110101100000011001100101000000000000000000000000000000000"
  1090. "00110110110011011000011110010100010001111101101001011000101001111000010001001100011111010011011100101000000000000000000000000000000000"
  1091. "00110110100010001100110111100101111110111000101001011100100110010111000001101011001111110011011110101000000000000000000000000000000000"
  1092. "00110100100010100000100001000101011111011111001011011100111011100010100001100100110011100011001110101000000000000000000000000000000000"
  1093. "00110101100011111000011010010100100111100000101011011110111001001100000101011000111110010011101110101000000000000000000000000000000000"
  1094. "00110101110010000111100001010100011000100011101011001110111101011111011001011110001000010011100110101000000000000000000000000000000000"
  1095. "00110101111011110110100011100101001111011110001001001110100100001000010001100100111001111011110110101000000000000000000000000000000000"
  1096. "00110100111011111010010001100111000101101000001001101110110011000111101001111100011010001011110010101000000000000000000000000000000000"
  1097. "00110100110011110100011110100101011101111110001000101110100111011101111001011110010100000011100010101000000000000000000000000000000000"
  1098. "00110100010011101101011000000100001100011010001000100110111110111010111001100001100010001011000010101000000000000000000000000000000000"
  1099. "00110100011011100010011001000111000010011000101000110110101110110011111101011001001111110011000110101000000000000000000000000000000000"
  1100. "00110100001011011101000111000100001110100110001000010110100011000010111001000010110011111011000100101000000000000000000000000000000000"
  1101. "00110110001010001110111101100111000110101100001000010010111001010011100001110101011100000011100100101000000000000000000000000000000000"
  1102. "00001011100111110001000000001010010011000000101001100011100100111011010000101010000111000011110101001101011110000010010100000010100000"
  1103. "01010100011000001110111111110000101100111111010110011100011011000100101111000000111000111100001010110010100001111101100011111100001010"
  1104. },
  1105. /* 58*/ { BARCODE_DBAR_EXPSTK_CC, -1, 2, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]1234567890123456789012345678901234567890123456789012", 0, 44, 102, 1, "Example with CC-B 4 cols, 38 rows",
  1106. "001100010010100000011100101101100111111011001010001011001001001011110000010010001000011110110100111010"
  1107. "001110010010101101111001110001111011110101000010001010001100001100101000011111001010111110110100110010"
  1108. "001111010010111011001111001101110100011000010010011010001001011111011000011111101001011100110100010010"
  1109. "001111010110100010110001111101011100100001100010111010001001111000001001010110001011100000110100011010"
  1110. "001111010100100101110001110001100100001001100010110010001000101100000110010001000010000010110100001010"
  1111. "001110010100111110001100010101101110011111010010110011001101000011110110011001101111000100110110001010"
  1112. "001110110100111101011111001101000101000111100010110001001001100011001111010110111011111000110010001010"
  1113. "001110100100111010100011100001011100011110110010110001101111011110010001011100110001000110111010001010"
  1114. "001110100110111111010010011101110011011100100010100001101001100111110001010101111000010000111011001010"
  1115. "001110101110110111010001110001011000110011110010100011101000110010001110010111110000110100110011001010"
  1116. "001110101100110111001101000001000011011101100010100011001001011111011111011101111011100110110111001010"
  1117. "001110101000110001101111010001100001000011101010100111001000111001011111010101111100110000110111101010"
  1118. "001100101000101110000011011101000011110110110010100110001011000111011111011001111100010010110011101010"
  1119. "001100101100110100100110000001100111000011010010101110001100011011000011010111001111001100111011101010"
  1120. "001100101110111110110011001101110010111001100010101100001110000010011001011010000111000100111001101010"
  1121. "001100100110100010000010111101000110100000111010100100001111110100110010011111010011100010111101101010"
  1122. "001100110110100010011101110001011000001100100010110100001110110100000110011011011011000000111100101010"
  1123. "001110110110111010000110100001110010011010000010010100001100111001111101011110010001100110111000101010"
  1124. "001110010110100110110111100001100010010111110010010110001110110111111010010011110001101100110000101010"
  1125. "001100010110110001100100000101101101100110000010010111001101001000011000011000010001101110110001101010"
  1126. "001100010100111100001000100101110010000001101010110111001111011011000010011101000001101000110001001010"
  1127. "001100110100100001000010111101101100110011111010110111101010110111110000010010111001111110111001001010"
  1128. "001101110100100001001100001101000011011010000010110011101001100111001100010010001101100000111101001010"
  1129. "001101100100111010111011000001111110111001010010010011101111100100010011011100000010011010111101011010"
  1130. "001101100110110001011111100101100100111111001010011011101000100010011110011010000010111110111101010010"
  1131. "001101101110100011000011010001101111011100010010001011101010011000110000010110001111011100111001010010"
  1132. "001101101100111000110111010001101111100101111010001001101110111001111001011110101000010000111011010010"
  1133. "001101101000100011010111000001000010010111100010001101101101101100111110011100101001111110111010010010"
  1134. "001101001000100001100011001001000100001000010010000101101110100100111000010001000011000110111010011010"
  1135. "001101011000111010000110001001010000011110100010000100101111100111011001011111101111011010111010111010"
  1136. "001101011100100101100001111101000000110101110010000110101000001010111100011111100101100100111010110010"
  1137. "001101011110110111011000100001101001110001111010001110101100101001100000011100110000100110111010100010"
  1138. "001101001110111100100011001101110010110010000010001100101101001111100111011110001010100000110010100010"
  1139. "001101001100100111001110111101101111110011001010001000101011110010000100010010010011110000110010110010"
  1140. "001101000100100100000100001001101110110010000010011000101111011001000111011100010001001110110010111010"
  1141. "001101000110111100001101100101000100000111101010011100101111001010010000011110011000110100110010011010"
  1142. "001101000010101011011111000001000010100011110010011110101100111110100001010001101000111000110011011010"
  1143. "001101100010111000100100011101001110011110110010111110101100011000010010011011100110000100111011011010"
  1144. "000001101110011110010000000010100100001100110001001000111001001110110100001010100001110000111101010000"
  1145. "010110010001100001101111111100001011110011001110110111000110110001001011110000001110001111000010101101"
  1146. "000001101110011110010000000010100100001100110001001000111001001110110100001010100001110000111101010000"
  1147. "000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010000"
  1148. "000000101111000001001010000001010010111100111110110000000000000000000000000000000000000000000000000000"
  1149. "001001010000111110110001111110000101000011000001001010000000000000000000000000000000000000000000000000"
  1150. },
  1151. /* 59*/ { BARCODE_UPCA_CC, -1, 2, "12345678901", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567", 0, 48, 99, 1, "Example with CC-B 4 cols, 44 rows",
  1152. "110010001011101111101110100100000100001000101011000010111110110100111101110110010000110011010001001"
  1153. "111010001011100101100100000111000110111010001011100010110001110111110101110100011100011011010001101"
  1154. "111011001011001100100011110100101000011110001011100110101100010111000001111101001110100011010000101"
  1155. "110011001010110001100001000110011011011000001011100100111110111100101101100100010000110011011000101"
  1156. "110111001011101000011001000111011011100010001011101100110110011110000101001101111101000011001000101"
  1157. "110111101010000111010001100110001110101110001001101100100100101111000001100111001011100011101000101"
  1158. "110011101011110100100111100100100001001000001000101100111001101110111101011011000100000011101100101"
  1159. "111011101011111101010001110111001100111010001000101000101111010111100001111000100110110011001100101"
  1160. "111001101011111010011100100101111010010000001001101000110111100001011001110100101111110011011100101"
  1161. "111101101011000101001100000110010001100011101011101000111011100100000101111011110010100011011110101"
  1162. "111100101011111001101100110100011101001111101011001000111010000111011001001110100111110011001110101"
  1163. "111000101010001110001000110100011110100010001011001100101111110011100101101001000011111011101110101"
  1164. "110000101011011101100010000111000111001010001011000100100100011101110001100011101101000011100110101"
  1165. "110001101011010111000001000101111000101111001011000110100010000111101001001101111110110011110110101"
  1166. "110001001011110111010111110110010001001111101010000110111001111100101101011010000011100011110010101"
  1167. "111001001011101110100100000110011001100001101010001110111010011101111101111010001011110011100010101"
  1168. "111101001010010000111110110111101100110010001010001100111110100000101101111010000011011011000010101"
  1169. "111101011011101101011111000101100000110111101010011100100011110100001001101110100001110011000110101"
  1170. "111101010010010000010100000110110000100000101010011000101101110001100001000110001101000011000100101"
  1171. "111001010011100001011000010111010000011101101010111000101011110010000001000110100111111011100100101"
  1172. "111011010010011110001100110101110000010110001010110000101100000100111001011011000011110011110100101"
  1173. "111010010011101110001000010111101100100011101010010000110101101110000001100101000011000011110101101"
  1174. "111010011011111011100011010110000010011100101011010000111101000100001001100010011110110011110101001"
  1175. "111010111011111001011101000111000111010111101001010000100111100111011101011101110011110011100101001"
  1176. "111010110010010000110000110100100001000010001001011000101100111000110001010011000110000011101101001"
  1177. "111010100011000010011101000110111001111101001001011100110010011100001001110001011100011011101001001"
  1178. "110010100011100111110101100100010100011110001011011100100011110001010001000100011011111011101001101"
  1179. "110010110011000100001000110110001000110011101011011110111011110110010001001110000111010011101011101"
  1180. "110010111011101000110001000110010111100011001011001110110010001111011001110001101110100011101011001"
  1181. "110010011010011000110011110110100010111110001001001110100001110001011001101110100111000011101010001"
  1182. "110011011011100110100011000111100111101000101001101110111110010101111101111010010011110011001010001"
  1183. "111011011011110100111011100110100000011100101000101110111101101110011001101111110101110011001011001"
  1184. "111001011010000111000100110101100100001110001000100110110011100001011101011100001011000011001011101"
  1185. "110001011010000010100010000110100110111000001000110110100100000110110001001000011011000011001001101"
  1186. "110001010010100001111100110101101111110001101000010110111110010001001101111100010110111011001101101"
  1187. "110011010011011010011110000110111001000111001000010010110111010000111001001111100110001011101101101"
  1188. "110111010011000011010010000111101100100011101000011010100001100111011001110111101100010011100101101"
  1189. "110110010010101111110111000110101111100111001000111010100100011111001101111000001010010011000101101"
  1190. "110110011010110100000011100100000100100111101000110010100001011001111101000111101001000011000101001"
  1191. "110110111011001111011100100110111000110010001000100010100100001100110001110001110011011011001101001"
  1192. "110110110010111101000011110100100001111001001001100010111001110111100101111010100000010011011101001"
  1193. "110110100011011100100111000110001111010110001001110010100011101101110001100010001011111011011001001"
  1194. "110100100010001110111010000111000100001011101001111010110000110110001101100110000100100011011001101"
  1195. "110101100011100000010110100111100010001010001011111010111101000101000001001111101011100011011011101"
  1196. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  1197. "001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
  1198. "000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010"
  1199. "000101001100100100110111101010001101100010101111010101000100100100011101001110010110011011011001010"
  1200. },
  1201. /* 60*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]12345678901234567890123456789012345678901234567890123456789012345678901234567", 0, 32, 154, 1, "Example with CC-C 5 cols, 30 rows",
  1202. "1111111101010100010101000001000000101000001000001001110111110111010010000010000100010111110110100111101110110010000110011110101001111000111111101000101001"
  1203. "1111111101010100011111010100000110111001011001000001110001101110100011000111011111010111010001110001101110110011110011011111010100001100111111101000101001"
  1204. "1111111101010100011101010011111100100101000011110001011000101110000011111010011101000100010110001111101011100100001100011111101011010000111111101000101001"
  1205. "1111111101010100011101001001110000111110111100101101100100010000110010010111000111000110010000100110001000101100000110011111010111111010111111101000101001"
  1206. "1111111101010100011010111101100000100110111110100001111100011000101011011100111110100110100001111011001100110111100010011101011100000110111111101000101001"
  1207. "1111111101010100011111010111100110111101011111001101000101000111100010011000110011110101101110111110001110101000111111011101011111000100111111101000101001"
  1208. "1111111101010100010100111100111100101110001111011001111011110010001011100110001000110110100010110000001100110001000001011010011100111100111111101000101001"
  1209. "1111111101010100011111101001001110100110011111000101010111100001000011110010001101100101101001111110001111001101101000011110100100100000111111101000101001"
  1210. "1111111101010100011010011001111110101111100001101001000010001011110010001111000100010111011010001111101100111100010011011111010011100100111111101000101001"
  1211. "1111111101010100010100011110111100111100111001011001000110000110010011000111011000010111010011000111101101110110001000010100011101110000111111101000101001"
  1212. "1111111101010100011010011100000010111000000101100101111101101000010010000010001111010110101110000010001011110001011110011101001110000110111111101000101001"
  1213. "1111111101010100010100010000011110110001110100111001100011000101111011110111010111110110010001001111101110011111001011011111010001110100111111101000101001"
  1214. "1111111101010100011101000001001110111110110101111001110111010010000011001100110000110111010011101111101111010001011110010100000101000000111111101000101001"
  1215. "1111111101010100011110100011011000100100001111101101111011001100100011111010000010110111101000001101101110100001101000011110100010000010111111101000101001"
  1216. "1111111101010100010100000100111100101100000110111101000111101000010011011101000011100100110110111100001100010010111110011100101011111100111111101000101001"
  1217. "1111111101010100011001011001110000101101110001100001000110001101000011000110010000010110110110011000001101001000011000010010100000100000111111101000101001"
  1218. "1111111101010100010100011111101110100011010011111101111000010001001011100100000011010111101101100001001110100000110100010100011111001100111111101000101001"
  1219. "1111111101010100011111001011100010100001000010111101101100110011111010101101111100000100101110011111101000011001000111011100101111100100111111101000101001"
  1220. "1111111101010100011101101000001100110000110110011001101000001001100010011000110000100110010100011000001100001001000011011110110100011100111111101000101001"
  1221. "1111111101010100011110100000100010110000100111101101011001111100001010010011110100000111001001110110001111101101000100011111010000010110111111101000101001"
  1222. "1111111101010100010110110111100000110100100011111001011111011101100011000111010111000111000101111100101000110100000111010010010000111100111111101000101001"
  1223. "1111111101010100010110111000011000110111100011100101001000010010000011000011011000110111100110100111001100010000100011010110111001100000111111101000101001"
  1224. "1111111101010100011110010100000010110001011110011001100011011110001011110000010100100111010001100010001100101111000110011111001010000110111111101000101001"
  1225. "1111111101010100011110010011110010101110110000011101011111011000001010011000110011110110100010111110001000011100010110011001001111110010111111101000101001"
  1226. "1111111101010100011001000100110000110001010110000001110011010001100011110011110100010110110010000010001111011001011100011011001000000100111111101000101001"
  1227. "1111111101010100011100101111001110110001011100100001110010111101110010011110101111000111010110001000001111100100001011010010111100100000111111101000101001"
  1228. "1111111101010100011111100100011010100110100111000001011000110001111011000011010111100111110100111010001011100000010110011111011001111010111111101000101001"
  1229. "1111111101010100010010001110001110111001101000110001100100010000011010001110011110110101001100110000001000110001101000010010001110111000111111101000101001"
  1230. "1111111101010100011111101101101110100100111101000001010000111110011011110110011010000111110011001000101101000001110100011110110110100000111111101000101001"
  1231. "1111111101010100010110001110111110100111000000101101000001101000111011111001011101000101111101111011101000111011001110010010000010111100111111101000101001"
  1232. "0000000001011000110000101000100110010011010011000110111010011100011101001001111010110010000100101001100011001001110010100001000101110010001001110001010000"
  1233. "0000000110100111001111010111011001101100101100111001000101100011100010110110000101001101111011010110011100110110001101011110111010001101110110001110101100"
  1234. },
  1235. /* 61*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]12345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 28, 171, 1, "Example with CC-C 6 cols, 25 rows",
  1236. "111111110101010001101010000110000011010000001001100111011111011101001000001000010001011111011010011110111011001000011001011011110011100011111010100111110111111101000101001"
  1237. "111111110101010001111010100000100011100011011101000110001110111110101110100011100011011101100111100110111010001100001001001011111011000011110101000010000111111101000101001"
  1238. "111111110101010001010100011110000011111010011101000100010110001111101011100100001100010011110000010010101100010111000001011010011100000010101000001111000111111101000101001"
  1239. "111111110101010001101001001100000011001000010011000100010110000011001000100001000001011011110011101000100001001000010001111101101001111011101001011100000111111101000101001"
  1240. "111111110101010001101011100000010011001101111000100110101110000001001111001001100011010010000111101000101000001111010001111110101000111011010111000001000111111101000101001"
  1241. "111111110101010001111010111100010010001100001011100100000010101111001001110111001111011111010011100100101111010010000001101111000010110011110101111100110111111101000101001"
  1242. "111111110101010001101001111011111011101001101111000110001010011000001100100011000111011101110010000010111101111001010001101110011010000010100111000111000111111101000101001"
  1243. "111111110101010001111101001001100010001110100111110111010000111011001001110100111110011000110111101000110000100001110101000111001011111011111101001011100111111101000101001"
  1244. "111111110101010001111110100110001011010010000111110101110000011011101000011110110110010110001110111110110011111000100101111010111110110010100111011111100111111101000101001"
  1245. "111111110101010001010001110001110011001110000110100110001101100001101011100111100110010110000011000100110110010001000001000011011010000011010001110111100111111101000101001"
  1246. "111111110101010001101001110000010011010000111000100111001000001100101110001011100011010101111110111000111110100100011001001000011111011011010011100001000111111101000101001"
  1247. "111111110101010001111110100011010011101110101111000110010010001111101001001000001111011101101011111000101100000110111101000111101000010010100011000111110111111101000101001"
  1248. "111111110101010001101000001001100011000101000110000100100000101000001101100001000001010110111000110000100011000110100001100011001000001011010000010110000111111101000101001"
  1249. "111111110101010001110100011010000011101000001110110101011110010000001000110100111111011110000100010010111001000000110101111011011000010011110100010000100111111101000101001"
  1250. "111111110101010001010000010001111010110110000111100100001000010111101101100110011111010101101111100000100101110011111101000011001000111011001010111110000111111101000101001"
  1251. "111111110101010001001011001100000011000011011001100110100000100110001001100011000010011001010001100000110000100100001101110111101100010011001011011100000111111101000101001"
  1252. "111111110101010001010001111100011010110011111000010100100111101000001110010011101100011111011010001000110101111101110001100001001110100011010001111101110111111101000101001"
  1253. "111111110101010001111001011110100011000111010111000111000101111100101000110100000111011100111110101100100010100011110001000111100010100011110010111110110111111101000101001"
  1254. "111111110101010001101101000001000011110011010011100110001000010001101100010001100111011101111011001000100111000011101001010000011011000011011010000100000111111101000101001"
  1255. "111111110101010001111010000010010011001011110001100110010001111011001110001101110100010010000111101000111101001100001101000001011110001011110100000101000111111101000101001"
  1256. "111111110101010001001001001111000011011101001110000101110111101111101000001110010110010110011000011110101100100000011101000110100011100010110110001111000111111101000101001"
  1257. "111111110101010001001001100001100011011001101100000110001110110010001101011000111000011100010010111000101100011110111001001000110000110011011011100111000111111101000101001"
  1258. "111111110101010001111001010000010011110111001110010101001111110111001101100011110010011110110110000100100001101111101001100001001111011011110010100001000111111101000101001"
  1259. "111111110101010001111011011111001011010110011111100100101001111000001101110010000111010001111100011010100001001001111001101001111110100011001001111110100111111101000101001"
  1260. "111111110101010001101100110110000011110100010011110110001000010001101010011101110000011011100011000010111100111000101101011011000010000011001000101100000111111101000101001"
  1261. "111111110101010001100101111001100011011110101111100111110010000101101000010011111011011110011011100110111000100011101101100000010111010011100101111011100111111101000101001"
  1262. "000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001010000100010111001000100111000101000000000000000000000"
  1263. "000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110101111011101000110111011000111010110000000000000000000"
  1264. },
  1265. /* 62*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]1234567890123456789012345678901234567890", 0, 32, 528, 1, "Example with CC-C 27 cols, 30 rows",
  1266. "111111110101010001010100000100000010000100001000010111011111011101001000001000010001011111011010011110111011001000011001011011110011100011110111101010000110000110010100001111100101011111010001011000110000101000001100011001100100010000110011010011110111110101100011000010001100110110110000011111011110010110110010001000011001001011100011100011001000010011000100010110000011001000100001000001011011110011101000100001001000010001111101101001111010111001110010000111101001001111001001000010010000011101011100111110111111101000101001"
  1267. "111111110101010001111010110011000010010000111101000101000001111010001111110101000111011100110011101000101111010111100001111000100110110011111101001001110111001101110010001001100111110001010101111000010000111100100011011001011010011111100011110011011010000100111011111101001111100110110011010001110100111110111010000111011001001110100111110011000110111101000110000100001110101000111001011111010101111100110000111110001010110001110000001011001011111011010000100100000100011110101101011100000100011111010100001100111111101000101001"
  1268. "111111110101010001111110101110011010001111011101110110001110100111001100011000101111011110111010111110110010001001111101110011111001011010110100000111000100010000010111101000110100000111011111101001100100111110100111000101011100010001100011101110101111000110010010001111101001001000001111011101101011111000101100000110111101000111101000010011011101000011100100110110111100001100010010111110011101101111110100100111100011011001000111001000011011001001101111110111010111111011001110011110010111011111101011000100111111101000101001"
  1269. "111111110101010001110100100111000010011100111010000111101110110111001111011000100111011110010010111100111011100010000101111011001000111011010110111000000110010100001100001000010011000011011000011011001100110100000100110001001100011000010011001010001100000110000100100001101110111101100010011111001101011110100100001100001101001000010000100010110011100011000101001100011000001111011110100001010000100100001000110010000110011101100110011000011011011110001110010100100001001000001100001101100011011010011000111000111111101000101001"
  1270. "111111110101010001010111100010000010010001111100110111001101111001101100010111100110011000110111100010111100000101001001110100011000100011001011110001100110010001111011001110001101110100010010000111101000111101001100001101000001011110001011110010001000010111110110001010001110000001011010011100101110000110111001011000000101100010111001000011100101111011100100111101011110001110101100010000011111001000010110111001001111011101111110110100011011110111001110010101001111110111001110010000111011011101011100000110111111101000101001"
  1271. "111111110101010001010010000111100010100010011110000111001001111100101110111110100011010100110011111000110110011001111101011011110111111011001001101111110101111101100000101111100100011101010110001000001110100110110000111101000110000100111010001111001100110110010111111001001011110000010100011010001111110100100111110111011001000111101000010011100010111110100101011100111111001100011110001011011110101111010000100001100110111101111110010110010010011100110111000101100001001110001111010000111101011010111111000100111111101000101001"
  1272. "111111110101010001010011110011110011010100011000000111101000100111101100111000110010011000100110111000110100111001111001100100011001110011101100010001100111101100001011101000011011110111010001100011100110110110010000010001001000100010000010110111100111000110110010010000001100011000011011011001110110000010110010000110111001110100011001111011100011010000110111001110001010001010000011001100011100100100111000101100111011000001110110010000110010000010100010000110011011011000001010011110111100011101000110111100111111101000101001"
  1273. "111111110101010001111010010000001011110011001100010110111001111100101111000001010010011011100011111010110010111110111001110010000111011011110010100100000100011001111101001001111001001111011110100010100000101110110011111101000010111100001011110001000100010100100001111101101111100101101110011110100000010010111010000011000101001111000101111011110100010000010110100011110011001110111011110010011000101110001000111100000101101101001001111010000011001000111001000110000101111001101101000001110010011110100100100000111111101000101001"
  1274. "111111110101010001010001011110000010001100001001110100001110101100001111110001001101011101111000101110100100110001111101000111100001010010011111001100100110001010011111001110001011111010011010001001111100101001110111111001110111111010100011001100100111100110101100011111101011100000100110010100000010111100110001011011111101101100000101111011011000010011110100000101000111101101101001111000011001100001011110111101011111011001001100110001111011110101111001000101011000011111001100001011111101011110100111100010111111101000101001"
  1275. "111111110101010001010001111011110010010001110111000110010011001110001010001000010000010010011101110000110011100011010001001001111001111011101011101111100110000110101000001111011011001111010011101111001100110010110111000001001100111101110011110111100100010110001011100111101101110011000010011010001110011110111101110000101101001100001100100010011011001000000101101100010000001101100110110000011011000100000010100000101010000001111011100110111010011100111100110100100000100000101110011101000010010100001100110000111111101000101001"
  1276. "111111110101010001110100111100111011010001110010000100010111110110001110110001110001011111011010000010111100111011100101110011011101000011111011100011010110100001111011001111001000110110011101000011010000111101010000100001110101110000011011101011110011100111001001101000001110001100111001011111011010000100111000100110100001110100011000010010100001111000010101111001011110001011101011111000011110010011011000101100111110001001111010000110110011100001000110100101001111010000001001000011111011011101001110000110111111101000101001"
  1277. "111111110101010001111110100001101010111001110111100101110100000110001110010111110001011101001111100100110011100001011101000111100010001011011100100011100101011001111100001101100010011110010000010110111110111001010111111001110111000101111011000100100111110101001000001111001101100010011110010110000100111000101000010011110001010001110111111010001100010011100100011110111011101001111101110011011000100111111010101111001001000001011110100001000011000111001001110100111110110000101010000100001111011101000111110010111111101000101001"
  1278. "111111110101010001110100000100111010101000000100000100000100010100001110111000101000011011110001110010101000100010000001001110111101100011000101110011110110010010110000001111011110100010010100100000010000100011000110010001101100010010000010001101111011100110100001011000001010000010100000011001010011000000111000011001001101111011110100010010100000100000100111001010111000001110100000010111010110001110110000110100011011100001110001100101100011110110010111000100011011100011001000101000010000011001010011000000111111101000101001"
  1279. "111111110101010001110100011000010011111001000100110100010111111011101011000101111110011101001100000010100010111100000101110001000110010011111101010111000111010001110001101110110011110011011101000110000100100101111101100001111110100101110011011011110100000111110110001101101000110011111001010010111110110000111010000110010001110110111000100011011001111000010100110111110100001111100011000101011011100111110100110100001111011001100110111100010010101111001000000101110100001111101100011000111101011110100010000010111111101000101001"
  1280. "111111110101010001111110010110001010001000100011110100110110001111001001110011101111011000111100101100100001101101111001101110101110000011111100101110110110101011111000001111100010111001010111110001101000101100011001111001000110010001110010111110000110100100001000101111001000111100010001011101101000111110110011110001001101000111000100011010001111010001000101111110011100101101001000011111010111000001101110100001111011011001011000111011111011001111100010010111101011111011001000111101110111010010100001111000111111101000101001"
  1281. "111111110101010001100101100111000011000110110000110101110011110011001011000001100010011011001000100000100001101100001001110010001011100011010000010001100100001100110010001011011000100000011101010001110000101110001111011001111011110010001011100110001000110110100010110000001100110001000001011000010110011100111010010001110001000110000110100010010000010100000110110000100000101011011100011000010001100011010000110001100100000101101101100110000011010010000110000110000100011011101001110011101000011101101011000000111111101000101001"
  1282. "111111110101010001111010000100001011100100000011010111101101100001001110100000110100011111101110100010110010111000100001111010100000010010100011110001000111110111000110101100000100111001011110100010000100110001001111011001010001111100011011100001000110100100010000111100101000111100101111010000101111010000101011111101110001111101001000110010010000111110110111101100110010001111101000001011011110100000110110111010000110100001111110010010111011110010000100010110010011100000101001000111110011010100011111001100111111101000101001"
  1283. "111111110101010001011010000111000010011100101100000100011011000111101000011000010111011100111110100110100101000111100001111011001111101010111011000001110101111101100000101001100011001111011010001011111000100001110001011001101110100111000010111011110111110100000111001011001011001100001111010110010000001110100011010001110001001000110011111010000111100100010101100100001110001110010100111111011101111001001110111101011110001001001100101110000011111100010110010100100001000111101101001000111110011011010111100000111111101000101001"
  1284. "111111110101010001110110100000110011110111101000010100001001000010001100100001100111011101110110000110111011000010011001110100100011100011000010001000110111001000100111001011001110110000011011000011001100111101110000101101110000110100110010010111011100000100001011110111101110100001000111011000011010010000101111001111010001001000011001100010101110001110000100001101100001001010111100111100010000100111001110111001010111000001001100011100011010010001110011100111101101001110001111011101000110010110110000010000111111101000101001"
  1285. "111111110101010001110100000111011011101011000100000111110010000101101110010011110111011111101101000110111101110011100101010011111101110011100100001110110111010011000000101111001010000100010000101111100110111010111001100001101011100001000010111000010111110110100001110010001000100111110110011101101111001100111010011000000101111000100001001011011110101111100111101000110001101110100000110001011111011010100000110010111000010001100000101110100011111011000110110111110100101100001111001100110001011111010000010110111111101000101001"
  1286. "111111110101010001111100100111010010001110100110000111001111101001101100111101001100011011000101111000100110001000011101110001011111010010111100010000010101110011000011101111010011110010010000111010000110100010000101111001101001100111111011001000010111110100100000010111101100110100011110010011111001110110101111100011101101001010000111100011111001011100100101111001110011101000110100001110010001111001010000110011010111100001100110010011110011110111110101110111111011011101001000110000100111011001001101111110111111101000101001"
  1287. "111111110101010001011011100001100011000110000101000110010000010001101001100000110100010110110000100000111000011001001101100000100110111010110001101000000100100001100110001010001100011000010100111100011110111000011010001101000101100110000011101101011000000110110001110011101110101101111000011001110011010000101000011000001101100010000010110011001110111001100110111000111001101000100111011100011001001110011110110110110000110001110010010011100010011101111011000100011000110010001001000111011100011101100100110000111111101000101001"
  1288. "111111110101010001111100101100111011111100101011100111110100110111001111001010000010010011100100111110111001011000010001111010110000110011111000011010100110100000111000101111000110110010010100011110000100100010111111011101011110101111000010010001111001000111100010011001101110100111000110011101110111101000111100010001001001111011000110001011010000011110110111101001000001001001011110000010011000100011110110101110110011111101101001110000010011110010010000100111111001001011101111000100001001011111001010000110111111101000101001"
  1289. "111111110101010001011001101111000011011010011110000110011000010111101111010111110110010111011100111100111001111010111001000010010011110011001010011111000110111010001110001110110101111100010101000011110000111010111110010001110101111110011010110000011011110101111100011010001011000111011111010001100110011110100101000011110001001001001111000011000111101101110100111001100111001011000000101110010011001100111100111101101011111101101111100010010010100011101111110110111000100011101011101000000110011101100100111110111111101000101001"
  1290. "111111110101010001100100010011000011001101100011000110110100001000001001100111101110011111011110100110110001110110010001001000001000001011100111010000100101000000100000101101110111100111010011011000010000110010001110111101101100010001000010000110110010000110001001011000001000010010000001011010000100000110111101000010111101000100001110111011001110000110100110000110100010001100100000010110011101110001100110100010000100100001110001100100011010000010110000110111010000110111101010100000010000010010001100110000111111101000101001"
  1291. "111111110101010001001011111011000010011110110111110101110101111100001011110000101111011110100100000010111110000100101101100100011110011010000101111101100110001101111001001110110011100100011110100001010000111110100110111001100110011110001010001110100111110111101100011010001111110101101111010010111110001100111101110011101001110100011010000011101000111001100110100011101000001110010011100011011110100110001100111110000101011001110010110000001011111001100001010111101100111001101111100100010011010010111100100000111111101000101001"
  1292. "111111110101010001001000010111100010011101000110000110111001011100001010001001111000011001110101110000100111000110111001110101011111100011001011001111110110011001000111101001010000111100010110001011100000111110100111010001000101100011111010111001000000110101100010111000001101001100111111011001001000111110101001011110000001011111001110011010110000010111000100000100010111101010001100011111010100000100111100111111001011000101000111100001010010001110001011000100110010000011101000100010001111010110001011100000111111101000101001"
  1293. "111111110101010001001000111000111011001000001001100100110000111011001100110011100111011010011100111100110010011101111001000101111011110010100001110001110100011000011010001101111011100010010100110001100000101100011110111001111011110101000010000010001101100100011011001000001101010000110000011010011100011110111010110011110001100001100001010010100100000100000101100111011000001111011110110011010001101100010000111000011000101101111001110101100011011110011100010110110000100100001000011000110010011100100001011100111111101000101001"
  1294. "111111110101010001111011011000010011111101011011110111101010000010001111001011000110011111011101100100110100011100000101010111110001100011010111111011110100011110100111101101011110001100010110111111001100111110100010001101011010011111100010011101011111000111110110100010001110001101110001010000001011110010100101111110011101100001011110011011110100111011100111001001110001101111010001000001010111000100111110100001011110010001101110111110100011111011010001000111001011000001001100110001111001011110110110100000111111101000101001"
  1295. "111111110101010001000101001111000010011101001100000100001100010111001000001101000111010001011011111000101011000011111001011001100111100011011110000100110101101111011111101011111101110001011110110111110010110001111101010001001111010100000011100011110101110100110000100111001010001000111100010110111011111000111111010011001001001111001110111010111011000111000101100000100011101010010000111100010010001101111100100100110111110001100111101011000011110010001111010111011101000111101100111110100010010110000010011100111111101000101001"
  1296. "000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001010000100010111001000100111000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1297. "000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110101111011101000110111011000111010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1298. },
  1299. /* 63*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123" "456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345", 0, 32, 579, 1, "Example with CC-C 30 cols, 30 rows (max)",
  1300. "111111110101010001010100000100000010001110111000100111011111011101001100011100011010011111011010011110111011001000011001011011110011100011110111101010000110000110010100001111100101011111010001011000110000101000001100011001100100010000110011010011110111110101100011000010001100110110110000011111011110010110110010001000011001001011100011100011001000010011000100010110000011001000100001000001011011110011101000100001001000010001111101101001111010111001110010000111101001001111001001000010010000011100110111011110101101100010000001110101000111000010101111011110000111111101000101001"
  1301. "111111110101010001111101011011100011100110011101000101111010111100001111000100110110011111101001001110111001101110010001001100111110001010101111000010000111100100011011001011010011111100011110011011010000100111011111101001111100110110011010001110100111110111010000111011001001110100111110011000110111101000110000100001110101000111001011111010101111100110000111110001010110001110000001011001011111011010000100100000100011110101101011100000100010111100010111100100010000111101001001101111110110011111011001100110111001011100110001110000010011001011111010100001100111111101000101001"
  1302. "111111110101010001010111000111111010110100000111000100010000010111101000110100000111011111101001100100111110100111000101011100010001100011101110101111000110010010001111101001001000001111011101101011111000101100000110111101000111101000010011011101000011100100110110111100001100010010111110011101101111110100100111100011011001000111001000011011001001101111110111010111111011001110011110010111010011110001100110101110000010110001011000001001110010110110000111100100001000010111101101100110011111010101101111100000100101110011111101000011001000111011111101011001000111111101000101001"
  1303. "111111110101010001110100100111000011000011011001100110100000100110001001100011000010011001010001100000110000100100001101110111101100010011111001101011110100100001100001101001000010000100010110011100011000101001100011000001111011110100001010000100100001000110010000110011101100110011000011011011110001110010100100001001000001100001101100011011110011010011100110001000010001101100010001100111011101111011001000100111000011101001010000011011000011101100110011100110001011101111001111011110101000011100110111011110101000110011000001000001011101110011010011000011100111111101000101001"
  1304. "111111110101010001010111100100000011110010001000010111110110001010001110000001011010011100101110000110111001011000000101100010111001000011100101111011100100111101011110001110101100010000011111001000010110111001001111011101111110110100011011110111001110010101001111110111001110010000111011011101001100000010111100101000010001000010111110011011010111111011110110010111000100001111001010100000011101000001110110111000110111010001100101111001100011111011010100000100100111111011101110111011110100011111000011010010111110100001001101011100100011111011101011100000110111111101000101001"
  1305. "111111110101010001111110100110100011010001111110100100111110111011001000111101000010011100010111110100101011100111111001100011110001011011110101111010000100001100110111101111110010110010010011100110111000101100001001110001111010000111101011010100011111000111101001111001001000011101000011010001000010111100110100110011111101100100001011111010010000001011110110011010001111001001111100111011010111110001110110101100110000111101111001000111101010110010011100000110010001011111001000111101001000010011110110000110111100010111101001010001001111000011101011111101100111111101000101001"
  1306. "111111110101010001010011110011110011100011010000110111001110001010001010000011001100011100100100111000101100111011000001110110010000110010000010100010000110011011011000001010011110111100010111000111000100100011011000010001001110000111010011110011101001100101100110000100001001101100000100011100100110011110100111001111001101000001000100001010100001100000110110001000001011001100111011100110011011100011100110100010011101110001100100111001111011011011000011000111001001001110001000111011110110011101000001001110100101000010000001100110000010010011101000110011110111111101000101001"
  1307. "111111110101010001111010010000100011000101110001000111100000101101101001001111010000011001000111001000110000101111001101101000001110010011101110111101000111111011110110101111101100101000011000100011101000111101000000101001000111011111101010001110101111100111101101110011001101101111000100011010011101000000111110100100110001111000011011010011001000111001000111010110001000001100100000011101011111010001000110110010011101000001111001001000010011111100100101110111100010000100101111010000110011011110010000010100110101110000010001001000111110110011110100100100000111111101000101001"
  1308. "111111110101010001010001001111000011110101111001000101011000011111001100001011111101010110001110111110111100100111101001110100111110010011001001111110100100001110100110001011001000011100011111101011101100100001110001001101111110010011001011001111001000110111100101111010001001110100011000010000001010111100110001000101111101111011110101111011010001101111110100011000010011101100111000101110010111001000000110101101110111110001001000110011111010001010111100000100011110010100001000010001001111011011111000010010100010011001111101100111101000110011110100111101000111111101000101001"
  1309. "111111110101010001010001111011110010100000010000010110111011110011101001101100001000011001000111011110101111011110100001101110011000100010000100110000110111110110100111101100010100110000010010111001110000110101000011000001110100100111000010100100000100000110110001000010001101111011110011010010001110111000111011100110011001010000011000110011011010000100000101111001111000101110111000101000011101100010000110111001101011000001100101110011110010011100111001000111101000010111101000100111011100010001001100110000111000101000111001100101100011100011010000110001110111111101000101001"
  1310. "111111110101010001110100111101110011111010011011100110011001111000101000111010011111011110110001101000111111010110111101001011111000110011110111001110100111101000110110001011000111110010010110111111011000110101111100111001001011111000110011111001001011000101001111000001001010011110100000010011011111100110101111000101111001111000001001010011110010001001000111111011101101101110001001110110011110000101101100100000101111001001010011111001100011111010100000110100111101101111101011101011111000010111100001011110111101001000000101111100001001011011101001110000110111111101000101001"
  1311. "111111110101010001111101000011101011000100010111110101101100011110001000111000100110010100101111000000101111100111001101011000001011100010000010001011110101000110001111101010000010011110011111100101100010100011110000101001000111000100110011100101001111110111111001011001001001010000011110011110001011110010110100111111000101001111010000010010110010000001110100011101100111001101110100000111011011101011100000100111010001100001101110010111000010100010011110000110011101011100001001110001101110011101010111111000110010110011111101100110010001111011110100011110100111111101000101001"
  1312. "111111110101010001110100000100111010100000110001100110010001000011001101001111011111010110001100001000110011011011000001111101111001011011001000100001100100101110001110001100100001001100010001011000001100100010000100000101101111001110100010000100100001000111110110100111101011100111001000011010010000110000111001100001011001000010000010001011110011010111000110010000010011001110011000010110010000010100100000100011011001000001001000000100100011100101000111000111010101110000001001000011011000011011110111100110110010001100011101110111001000001011001010001100000111111101000101001"
  1313. "111111110101010001111010001100110010011101111110100111110011011001101000111010011111011101000011101100100111010011111001100011011110100011000010000111010100011100101111101010111110011000011111000101011000111000000101100101111101101000010010000010001111010110101110000010001011110001011110010001000011110100100110111111011001111101100110011011100101110011000100001101111101001001011110100000011110100011011000101111101000111001010000011110100011111101010001110111001100111010001011110101111000011110001001101100111111010010011101110011011100100011110100010000010111111101000101001"
  1314. "111111110101010001111100101110100011011110000101100111010111110000101110001111010111010011011011110000110001001011111001110110111111010010011110001101100100011100100001101100100110111111011101011111101100111001111001011101001111000110011010111000001011000101100000100111001011011000011110010000100001011110110110011001111101010110111110000010010111001111110100001100100011101100111110010001010100000010011110110011100100111001111001011111011011011111000100100110001110100011101100011111001010010011110111001110111111010011001001111101001110001011100101001111110111111101000101001"
  1315. "111111110101010001100101100111000010001001110111000101100000110010001110110100000110011011011011000000100101110011100001011001111001110011100010010011100110110001110011101111001101001110011000100001000110110001000110011101110111101100100010011100001110100101000001101100001110110011001110011000101110111100111101111010100001110011011101111010100011001100000100000101110111001100010101100000011100110100011000111100111101000101101100100000100011110110010111000110001000100001101101100110110000011000011000100010100100111100111101010000010000010011101101001100000111111101000101001"
  1316. "111111110101010001111010000100100010011001001111110111101011100011101110010001100001011100100111011000111110110100010001101011111011100011000010011101000110111001111101001100100111000010011110001010001000110010011110001101110101111011100011000010111100110110010111100110001111101101010000010010011111101110111011101111010001111100001101001011111010000100110101110010001111101010011110001000010000110101111110110011100111110101101101111000100011101011101100000100001101111101001110101110011000011110111000111010111010001110011001000100111110011010100011111001100111111101000101001"
  1317. "111111110101010001101101000001111010110000100111000101101000000111001101110000101110011010110001111110101110010001100001001101001110000010110001100011110110000110101111001111101000011101010011000100001110101000100111100001110010011111001011101111101000110111101011110100001111010111100001010011110100001000101101000011100001000110001011100011110001011110100101000100111100001000001010001111010000001010011110110010100011111001111110010011010010110001000001110100100010000111101100111110110110010111001000011000101001100001111101101111001100111011100101111110110111111101000101001"
  1318. "111111110101010001110110100000110010001101100001000100111000011101001111001110100110010110011000010000100110110000010001001000011001100011000010100110000100010011011000001111010001001111011001110001100100110001001101110001101001110011110011001000110011100111011000100011001111011000010111010000110111101110100011000111001101010000011000110010010100001000000110011000001001001001100110000100010000010101000000100100001100001101000101100110000011000010001000110111011011001110001111011100001011011000110000101000110010000010001101001100000110100011100100110111100111111101000101001"
  1319. "111111110101010001110100000110010011110100000010100100011101111110101000111010111110011110110111001100110110111100010001101001110100000011111010010011000111100001101101001100100011100100011010000111001000110010011100000101111010110110000010001101111100010111101000101000001011101100111111010000101111000010111100010001000101001000011111011011111001011011100111101000000100101110100000110001011111000010010110111100111011101001111101101000010011111100101011100111110100110111001111001010000010010011100100111110111001011000010001111010110000110011111010000010110111111101000101001"
  1320. "111111110101010001111100100111001010000111000100110111111001001100101100111100100011011110010111101000100111010001100001000000101011110011000100010111110111101111010111101101000110111111010001100001001110110011100010111001011100100000011010010011001111100111101001111001001100100011111101010111100011001100101111001000010001010001100011111011011000001011110110110000100111101000001010001111011011010011110000110011000010111101111010111110110010111011100111100111001111010111001000010010011110011001010011111000110111010001110001110110101111100010110110000011110111111101000101001"
  1321. "111111110101010001011011100001100011010100001100000111010010011100001010010000010000011011000100001000110111101111001101001000111011100011101110011001100101000001100011001101101000010000010111100111100010111011100010100001110110001000011011100110101100000110010111001111001001110011100100011110100001011110110001001110111101100010100001100011001101100011000110110100001000001001100111101110011111011110100110110001110110010001001000001000001011100111010000100101000000100000101101110111100111010011011000010000110010001110111101101100010001000011101100100011000111111101000101001"
  1322. "111111110101010001111100101101110011000011011110100111100100001010001001100011111010010100111100000100101001111010000001001101111110011010111100010111100111100000100101001111001000100100011111101110110110111000100111011001111000010110110010000010111100100101001111100110001111101010000011010011110110111110101110101111100001011110000101111011110100100000010111110000100101101100100011110011010000101111101100110001101111001001110110011100100011110100001010000111110100110111001100110011110001010001110100111110111101100011010001111110101101111011111001010000110111111101000101001"
  1323. "111111110101010001011001100111100011011000100111100100000101101111101100101011111000011111100101100100100101000001111001111000101111001011010011111100010100111101000001001011001000000111010001110110011100110111010000011101101110101110000010011101000110000110111001011100001010001001111000011001110101110000100111000110111001110101011111100011001011001111110110011001000111101001010000111100010110001011100000111110100111010001000101100011111010111001000000110101100010111000001101001100111111011001001000111110101001011110000001011111001110011011101100101111100111111101000101001"
  1324. "111111110101010001100100010011000011011000100100000100011011110111001101000010110000010100000101000000110010100110000001110000110010011011111011110101100100010111011100001111001101011100011001000001001100111001100001011001000001010010000010001101100100000100100000010010001110010100011100011101010111000000100100001101100001101111011110011011001000110001110111011100100000101111011110010100011011100110100000100001101110110001001011111011111011101111011100110111100111001011001000110000110010011000111011000010110100111011110001000100011011000011011001110011100111111101000101001"
  1325. "111111110101010001001011110000100011100100011100110101110010001111101111010011001100011101101110001000110110011110000101001101111101000011111000110001010110111001111101001101000011110110011001101111000100110101110000001001111001001100011010010000111101000101000001111010001111110101000111011100110011101000101111010111100001111000100110110011111101001001110111001101110010001001100111110001011101011110111000111000110001110101001001111101100010010011110000010111110010100011001111100111011001011100001011000010111010000011101101010111100100000010010111100100000111111101000101001"
  1326. "111111110101010001001000010011110011100111100101110100111100011001101000010100001111011001100010111100110011111001010001100010111111001011101111100010110111010111111001101111010111110110010001111011101110110001110100111001100011000101111011110111010111110110010001001111101110011111001011010110100000111000100010000010111101000110100000111011111101001100100111110100111000101011100010001100011101110101111000110010010001111101001001000001111011101101011111000110110000100111101011100100000110011000101111110010100010001101111101001110010110000011100100011111010111111101000101001"
  1327. "111111110101010001001000111000111011000100011001110111011110110010001001110000111010010100000110110000111011001100111001100010111011110011001110011001000101100001100001001111011000100111011110010010111100111011100010000101111011001000111011010110111000000110010100001100001000010011000011011000011011001100110100000100110001001100011000010011001010001100000110000100100001101110111101100010011111001101011110100100001100001101001000010000100010110011100011000101001100011000001111011110100001010000100100001000110010000110011101110111011000011011001000010011000111111101000101001"
  1328. "111111110101010001111100100100011011001001111000110111010111101110001100001011110011011001011110011000111110110101000001001001111110111011101110111101000111110000110100101111101000010011010111001000111110111010001110011001110110111100110010110101111110000111101001100001101000001011110001011110010001000010111110110001010001110000001011010011100101110000110111001011000000101100010111001000011100101111011100100111101011110001110101100010000011111001000010110111001001111011101111110110100011011110011000110010110110000111101001001110111111001011110110110100000111111101000101001"
  1329. "111111110101010001100010100011111011011101000111000100010010011110001001100011001111010001101100011110110000111110100101010000110011111011000011111010100100010011011111001010001000011110010011110011000110101111000110001101111011011111010010111001000011000110010010011111001110000101111101010101110011111100111111000101100101111110100110001011111100101110110100010011011111001001100011011110010111101100000110101111011001100001111100010111001010100010111100000110100100011111001110111100101110010000111010001100111111010011001001010001000011110010110000110011110111111101000101001"
  1330. "000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001010000100010111001000100111000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1331. "000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110101111011101000110111011000111010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1332. },
  1333. /* 64*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231", "[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[97]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[98]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[99]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", 0, 32, 579, 1, "Example with CC-C 30 cols, 30 rows (max)",
  1334. "111111110101010001010100000100000010001110111000100111011111011101001100011100011010011111011010011110110100100110000001001100110100000011001100100100000100011000001101001011001100001000010001100001100010100001011000001101110111101101000010000010100001000100100001100110001011000111000011010011000001100010111011001000011001110110100000110010001010000001000100011000110000101100110000100001011110110101110000111011001000110001100100010110000011101100101100000100101110111000001100001011001110011000010000100110110010000100110001110011101000010010101111011110000111111101000101001"
  1335. "111111110101010001111101011011100011010001110000100111010001100010001010011111101110011111011001100110111010000011010001111010001000100011111101110110110111100110110010001111001011000011011110001000100010101110011011111101111110011010011011110000101000010111100100100001001110100111101110010001000111100100111101011101110001110101111000111011111101100101100100010011110100001110001000110010011111100010101110101101111100001001111001010000100011110101100110000111010000111011001111101100010100011000100011110110111111011010001101111101100000101011111010100001100111111101000101001"
  1336. "111111110101010001010111000111111010010111011111100100001101000011101111110110011101011101011111000100110110001001111001001110011001110010011000011011110111001111100101101110110001011111010010010111100000110001101011110001101110101110000010010110001111100101001011110000001101000100111110011100110100111110111010111110000101101110011001111011100100011111010110111111001100101010010011110000011101011111010000110011000101111001001001100011111010001110110001110111001110101111001110111111010010010000011010011100110111000101110001100111000101110011111101011001000111111101000101001"
  1337. "111111110101010001110100100111000010001001000001000100011000110100001010001100110000010010011001100000100110011000010001100111000110010011001010000110000111101111001101101110010100011100011001001110111100110111001101000001110011010000110010111011110110000100010110110000001101000000100011010001001111011110110110001100001101111011110100100011110010110111110111010011011110001101100010100000010001001100110000110110111100111101101000111011110010000100010000010110011000110011001000001000100001010110110000010000110110001100001101001001100110000011010011000011100111111101000101001"
  1338. "111111110101010001010111100100000010110000101111110111101011101110001010111110011000011010111111011110111111010110111101101000000111001010011010001111110110011011110001001111010010000010011110111011101000111000100000110101001100111111011010001000111100100110100111010000001110010110000100011010000011100010100001011110001001111000100001001011111011010000100110100111100110001110010001101000010000010111101000111111011010110001111011011000010010111000010111110111000001011010001110101100010000010010011111000110111011011100001001011011111010000011101011100000110111111101000101001"
  1339. "111111110101010001111110100110100011100010011111010101000001101111101101110010001110010100100001111000110010010011111001011100011000111011001111110110100111010111111001101111110100111011011101111100010110110001111101010001110100011111010011111101000011010111010011111101101011100100001100011011100010001110111101101111101001100100100111110010100011011111000100110110001111001111100001011101010011101000110000100101011110000001011000010000111010001111000100100111001010111111001011100100001100010100110111110000111001001111100101111110101100010011101011111101100111111101000101001"
  1340. "111111110101010001010011110011110010010111110111110111001101000110001100001010000110010010001100001100111100110010111001100101101110000011000011010001000111000111001010001110110000100110011110011110100100101000001100110001110110000010011011011001100001100110001011100111101000101101100000010110110000100000111010101110000001000011001100001010110011000010000100011000011000101000010110000011011101111011010000100000101000010001001000011001100010110001110000110100110000011000101110110010000110011101101000001100100010100000010001000110001100001011101000110011110111111101000101001"
  1341. "111111110101010001111010010000100010011001001111110111010000111001101111001011100111011001011100000010111001011000001001111101000010011010011001111100010111100011001101001110110111000100010111000111111010110100011100001001110100011000100010100111111011100111110110011001101110100000110100011110100010001000111111011101101101111001101100100011110010110000110111100010001000101011100110111111011111100110100110111100001010000101111001001000010011110100110001100111100010011011001000010011111011010100000111100100111101001110011101111110001101011011110100100100000111111101000101001"
  1342. "111111110101010001010001001111000010111101000000100110000011101011101111100100111010011100010111110100100111000001011001101110000010111010001111010100000110111000100011101010001110111111011011110100110000111111000101101001000110101110000010111100010100000111010111110001001101100010011110010011100110011100100110000110111101110011111001011011101100010111110100100101111000001100011010111100011011101011100000100101100011111001010010111100000011010001001111100111001101001111101110101111100001011011100110011110111001000111110101101111110011001011110100111101000111111101000101001"
  1343. "111111110101010001010001111011110011110100110111110111110100101111101110011011001110010110110000100000100001001110111001101110111100111011000011010000010111101111001101101100010011000111010011000011001000100010010000010001000110001101000010100011001100000100100110011000001001100110000100011001110001100100110010100001100001111011110011011011100101000111000110010011101111001101110011010000011100110100001100111101110101100001010111000111000010000101000010000100010110001100001011001100100000011101011011110000101100111100011101000011011000001011010000110001110111111101000101001"
  1344. "111111110101010001110100111101110011110100011011000111011000111101101100011001111010011100100110010000100010111110011001111001100110001011100010011000010111100001101101001100100111001000011010001111011000111100000110110101000111010111110011110000010110110110101111110111101111110101101111011010000001110010100110100011111101100110111100010011110100100000100111101110111010001110001000001101010011001111110110100010001111001001101001110100000011100101100001000110100000111000101000010111100010011110001000010010111110110100001001101001111001100011101001110000110111111101000101001"
  1345. "111111110101010001111101000011101010111010001100000100111110110001001001000010111100010110000010011100100111101000010001100111110100001011010110001111110100110110001111001000101000001111011001101001111000111000100111110101010000011011111011011100100011100101001000011110001100100100111110010111000110001110110011111101101001110101111110011011111101001110110111011111000101101000011100010110011100101001111110101111110011100101101100100001111011001110001001110101111000001101101001110100000011010011110110110000110110000010111101111010001111010011110100011110100111111101000101001"
  1346. "111111110101010001110100000100111011000010100000110110101110001111001101001101110000010110000110001000101110011100010001011100011110011011001100100001000110110000100001001001001100001100011110101100111110100101111101111101110011010001100011000010100001100100100011000011001111001100101110011001011011100000110000110100010001110001110010100011101100001001100111100111101001001010000011001100011101100000100110110110011000011001100010111001111010001011011000000101101100001000001110101011100000010000110011000010101100110000100001000110000110001011001010001100000111111101000101001"
  1347. "111111110101010001111010001100110011111101110010100110000100111001001110000010111011011011011110001000110010011110110001100010001110010011001011100001000111110100000101101110110011100001011100111011110010100110010011111101110100001110011011110010111001110110010111000000101110010110000010011111010000100110100110011111000101111000110011010011110010100100000111010001100100001111101001000011011111010010110000111111001001011101110100011110111011110010100000010111110011011001101111101100010010010001011110001000110010001110100001111010001110111011110100010000010111111101000101001"
  1348. "111111110101010001111100101110100010111000110111000111110001011101001100011100010111011110010111100100111010010111111001011000011011110010111001110111100110110010011110001111110100011010011011111010000010101111010000001001100000111010111011111001001110100111000101111101001001110000010110011011100000101110100011110101000001101110001000111010100011101111110110111101001100001111110001011010010001101011100000101111000101000001110101111100010011011000100111100100111001100111001001100001101111011100111110010110111011000101111101001001011110000011100101001111110111111101000101001"
  1349. "111111110101010001100101100111000011100110011001110100100000010010001110010100111000010100100000010000101000110001100001101100001010000011101001000111000100110110000100001110010001000111011100011101101100111101001101111101111101001011111011100110110011100101101100001000001000010011101110011011101111001110100110000011010001110001110011011011010011000111000111011010000110001111101110101110010001110011101000101001000001000001010011110011110010111101111010000111001111011001001010000100010000010100001100110000101000100000010001100110110110000011101101001100000111111101000101001"
  1350. "111111110101010001111010000100100010110001111110110111100101001000001010000111110110011010011100010000100100111110001101110001011001000010001011111101110111101000100000101111001001001000010000110111110010111101000110110001110110001111011011000110011110100111001001100100001000101111100110011110011001100010111000100110000101111000011011010011001001110010000110100011110110001111000001101101010001110101111100111100000101101101101011111101111011111101011011110110100000011100101001101000111111011001101111000100111101001000001001111011101110100010100011111001100111111101000101001"
  1351. "111111110101010001101101000001111010001110111011110101111000010001001011110001100011011010001001111100101100100001110001111110010011001011011111010010000100000101000111101011000111011111011101000111110100101110100011000001001111101100010010010000101111000101100000100111001101110100111000010011111011000010100111100110011001011110111001110010010001101111100101100100000111001100101111110010011011110000101100101111100111011001100010100011111011001111010001100111111001011000101001010001111000011111010000111010111101110101111101011011000011110011100101111110110111111101000101001"
  1352. "111111110101010001110110100000110011101000001011100111011100011001101111001100010111010110111110011110110111000111001101110001101001100011110111001011000110011101100100001110110001001100011010000100110000110000101000001101101011100011110011010011011100000101100001100010001011100111000100010111000111100110110011001000010001101100001000010010010011000011000111101011001111101001011111011111011100110100011000110000101000011001001000110000110011110011001011100110010110111000001100001101000100011100011100101000111011000010011001111001111010010011100100110111100111111101000101001"
  1353. "111111110101010001110100000110010011110100011000110111110010001011001001011111001100010010001111001000110010001110100001111010000001010011111010101100000101111100101110001100101111101110010000100001111010111111011100101001100011011110100010111110000101110111101011011000001001100100111111011100010011001000111101000001101101001011111000011011110100000010100111100010000010101000101111101100011110000110110010101111010001111001001000011110010011110001000100100110010000111010001111100111011001011110100110000110111110010101100001100010111000100011111010000010110111111101000101001"
  1354. "111111110101010001111100100111001010000111010000110100101110011111101000001101001110011111100101110110110010011111100101000010001011110011101110010111100100001001101111101110011001011111010010110111110000101110001101110001111100010111010011000111000101110111100101111001001110100101111110010110000110111100101110011101111001101100100111100011111101000110100110111110100000101011110100000010011000001110101110111110010011101001110001011111010010011100000101100110111000001011101000111101010000011011100010001110101000111011111101101111010011000010110110000011110111111101000101001"
  1355. "111111110101010001011011100001100011011000110011000110011001100110001100110000010001011010010001100000100100010000001001110111000101000011110111010011000100001101101000001101100110000110011110110100111000100100001010000001000010011100111011110101001111000100100011101110001010000100010000011110001010111100100000101100110001001000110011000011110110001001110111001110100000101011110001111001011010110001110000110010000010011001011000110010000010110001111001110111011000001001101110100000101110011110001001011110110100110001110001110110100001100011101100100011000111111101000101001"
  1356. "111111110101010001111100101101110011101100001110100100111110110111101110101111001110011110100100100000111100111011100101000000101111010011010011110011000110100111110011101111101001100111011111011000110110101100011111101101111001010010000010100001111101100110100111000100001001001111100011011100010110010000100010111111011101111010001000001011110010010010000100001101111100101111010001101100011101100011110110110001100111101001110010011001000010001011111001100111100110011000101110001001100001011110000110110100110010011100100001101000111101100011111001010000110111111101000101001"
  1357. "111111110101010001011001100111100011000111110100100100111110011001001000111100101000010100110011111000101011001111100001111100100111001010011101101110000101111010000010001101110010001110011110111101011110101111101110001101001100100111000010111101111011110110110001011110001000011100101100010111100001000010101111101110011001100011110010011011100010111110100111001101011111001011110001000100010010001000011110110010010001111101100110010111100010011110000100100111011110010011101101101000011110010110011001111000100100011011111001011001000001110011101100101111100111111101000101001"
  1358. "111111110101010001100100010011000010010111011100000110000101100111001100001000010011011001000010011000111001110100001001100101001100000010100000110110000110100001100011101011000001100010011110010010111100111010000010111001110111000110011011110011000101110101101111100111101101110001110011011100011010011000111101110010110001100111011001000011101100010011000110100001001100001100001010000011011010111000111100110100110111000001011000011000100010111001110001000101110001111001101100110010000100011011000010000100100100110000110001111010110011111011011001110011100111111101000101001"
  1359. "111111110101010001001011110000100011101000011101100111110110001010001100010001111011011111101101000110111110110000010101010001111001000010011000111110010100000100111100101101011110110000010010111110001100101110101111100001110110000111001011100000100110010100101111100110001101000011110110011100010110000010111110010001001101101000111000001011010111100011000110100111010000001001001111001000011101011110111000111011000111000101001011110000100010000110011111010110101111000011001110101110000110011110010000110110111101000000101001111000100000101010010111100100000111111101000101001"
  1360. "111111110101010001001000010011110011100111010111100111011111101001001000001101001110011011100010111000110011100010111001011100110001110010011110001101100110100010111110001111101101111001010001101000011100100001110100001101001011100111111010000011010011100111111001011101101100100111111001010000100010111100111011100101111001000010011011111011100110010111110100101101111100001011100011011100011111000101110100110001110001011101111001011110010011101001011111100101100001101111001011100111011110011011001001111000111111010001101001101111101000001011100100011111010111111101000101001"
  1361. "111111110101010001001000111000111011001100011001100100000100010000101011011000001000011011000110000110101101111101111001010000011001100011011000100100000100001001100110001010011100111000011010110011100000111001001101111001111011100100110010111001110010000111101000100111101100110000110011010001101111001110100001011000011001100001010000011010100011000110000100100111100111101111011011001111010011101110010000111000110100001101001000111011100010100001000100000111100010101111001000001011001100010010001100110000111101100010011101110011101000001011001000010011000111111101000101001"
  1362. "111111110101010001111100100100011011100000101101000111010110001000001001001111100011011101101110000100101101111101000001111100100010110011110100010001000111101100011010001110101111101111010100001111101100111011000011101001001111101101111011101011110011100111101001001000001111001110111001010000001011110100110100111100110001101001111100111011111010011001110111110110001101101011000111111011011110010100100000101000011111011001101001110001000010010011111000110111000101100100001000101111110111011111010001011000100101111000010001111110011101010011110110110100000111111101000101001"
  1363. "111111110101010001100010100011111011011000001011110110011101000011101110101111101000010011110110110000110001110100111001100011111010001011100100101111110100011110110011001100111010111000011011111010001000110011111010001001010110011111000010011111001101000101111100011001001110110101111100011001101011110000110001111010110001110111101000111010010111001111110100111000000101101111110101101000010111100100100000110001110010011101101011111100010010011110000010010100001110100001101000001110010110010001110001101110100111010001100001110110111111001010110000110011110111111101000101001"
  1364. "000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001010000100010111001000100111000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1365. "000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110101111011101000110111011000111010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1366. },
  1367. /* 65*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123", "[20]12", 0, 5, 205, 1, "Example with min CC-C input and smallest linear input to bump rows (2 to 3), CC-C 8 cols, 3 rows",
  1368. "1111111101010100011101010111000000111010110011110001110111110111010010000010000100010111010011011110001001100111101110010000110111001100111000101101111001000101110111000011101010001110000111111101000101001"
  1369. "1111111101010100011110101000010000111010111011000001111110111001010011111001000100110111000000100110101100100111000001011111010001101110110101110001000001111010100001000011111010101100000111111101000101001"
  1370. "1111111101010100011101010001111110100010100011110001111101011100001011000011001011110100101001111000001011111011010000011101111110010100110111100010001101011001001110000010101000011110000111111101000101001"
  1371. "0000000001011000110000101000100110010011010011000110111010011100011101001001111010110010000100101001100011001001110010010000100101001100011010000100010011010001100010100001001000100010011100010100000000000"
  1372. "0000000110100111001111010111011001101100101100111001000101100011100010110110000101001101111011010110011100110110001101101111011010110011100101111011101100101110011101011110110111011101100011101011000000000"
  1373. },
  1374. /* 66*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]12", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, "Example with overlarge linear input and min CC-C input, CC-C 30 cols, 3 rows (bumped up from 1)",
  1375. "111111110101010001110101011100000010100010000010000111011111011101001000001000010001011101001101111000100110011110111001000011011100110011100010110111100100010111011100001010111000111000010000101100000110100100000010010001100001100010100011011000111001110110010011101111001000101111011110010100001110001110100011000011010001101111011100010010100110001100000101100011110111001111011110101000010000010001101100100011011001000001110101101111000010001100011100110111011010110000001110111010000100011000010110001110110100001000011001000010010000001010101111011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1376. "111111110101010001111010100001000011110011011000100111100000100010101110010001100001011101011101100000111111011100101001111100100010011011100000010011010110010011100000101111001010000001010110011111001000111111010001011101110001100011101011111000110010100110101111101110001110010011110111011100011011101000110111110010111101110111001111001011110101101100000110011101111100101101000011100100011011000011110010100010001111101101010011110000100010011000111110100111100110110001001111000001000101011100100011000010111010111011000001111110111001010011111010101100000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1377. "111111110101010001010111000111111011011101011100000110001111101000101100010111111001011001001111110010100010001001111001101000001011111011100011110101110110111110011001101101001000111110010011010011100000101111101100000101000000110010111010000110110111100110101101111110001011111000111011010110100001110000101110000100110001101111000010011010100110001111100110101100111111001001010011110000011110101111001000110101000111110001000110001001110010100011001111100100000111001001101000110011011110010011010000111000110111111001101001110101111101000010101000011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1378. "000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010000101000100001001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011101000010001001100110010011100010100"
  1379. "000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101111010111011110110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100010111101110110011001101100011101011"
  1380. },
  1381. /* 67*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]01[90]123456789012345678901234567890[91]123456789012", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, "Example with overlarge linear input and medium CC-C input, CC-C 30 cols, 3 rows (bumped up from 1 (before last digit) than 2)",
  1382. "111111110101010001110101011100000010100010000010000111011111011101001000001000010001011101001101111000111000101000111001100100011101111010001011000001100101100000110000101101101100110000011010010000110000110000100011011101001110011101000011110111011011100111101100010011101111001001011110011101110001000010111000101001110001011000001100010011010010011000000110011100001101001100011011000011011101110001010000110100001000001101010011000110000010110001111011100111101111010100001000001000110110010001101100100000111010110111100001000110001110011010101111011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1383. "111111110101010001111010100001000011010000111001000110110000111100101000100011111011010100111100001000100110001111101001111001101100010011110000010001010111001000110000101110101110110000011111101110010100111110010001001101110000001001101011001001110000010111100101000000101011001111100100011111101000101110111000110001110101111100011001010011010111110111000111001001111011101110001101110100011011111001011110111011100111100101111010110110000011001110111110010110100001110010001101100001111001010001000111110110101001111000010001001100011111010011111010101100000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1384. "111111110101010001010111000111111010001100110111100101111110111000101001100101110000010101110011111100101111000010000101101110101110000011000111110100010110001011111100101100100111111001010001000100111100110100000101111101110001111010111011011111001100110110100100011111001001101001110000010111110110000010100000011001011101000011011011110010101000011110000101001100011111001101011001111110010010100111100000111111010011010001000110101110000011101111100100110110100011011111101100111110100001011001111100001010100001010011110001101011111100010010101000011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1385. "000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010000101000100001001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011101000010001001100110010011100010100"
  1386. "000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101111010111011110110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100010111101110110011001101100011101011"
  1387. },
  1388. /* 68*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[20]01[90]123456789012345678901234567890[91]1234567890123", ZINT_WARN_NONCOMPLIANT, 5, 702, 1, "Example with overlarge linear input and medium CC-C input, CC-C 30 cols, 3 rows (bumped up from 2)",
  1389. "111111110101010001110101011100000010100010000010000111011111011101001000001000010001011101001101111000111000101000111001100100011101111010001011000001100101100000110000101101101100110000011010010000110000110000100011011101001110011101000011110111011011100111101100010011101111001001011110011101110001000010111000101001110001011000001100010011010010011000000110011100001101001100011011000011010111001111001100110100000100110001010011000110000010110001111011100111101111010100001000001000110110010001101100100000111010110111100001000110001110011010101111011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1390. "111111110101010001111010100001000011010000111001000110110000111100101000100011111011010100111100001000100110001111101001111001101100010011110000010001010111001000110000101110101110110000011111101110010100111110010001001101110000001001101011001001110000010111100101000000101011001111100100011111101000101110111000110001110101111100011001010011010111110111000111001001111011101110001101110100011011111001011110111011100111100101111010110110000011001110111110010110100001110010001101100001111001010001000111110110101001111000010001001100011111010011111010101100000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1391. "111111110101010001010111000111111010001100110111100101111110111000101001100101110000010101110011111100101111000010000101101110101110000011000111110100010110001011111100101100100111111001010001000100111100110100000101111101110001111010111011011111001100110110100100011111001001101001110000010111110110000010100000011001011101000011011011110010101000011110000101001100011111001101011001111110010010100111100000111011110001011101101111000001011010111100000100010110100100011111001011101000011000010001101011100000101111110001110101011110110011000010101000011110000111111101000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  1392. "000000000101100011000010100010011001001101001100011011101001110001110100100111101011001000010010100110001100100111001001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010000101000100001001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011001000010010100110001101110100111000111010010011110101100100001001010011000110111010011101000010001001100110010011100010100"
  1393. "000000011010011100111101011101100110110010110011100100010110001110001011011000010100110111101101011001110011011000110110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101111010111011110110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100110111101101011001110010001011000111000101101100001010011011110110101100111001000101100010111101110110011001101100011101011"
  1394. },
  1395. /* 69*/ { BARCODE_GS1_128_CC, -1, 3, "[90]1234567890123456789012345678", "[20]01", 0, 5, 239, 1, "Example with linear input length triggering difference between new (BWIPP) 52 and old 53 adjustment",
  1396. "11111111010101000111010101110000001101011101111000011101111101110100100000100001000101110100110111100010110000011001000110001000110111001010000100001000010010111100111100101011100011100001000010110000011010101000001000000111111101000101001"
  1397. "11111111010101000111101010000100001111100100010011011100000010011010110010011100000101111001010000001010110011111001000111111010001011101110001100011101011111000110010100110101110001000001111010100001000011111010101100000111111101000101001"
  1398. "11111111010101000110101000011111001010011000111110011010110011111100110111110010001001100001111010110010111111011110110110110001011110001110010111110010011110101111100110101110011000011101100110100001111010101000011110000111111101000101001"
  1399. "00000000010110001100001010001001000010010100110001101110100111000111010010011110101100100001001010011000110111010011100011101001001111010110010000100101001100011011101001110001110100100111101011010000100010010000100100111000101000000000000"
  1400. "00000001101001110011110101110110111101101011001110010001011000111000101101100001010011011110110101100111001000101100011100010110110000101001101111011010110011100100010110001110001011011000010100101111011101101111011011000111010110000000000"
  1401. },
  1402. /* 70*/ { BARCODE_GS1_128_CC, -1, 3, "[01]12345678901231[90]123", "[20]12", 0, 5, 205, 1, "Example with 8 cols, left/right padding of linear (BWIPP)",
  1403. "1111111101010100011101010111000000111010110011110001110111110111010010000010000100010111010011011110001001100111101110010000110111001100111000101101111001000101110111000011101010001110000111111101000101001"
  1404. "1111111101010100011110101000010000111010111011000001111110111001010011111001000100110111000000100110101100100111000001011111010001101110110101110001000001111010100001000011111010101100000111111101000101001"
  1405. "1111111101010100011101010001111110100010100011110001111101011100001011000011001011110100101001111000001011111011010000011101111110010100110111100010001101011001001110000010101000011110000111111101000101001"
  1406. "0000000001011000110000101000100110010011010011000110111010011100011101001001111010110010000100101001100011001001110010010000100101001100011010000100010011010001100010100001001000100010011100010100000000000"
  1407. "0000000110100111001111010111011001101100101100111001000101100011100010110110000101001101111011010110011100110110001101101111011010110011100101111011101100101110011101011110110111011101100011101011000000000"
  1408. },
  1409. /* 71*/ { BARCODE_EANX_CC, -1, 1, "123456789012+12", "[91]123456789012345678901", 0, 8, 125, 1, "Example of EAN-13 with 2-digit addon, CC-A 4 cols, 4 rows",
  1410. "11010010001111001101001110010111011100010000100100011010111011100100000110000010011011101110110010100000000000000000000000000"
  1411. "11010110001110101100100000011001111010111110100100001011001011110110000110010011100000101100110010100000000000000000000000000"
  1412. "11010111001110101111101000011111100110111010101100001011111010111100110100110100111000001101110010100000000000000000000000000"
  1413. "11010111101000110011000010010000101110001110101110001010001110011100010110100010001100001101111010100000000000000000000000000"
  1414. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  1415. "00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000"
  1416. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  1417. "00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110011001010010011"
  1418. },
  1419. /* 72*/ { BARCODE_EANX_CC, -1, 1, "123456789012+54321", "[91]1234567890", 0, 7, 152, 1, "Example of EAN-13 with 5-digit addon, CC-B 4 cols, 3 rows",
  1420. "11011011101111001101001110010111011100010000100111010010111011100100000110000010011011101101100010100000000000000000000000000000000000000000000000000000"
  1421. "11011011001111110101001110011111000100100110100110010011010001110001000100101111110011101100100010100000000000000000000000000000000000000000000000000000"
  1422. "11011010001010000010111100011100111100101110100110011011001111101001000100111110110100001110100010100000000000000000000000000000000000000000000000000000"
  1423. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
  1424. "00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000"
  1425. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
  1426. "00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110111001010100011010100001010010011010011001"
  1427. },
  1428. /* 73*/ { BARCODE_UPCA_CC, -1, 1, "12345678901+12", "[91]123456789", 0, 7, 127, 1, "Example of UPC-A with 2-digit addon, CC-A 4 cols, 3 rows",
  1429. "1101101110111100110100111001011101110001000010011101001011101110010000011000001001101110110110001010000000000000000000000000000"
  1430. "1101101100111001110011110101100001000111001010011001001110101100100000010010111111001110110010001010000000000000000000000000000"
  1431. "1101101000100001111001000101011110100000010010011001101000111000010110011011100010001110111010001010000000000000000000000000000"
  1432. "0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000"
  1433. "0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000"
  1434. "0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000"
  1435. "0001010011001001001101111010100011011000101011110101010001001001000111010011100101100110110110010100000000010110011001010010011"
  1436. },
  1437. /* 74*/ { BARCODE_UPCA_CC, -1, 2, "12345678901+12121", "[91]1234567890123", 0, 8, 154, 1, "Example of UPC-A with 5-digit addon, CC-B 4 cols, 4 rows",
  1438. "1101001110100011111010011101101111110101110010011101101101000011110110011001011100001000110100100010000000000000000000000000000000000000000000000000000000"
  1439. "1101001100101100100111000001011111011000001010011101001101111110011010011101001111100100110101100010000000000000000000000000000000000000000000000000000000"
  1440. "1101000100111001101000011001100100000101100010011001001001111011110100011100011101000100110101110010000000000000000000000000000000000000000000000000000000"
  1441. "1101000110110001011100000101110110111001000010011001101111100010101100011110001001010000110101111010000000000000000000000000000000000000000000000000000000"
  1442. "0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
  1443. "0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000"
  1444. "0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
  1445. "0001010011001001001101111010100011011000101011110101010001001001000111010011100101100110110110010100000000010110011001010010011010110011010011011010011001"
  1446. },
  1447. /* 75*/ { BARCODE_UPCE_CC, -1, 1, "0654321+89", "[91]1", 0, 9, 81, 1, "Example of UPC-E with 2-digit addon, CC-A 2 cols, 5 rows",
  1448. "110110011011110111010111110101000100011110001111010100100000000000000000000000000"
  1449. "110110111011101100001000110111001010111000001110010100100000000000000000000000000"
  1450. "110110110011000101111101110111101000010010001110110100100000000000000000000000000"
  1451. "110110100010011101110011110111001111010111001110100100100000000000000000000000000"
  1452. "110100100011001100100000010111010001101111001110100110100000000000000000000000000"
  1453. "000100000000000000000000000000000000000000000000000001000000000000000000000000000"
  1454. "001000000000000000000000000000000000000000000000000000100000000000000000000000000"
  1455. "000100000000000000000000000000000000000000000000000001000000000000000000000000000"
  1456. "000101000010101100010011101011110100110110011001010101000000010110110111010010111"
  1457. },
  1458. /* 76*/ { BARCODE_UPCE_CC, -1, 2, "1876543+56789", "[91]12345", 0, 12, 108, 1, "Example of UPC-E with 5-digit addon, CC-B 2 cols, 8 rows",
  1459. "110010001011101111101110100100000100001000101100100010100000000000000000000000000000000000000000000000000000"
  1460. "111010001011010000111101100110010111000010001110100010100000000000000000000000000000000000000000000000000000"
  1461. "111011001011101100100111110100011110010000101110110010100000000000000000000000000000000000000000000000000000"
  1462. "110011001011001110110001000101011111011111001100110010100000000000000000000000000000000000000000000000000000"
  1463. "110111001011111001001101110100111111010011001101110010100000000000000000000000000000000000000000000000000000"
  1464. "110111101011001110000101110100110100001110001101111010100000000000000000000000000000000000000000000000000000"
  1465. "110011101010100010000010000101111011111011001100111010100000000000000000000000000000000000000000000000000000"
  1466. "111011101010111100101111000101111000100111101110111010100000000000000000000000000000000000000000000000000000"
  1467. "000100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
  1468. "001000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000"
  1469. "000100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
  1470. "000101011011100100010000101011000101000110100001010101000000010110110001010101111010010001010110111010010111"
  1471. },
  1472. /* 77*/ { BARCODE_EANX_CC, -1, 1, "9876543+65", "[91]1234567", 0, 8, 98, 1, "Example of EAN-8 with 2-digit addon, CC-A 3 cols, 4 rows",
  1473. "10010001111100110101001100011100010111001100110001011101000001110100110100000000000000000000000000"
  1474. "11011111100110100101011100011011110010110000111100010011110101110101110100000000000000000000000000"
  1475. "10000101100000110101011000010101111101111100111010010000111001110101100100000000000000000000000000"
  1476. "11110010001100110101001000011001001111101110101001111100011001110101000100000000000000000000000000"
  1477. "00001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  1478. "00010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000"
  1479. "00001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  1480. "00001010001011011011101110110101111010101001110101110010000101110010101000000010110101111010111001"
  1481. },
  1482. /* 78*/ { BARCODE_EANX_CC, -1, 2, "9876543+74083", "[91]123456789012345678", 0, 12, 135, 1, "Example of EAN-8 with 5-digit addon, CC-B 3 cols, 8 rows",
  1483. "110011101011101111101110100100001011010000010000100010111110110100111101100111010100000000000000000000000000000000000000000000000000000"
  1484. "111011101011001011100001000100001001011100101100100000111000110111010001110111010100000000000000000000000000000000000000000000000000000"
  1485. "111001101011011111100110100100001101010100010111100000110010011011111101110011010100000000000000000000000000000000000000000000000000000"
  1486. "111101101011101101000011000100011101011000011011001100111001101001100001111011010100000000000000000000000000000000000000000000000000000"
  1487. "111100101011101101110010000100011001011101110111100100101001111000010001111001010100000000000000000000000000000000000000000000000000000"
  1488. "111000101011111101011000100100010001011100101111110110100111100001101101110001010100000000000000000000000000000000000000000000000000000"
  1489. "110000101011110010001011110100110001011100111100110010100111000111001001100001010100000000000000000000000000000000000000000000000000000"
  1490. "110001101011001100111101000100111001011111011110111010101110011111100101100011010100000000000000000000000000000000000000000000000000000"
  1491. "000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
  1492. "000000000000010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000"
  1493. "000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
  1494. "000000000000001010001011011011101110110101111010101001110101110010000101110010101000000010110111011010011101010001101010110111010100001"
  1495. },
  1496. /* 79*/ { BARCODE_EANX_CC, -1, 1, "1234567890128+65", "[91]1234567", 0, 7, 125, 1, "Example of EAN-13 + CHK with 2-digit addon, CC-A 3 cols, 4 rows",
  1497. "11011011101111001101001110010111011100010000100111010010111011100100000110000110010100001101100010100000000000000000000000000"
  1498. "11011011001001100101111110011111011001000010100110010011111101110010100110101110001000001100100010100000000000000000000000000"
  1499. "11011010001101011111100100011011101000011100100110011010001001001111000101000011011111001110100010100000000000000000000000000"
  1500. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  1501. "00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000"
  1502. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  1503. "00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110101111010111001"
  1504. },
  1505. };
  1506. const int data_size = ARRAY_SIZE(data);
  1507. int i, length, composite_length, ret;
  1508. struct zint_symbol *symbol = NULL;
  1509. char escaped[1024];
  1510. char esc_composite[4096];
  1511. char bwipp_buf[32768];
  1512. char bwipp_msg[1024];
  1513. int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
  1514. testStartSymbol("test_examples", &symbol);
  1515. for (i = 0; i < data_size; i++) {
  1516. if (testContinue(p_ctx, i)) continue;
  1517. symbol = ZBarcode_Create();
  1518. assert_nonnull(symbol, "Symbol not created\n");
  1519. length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  1520. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  1521. strcpy(symbol->primary, data[i].data);
  1522. composite_length = (int) strlen(data[i].composite);
  1523. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  1524. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  1525. if (p_ctx->generate) {
  1526. printf(" /*%3d*/ { %s, %s, %d, \"%s\", \"%s\", %s, %d, %d, %d, \"%s\",\n",
  1527. i, testUtilBarcodeName(symbol->symbology), testUtilInputModeName(data[i].input_mode), data[i].option_1,
  1528. testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), testUtilEscape(data[i].composite, composite_length, esc_composite, sizeof(esc_composite)),
  1529. testUtilErrorName(ret), symbol->rows, symbol->width, data[i].bwipp_cmp, data[i].comment);
  1530. testUtilModulesPrint(symbol, " ", "\n");
  1531. printf(" },\n");
  1532. } else {
  1533. int width, row;
  1534. assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
  1535. assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
  1536. ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
  1537. assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
  1538. if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
  1539. if (!data[i].bwipp_cmp) {
  1540. if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment);
  1541. } else {
  1542. ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
  1543. assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
  1544. ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
  1545. assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
  1546. i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
  1547. }
  1548. }
  1549. }
  1550. ZBarcode_Delete(symbol);
  1551. }
  1552. testFinish();
  1553. }
  1554. static void test_odd_numbered_numeric(const testCtx *const p_ctx) {
  1555. int debug = p_ctx->debug;
  1556. struct item {
  1557. int symbology;
  1558. int option_1;
  1559. char *data;
  1560. char *composite;
  1561. int ret;
  1562. int expected_rows;
  1563. int expected_width;
  1564. char *comment;
  1565. char *expected;
  1566. };
  1567. /* Verified via bwipp_dump.ps against BWIPP, and manually against tec-it.com */
  1568. static const struct item data[] = {
  1569. /* 0*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]1234567890123", 0, 9, 55, "Test odd-numbered numeric, 1st fit, 9-bit remainder, 7-bit final, 2-bit alphanumeric latch, no padding",
  1570. "1101100110111011101011110001001111100110010011110101001"
  1571. "1101101110110001100001000101100010000100110011100101001"
  1572. "1101101100111110001001001101100100111110111011101101001"
  1573. "1101101000110101100011111101100111110100100011101001001"
  1574. "1101001000110111000110001001010001100001100011101001101"
  1575. "0001000000000000000000000000000000000000000000000000010"
  1576. "0010000000000000000000000000000000000000000000000000001"
  1577. "0001000000000000000000000000000000000000000000000000010"
  1578. "0001010010011011110101000110111001000010100100010101010"
  1579. },
  1580. /* 1*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]12345678901234", 0, 9, 55, "Test even-numbered numeric, 1st fit, 2-bit remainder, 2-bit alphanumeric latch, no padding",
  1581. "1101100110111011101011110001001111100110010011110101001"
  1582. "1101101110110001100001000101100010000100110011100101001"
  1583. "1101101100111110001001001101100100111001000011101101001"
  1584. "1101101000101000010011110001101101001111000011101001001"
  1585. "1101001000100011101110010001011100011101000011101001101"
  1586. "0001000000000000000000000000000000000000000000000000010"
  1587. "0010000000000000000000000000000000000000000000000000001"
  1588. "0001000000000000000000000000000000000000000000000000010"
  1589. "0001010010011011110101000110111001000010100100010101010"
  1590. },
  1591. /* 2*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]123456789012345", 0, 10, 55, "Test odd-numbered numeric, 2nd fit, alphanumeric latch, padding",
  1592. "1100100010111100110100111001011101110001000011100101101"
  1593. "1110100010110001011101000001000111010111110011000101101"
  1594. "1110110010110101100111111001000111100001001011000101001"
  1595. "1100110010100100000010010001010000010000100011001101001"
  1596. "1101110010111111010101110001110101110000110011011101001"
  1597. "1101111010110000111101001101100011110110111011011001001"
  1598. "0001000000000000000000000000000000000000000000000000010"
  1599. "0010000000000000000000000000000000000000000000000000001"
  1600. "0001000000000000000000000000000000000000000000000000010"
  1601. "0001010010011011110101000110111001000010100100010101010"
  1602. },
  1603. /* 3*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]ABCD12345678901", 0, 10, 55, "Test odd-numbered numeric, 1st fit, 4-bit final, no alphanumeric latch or padding",
  1604. "1100100010111100110100111001110101110111110011100101101"
  1605. "1110100010101111100110111101111000001000101011000101101"
  1606. "1110110010110111100001001101101000111111001011000101001"
  1607. "1100110010101000110011000001111101101011110011001101001"
  1608. "1101110010110101111000011001111000001001010011011101001"
  1609. "1101111010100010000010111101011100000100011011011001001"
  1610. "0001000000000000000000000000000000000000000000000000010"
  1611. "0010000000000000000000000000000000000000000000000000001"
  1612. "0001000000000000000000000000000000000000000000000000010"
  1613. "0001010010011011110101000110111001000010100100010101010"
  1614. },
  1615. /* 4*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]ABCDE123456789", 0, 10, 55, "Test odd-numbered numeric, 1st fit, 5-bit final, no alphanumeric latch or padding",
  1616. "1100100010111100110100111001110101110111110011100101101"
  1617. "1110100010101111100110111101100000100011101011000101101"
  1618. "1110110010100110000010111001111101011110011011000101001"
  1619. "1100110010100011000110000101111101110101110011001101001"
  1620. "1101110010110100011111011101000111100101111011011101001"
  1621. "1101111010110111101000110001100011001011110011011001001"
  1622. "0001000000000000000000000000000000000000000000000000010"
  1623. "0010000000000000000000000000000000000000000000000000001"
  1624. "0001000000000000000000000000000000000000000000000000010"
  1625. "0001010010011011110101000110111001000010100100010101010"
  1626. },
  1627. /* 5*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]1234567890123456789", 0, 10, 55, "Test odd-numbered numeric, 1st fit, 7-bit final, no alphanumeric latch or padding",
  1628. "1100100010111100110100111001011101110001000011100101101"
  1629. "1110100010110001011101000001000111010111110011000101101"
  1630. "1110110010110101100111111001000111100001001011000101001"
  1631. "1100110010111100100010111101100100010110000011001101001"
  1632. "1101110010111110010110011101110000100110100011011101001"
  1633. "1101111010111111011001110101011100001001100011011001001"
  1634. "0001000000000000000000000000000000000000000000000000010"
  1635. "0010000000000000000000000000000000000000000000000000001"
  1636. "0001000000000000000000000000000000000000000000000000010"
  1637. "0001010010011011110101000110111001000010100100010101010"
  1638. },
  1639. /* 6*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]1234A", 0, 9, 55, "Test even-numbered numeric, ending in non-digit",
  1640. "1101100110111011101011110001001111100110010011110101001"
  1641. "1101101110100001000100001001110110011001110011100101001"
  1642. "1101101100100101111100110001000001011111011011101101001"
  1643. "1101101000110001001001111101011111011001000011101001001"
  1644. "1101001000100110001100000101110110000010110011101001101"
  1645. "0001000000000000000000000000000000000000000000000000010"
  1646. "0010000000000000000000000000000000000000000000000000001"
  1647. "0001000000000000000000000000000000000000000000000000010"
  1648. "0001010010011011110101000110111001000010100100010101010"
  1649. },
  1650. /* 7*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]12345A", 0, 9, 55, "Test odd-numbered numeric, ending in non-digit",
  1651. "1101100110111011101011110001001111100110010011110101001"
  1652. "1101101110100111011100100001100010110001110011100101001"
  1653. "1101101100100100011111001101111101001101110011101101001"
  1654. "1101101000101111100110010001011111000110001011101001001"
  1655. "1101001000100111000111010001011000011000100011101001101"
  1656. "0001000000000000000000000000000000000000000000000000010"
  1657. "0010000000000000000000000000000000000000000000000000001"
  1658. "0001000000000000000000000000000000000000000000000000010"
  1659. "0001010010011011110101000110111001000010100100010101010"
  1660. },
  1661. };
  1662. const int data_size = ARRAY_SIZE(data);
  1663. int i, length, composite_length, ret;
  1664. struct zint_symbol *symbol = NULL;
  1665. char bwipp_buf[8192];
  1666. char bwipp_msg[1024];
  1667. int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
  1668. testStartSymbol("test_odd_numbered_numeric", &symbol);
  1669. for (i = 0; i < data_size; i++) {
  1670. if (testContinue(p_ctx, i)) continue;
  1671. symbol = ZBarcode_Create();
  1672. assert_nonnull(symbol, "Symbol not created\n");
  1673. length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  1674. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  1675. strcpy(symbol->primary, data[i].data);
  1676. composite_length = (int) strlen(data[i].composite);
  1677. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  1678. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  1679. if (p_ctx->generate) {
  1680. test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, -1 /*bwipp_cmp*/);
  1681. } else {
  1682. int width, row;
  1683. assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
  1684. assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
  1685. ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
  1686. assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
  1687. if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
  1688. ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
  1689. assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
  1690. ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
  1691. assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
  1692. i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
  1693. }
  1694. }
  1695. ZBarcode_Delete(symbol);
  1696. }
  1697. testFinish();
  1698. }
  1699. static void test_ean128_cc_shift(const testCtx *const p_ctx) {
  1700. int debug = p_ctx->debug;
  1701. struct item {
  1702. int symbology;
  1703. int option_1;
  1704. char *data;
  1705. char *composite;
  1706. int ret;
  1707. int expected_rows;
  1708. int expected_width;
  1709. int bwipp_cmp;
  1710. char *comment;
  1711. char *expected;
  1712. };
  1713. /* Verified via bwipp_dump.ps against BWIPP except where noted, when shift verified manually (tec-it.com seems to be off by 2 for top shifts > 1) */
  1714. static const struct item data[] = {
  1715. /* 0*/ { BARCODE_GS1_128_CC, -1, "[91]1", "[21]A1B2C3D4E5F6G7H8", 0, 6, 100, 1, "CC-A alignment, bottom shift 10",
  1716. "1101001000110100001000001101101011110111110010010001101010000010010000011101110100010000111011001010"
  1717. "1101011000110101111001100001111010001101100010010000101111000011001101011100101100001000110011001010"
  1718. "1101011100100011001100111101011000101110000010110000101001100110011110011011110011001110110111001010"
  1719. "1101011110111000111011011001110010001011100010111000101011000011100110010000100000100010110111101010"
  1720. "0000000000001011000110000101000100001001001010000100010110001100101000100001011000100110011100010100"
  1721. "0000000000110100111001111010111011110110110101111011101001110011010111011110100111011001100011101011"
  1722. },
  1723. /* 1*/ { BARCODE_GS1_128_CC, -1, "[91]12", "[21]A1B2C3D4E5F6G7H8", 0, 6, 99, 1, "CC-A alignment, bottom shift 12",
  1724. "110100100011010000100000110110101111011111001001000110101000001001000001110111010001000011101100101"
  1725. "110101100011010111100110000111101000110110001001000010111100001100110101110010110000100011001100101"
  1726. "110101110010001100110011110101100010111000001011000010100110011001111001101111001100111011011100101"
  1727. "110101111011100011101101100111001000101110001011100010101100001110011001000010000010001011011110101"
  1728. "000000000000001011000110000101000100001001001010011000110001010000101110110011001110001010000000000"
  1729. "000000000000110100111001111010111011110110110101100111001110101111010001001100110001110101100000000"
  1730. },
  1731. /* 2*/ { BARCODE_GS1_128_CC, -1, "[91]123", "[21]A1B2C3D4E5F6G7H8", 0, 6, 101, 1, "CC-A alignment, top shift 1",
  1732. "01101001000110100001000001101101011110111110010010001101010000010010000011101110100010000111011001010"
  1733. "01101011000110101111001100001111010001101100010010000101111000011001101011100101100001000110011001010"
  1734. "01101011100100011001100111101011000101110000010110000101001100110011110011011110011001110110111001010"
  1735. "01101011110111000111011011001110010001011100010111000101011000011100110010000100000100010110111101010"
  1736. "00101100011000010100010000100100101001100011010000100010011010001101000100001011001111010011100010100"
  1737. "11010011100111101011101111011011010110011100101111011101100101110010111011110100110000101100011101011"
  1738. },
  1739. /* 3*/ { BARCODE_GS1_128_CC, -1, "[91]12345", "[21]A1B2C3D4E5F6G7H8", 0, 6, 112, 1, "CC-A alignment, top shift 12",
  1740. "0000000000001101001000110100001000001101101011110111110010010001101010000010010000011101110100010000111011001010"
  1741. "0000000000001101011000110101111001100001111010001101100010010000101111000011001101011100101100001000110011001010"
  1742. "0000000000001101011100100011001100111101011000101110000010110000101001100110011110011011110011001110110111001010"
  1743. "0000000000001101011110111000111011011001110010001011100010111000101011000011100110010000100000100010110111101010"
  1744. "0010110001100001010001000010010010100110001101110100111010000100010010001101101000100001000110110010011100010100"
  1745. "1101001110011110101110111101101101011001110010001011000101111011101101110010010111011110111001001101100011101011"
  1746. },
  1747. /* 4*/ { BARCODE_GS1_128_CC, -1, "[91]1234567", "[21]A1B2C3D4E5F6G7H8", 0, 6, 123, 1, "CC-A alignment, top shift 10",
  1748. "000000000011010010001101000010000011011010111101111100100100011010100000100100000111011101000100001110110010100000000000000"
  1749. "000000000011010110001101011110011000011110100011011000100100001011110000110011010111001011000010001100110010100000000000000"
  1750. "000000000011010111001000110011001111010110001011100000101100001010011001100111100110111100110011101101110010100000000000000"
  1751. "000000000011010111101110001110110110011100100010111000101110001010110000111001100100001000001000101101111010100000000000000"
  1752. "001011000110000101000100001001001010011000110111010011100011101001010000100010001001000101000100001000110100110011100010100"
  1753. "110100111001111010111011110110110101100111001000101100011100010110101111011101110110111010111011110111001011001100011101011"
  1754. },
  1755. /* 5*/ { BARCODE_GS1_128_CC, -1, "[91]123456789", "[21]A1B2C3D4E5F6G7H8", 0, 6, 134, 1, "CC-A alignment, top shift 21",
  1756. "00000000000000000000011010010001101000010000011011010111101111100100100011010100000100100000111011101000100001110110010100000000000000"
  1757. "00000000000000000000011010110001101011110011000011110100011011000100100001011110000110011010111001011000010001100110010100000000000000"
  1758. "00000000000000000000011010111001000110011001111010110001011100000101100001010011001100111100110111100110011101101110010100000000000000"
  1759. "00000000000000000000011010111101110001110110110011100100010111000101110001010110000111001100100001000001000101101111010100000000000000"
  1760. "00101100011000010100010000100100101001100011011101001110001110100100111101011010000100010001101001101000100001001101110110011100010100"
  1761. "11010011100111101011101111011011010110011100100010110001110001011011000010100101111011101110010110010111011110110010001001100011101011"
  1762. },
  1763. /* 6*/ { BARCODE_GS1_128_CC, -1, "[91]12345678901", "[21]A1B2C3D4E5F6G7H8", 0, 6, 145, 1, "CC-A alignment, top shift 21",
  1764. "0000000000000000000001101001000110100001000001101101011110111110010010001101010000010010000011101110100010000111011001010000000000000000000000000"
  1765. "0000000000000000000001101011000110101111001100001111010001101100010010000101111000011001101011100101100001000110011001010000000000000000000000000"
  1766. "0000000000000000000001101011100100011001100111101011000101110000010110000101001100110011110011011110011001110110111001010000000000000000000000000"
  1767. "0000000000000000000001101011110111000111011011001110010001011100010111000101011000011100110010000100000100010110111101010000000000000000000000000"
  1768. "0010110001100001010001000010010010100110001101110100111000111010010011110101100100001001010000100010110001100101000100001011001011110011100010100"
  1769. "1101001110011110101110111101101101011001110010001011000111000101101100001010011011110110101111011101001110011010111011110100110100001100011101011"
  1770. },
  1771. };
  1772. const int data_size = ARRAY_SIZE(data);
  1773. int i, length, composite_length, ret;
  1774. struct zint_symbol *symbol = NULL;
  1775. char bwipp_buf[8192];
  1776. char bwipp_msg[1024];
  1777. int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
  1778. testStartSymbol("test_ean128_cc_shift", &symbol);
  1779. for (i = 0; i < data_size; i++) {
  1780. if (testContinue(p_ctx, i)) continue;
  1781. symbol = ZBarcode_Create();
  1782. assert_nonnull(symbol, "Symbol not created\n");
  1783. length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  1784. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  1785. strcpy(symbol->primary, data[i].data);
  1786. composite_length = (int) strlen(data[i].composite);
  1787. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  1788. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  1789. if (p_ctx->generate) {
  1790. test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, data[i].bwipp_cmp);
  1791. } else {
  1792. int width, row;
  1793. assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
  1794. assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
  1795. ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
  1796. assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
  1797. if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
  1798. if (!data[i].bwipp_cmp) {
  1799. if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment);
  1800. } else {
  1801. ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
  1802. assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
  1803. ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
  1804. assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
  1805. i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
  1806. }
  1807. }
  1808. }
  1809. ZBarcode_Delete(symbol);
  1810. }
  1811. testFinish();
  1812. }
  1813. static void test_ean128_cc_width(const testCtx *const p_ctx) {
  1814. int debug = p_ctx->debug;
  1815. struct item {
  1816. char *data;
  1817. char *composite;
  1818. int ret;
  1819. int expected_rows;
  1820. int expected_width;
  1821. char *comment;
  1822. };
  1823. /* Verified manually with BWIPP (except very large tests) */
  1824. static const struct item data[] = {
  1825. /* 0*/ { "[91]1", "[02]13012345678909", 0, 11, 103, "" },
  1826. /* 1*/ { "[91]12", "[02]13012345678909", 0, 20, 86, "" },
  1827. /* 2*/ { "[91]123", "[02]13012345678909", 0, 11, 108, "" },
  1828. /* 3*/ { "[91]123A", "[02]13012345678909", 0, 8, 120, "" },
  1829. /* 4*/ { "[91]123A1", "[02]13012345678909", 0, 7, 137, "" },
  1830. /* 5*/ { "[91]123A12", "[02]13012345678909", 0, 7, 141, "" },
  1831. /* 6*/ { "[91]123A123", "[02]13012345678909", 0, 6, 154, "" },
  1832. /* 7*/ { "[91]123A1234", "[02]13012345678909", 0, 6, 154, "" },
  1833. /* 8*/ { "[91]123A1234A", "[02]13012345678909", 0, 5, 174, "" },
  1834. /* 9*/ { "[91]123A1234A1", "[02]13012345678909", 0, 5, 188, "" },
  1835. /*10*/ { "[91]123A1234A12", "[02]13012345678909", 0, 5, 205, "" },
  1836. /*11*/ { "[00]123456789012345675", "[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345" "675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[91]1234567890", 0, 32, 579, "With composite 2372 digits == max" },
  1837. /*12*/ { "[00]123456789012345675", "[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345" "675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[91]12345678901", ZINT_ERROR_TOO_LONG, 0, 0, "With composite 2373 digits > max" },
  1838. };
  1839. const int data_size = ARRAY_SIZE(data);
  1840. int i, length, composite_length, ret;
  1841. struct zint_symbol *symbol = NULL;
  1842. testStartSymbol("test_ean128_cc_width", &symbol);
  1843. for (i = 0; i < data_size; i++) {
  1844. if (testContinue(p_ctx, i)) continue;
  1845. symbol = ZBarcode_Create();
  1846. assert_nonnull(symbol, "Symbol not created\n");
  1847. length = testUtilSetSymbol(symbol, BARCODE_GS1_128_CC, -1 /*input_mode*/, -1 /*eci*/, 3, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  1848. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  1849. strcpy(symbol->primary, data[i].data);
  1850. composite_length = (int) strlen(data[i].composite);
  1851. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  1852. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  1853. if (p_ctx->generate) {
  1854. printf(" /*%2d*/ { \"%s\", \"%s\", %s, %d, %d, \"%s\" },\n",
  1855. i, data[i].data, data[i].composite, testUtilErrorName(ret), symbol->rows, symbol->width, data[i].comment);
  1856. } else {
  1857. 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);
  1858. 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);
  1859. }
  1860. ZBarcode_Delete(symbol);
  1861. }
  1862. testFinish();
  1863. }
  1864. /* Test general-purpose data compaction */
  1865. static void test_encodation_0(const testCtx *const p_ctx) {
  1866. int debug = p_ctx->debug;
  1867. struct item {
  1868. int symbology;
  1869. int option_1;
  1870. char *data;
  1871. char *composite;
  1872. int ret;
  1873. int expected_rows;
  1874. int expected_width;
  1875. char *comment;
  1876. char *expected;
  1877. };
  1878. /* Verified via bwipp_dump.ps against BWIPP and manually against tec-it.com (with noted exception) */
  1879. static const struct item data[] = {
  1880. /* 0*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]1", 0, 9, 55, "Single numeric",
  1881. "1101100110111101110101111101010001000111100011110101001"
  1882. "1101101110111011000010001101110010101110000011100101001"
  1883. "1101101100110001011111011101111010000100100011101101001"
  1884. "1101101000100111011100111101110011110101110011101001001"
  1885. "1101001000110011001000000101110100011011110011101001101"
  1886. "0001000000000000000000000000000000000000000000000000010"
  1887. "0010000000000000000000000000000000000000000000000000001"
  1888. "0001000000000000000000000000000000000000000000000000010"
  1889. "0001010010011011110101000110111001000010100100010101010"
  1890. },
  1891. /* 1*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]12", 0, 9, 55, "2 numerics",
  1892. "1101100110111011101011110001101111110110010011110101001"
  1893. "1101101110101110011110011001001100110000100011100101001"
  1894. "1101101100100101111010000001101000001110100011101101001"
  1895. "1101101000110010010001111101011000011001111011101001001"
  1896. "1101001000110010000010011001101001000110000011101001101"
  1897. "0001000000000000000000000000000000000000000000000000010"
  1898. "0010000000000000000000000000000000000000000000000000001"
  1899. "0001000000000000000000000000000000000000000000000000010"
  1900. "0001010010011011110101000110111001000010100100010101010"
  1901. },
  1902. /* 2*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]123", 0, 9, 55, "Odd-numbered numeric",
  1903. "1101100110111011101011110001000111100010001011110101001"
  1904. "1101101110100111000111001001101000010001100011100101001"
  1905. "1101101100110101110001000001111010001000001011101101001"
  1906. "1101101000101000010000111101110011111100101011101001001"
  1907. "1101001000101100011100001101101110110010000011101001101"
  1908. "0001000000000000000000000000000000000000000000000000010"
  1909. "0010000000000000000000000000000000000000000000000000001"
  1910. "0001000000000000000000000000000000000000000000000000010"
  1911. "0001010010011011110101000110111001000010100100010101010"
  1912. },
  1913. /* 3*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]1234", 0, 9, 55, "Even-numbered numeric",
  1914. "1101100110111011101011110001001111100110010011110101001"
  1915. "1101101110110001100110011001101100100000010011100101001"
  1916. "1101101100101111101001110001001110010111110011101101001"
  1917. "1101101000111000110101111101000011110101000011101001001"
  1918. "1101001000110101101110000001001101110001100011101001101"
  1919. "0001000000000000000000000000000000000000000000000000010"
  1920. "0010000000000000000000000000000000000000000000000000001"
  1921. "0001000000000000000000000000000000000000000000000000010"
  1922. "0001010010011011110101000110111001000010100100010101010"
  1923. },
  1924. /* 4*/ { BARCODE_UPCE_CC, 1, "1234567", "[20]12[91]12", 0, 9, 55, "Fixed len + even-numbered numeric",
  1925. "1101100110111111010001100101001111010001000011110101001"
  1926. "1101101110100011001110011001110010000010111011100101001"
  1927. "1101101100101111000101111001111010010001000011101101001"
  1928. "1101101000110011110100110001110100011111001011101001001"
  1929. "1101001000111100100101111001101001101110000011101001101"
  1930. "0001000000000000000000000000000000000000000000000000010"
  1931. "0010000000000000000000000000000000000000000000000000001"
  1932. "0001000000000000000000000000000000000000000000000000010"
  1933. "0001010010011011110101000110111001000010100100010101010"
  1934. },
  1935. /* 5*/ { BARCODE_UPCE_CC, 1, "1234567", "[20]12[91]123", 0, 9, 55, "Fixed len + odd-numbered numeric",
  1936. "1101100110111111010001100101001111010001000011110101001"
  1937. "1101101110100011001110011001100001101000100011100101001"
  1938. "1101101100101110010001111101111000010001010011101101001"
  1939. "1101101000110011110010110001100111101000110011101001001"
  1940. "1101001000100001101100100001110010001000111011101001101"
  1941. "0001000000000000000000000000000000000000000000000000010"
  1942. "0010000000000000000000000000000000000000000000000000001"
  1943. "0001000000000000000000000000000000000000000000000000010"
  1944. "0001010010011011110101000110111001000010100100010101010"
  1945. },
  1946. /* 6*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A1234567C", 0, 9, 55, "Alphanumeric followed by 7 digits and alphanumeric",
  1947. "1101100110111011101011110001011100010001100011110101001"
  1948. "1101101110111001001011100001110010001011100011100101001"
  1949. "1101101100111000001000110101001011111100111011101101001"
  1950. "1101101000111101011110001001001111000010001011101001001"
  1951. "1101001000101000001100011001010001000010000011101001101"
  1952. "0001000000000000000000000000000000000000000000000000010"
  1953. "0010000000000000000000000000000000000000000000000000001"
  1954. "0001000000000000000000000000000000000000000000000000010"
  1955. "0001010010011011110101000110111001000010100100010101010"
  1956. },
  1957. /* 7*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A123456C", 0, 9, 55, "Alphanumeric followed by 6 digits and alphanumeric",
  1958. "1101100110111011101011110001011100010001100011110101001"
  1959. "1101101110111001001011100001110010001011100011100101001"
  1960. "1101101100111000011001110101111110011010110011101101001"
  1961. "1101101000100110100011100001000100110111110011101001001"
  1962. "1101001000100000100010010001000001011011000011101001101"
  1963. "0001000000000000000000000000000000000000000000000000010"
  1964. "0010000000000000000000000000000000000000000000000000001"
  1965. "0001000000000000000000000000000000000000000000000000010"
  1966. "0001010010011011110101000110111001000010100100010101010"
  1967. },
  1968. /* 8*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A12345B", 0, 9, 55, "Alphanumeric followed by 5 digits and alphanumeric",
  1969. "1101100110111011101011110001011100010001100011110101001"
  1970. "1101101110110011101100100001110110001000110011100101001"
  1971. "1101101100101111100110111101111110100101110011101101001"
  1972. "1101101000111111010011000101100101100111111011101001001"
  1973. "1101001000110100010110000001000100010000001011101001101"
  1974. "0001000000000000000000000000000000000000000000000000010"
  1975. "0010000000000000000000000000000000000000000000000000001"
  1976. "0001000000000000000000000000000000000000000000000000010"
  1977. "0001010010011011110101000110111001000010100100010101010"
  1978. },
  1979. /* 9*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A1234567", 0, 9, 55, "Alphanumeric followed by 7 digits, terminating",
  1980. "1101100110111011101011110001011100010001100011110101001"
  1981. "1101101110111001001011100001111001000101111011100101001"
  1982. "1101101100111101011001100001111100110001010011101101001"
  1983. "1101101000111110010011100101110100011111001011101001001"
  1984. "1101001000110101100011100001101110110000100011101001101"
  1985. "0001000000000000000000000000000000000000000000000000010"
  1986. "0010000000000000000000000000000000000000000000000000001"
  1987. "0001000000000000000000000000000000000000000000000000010"
  1988. "0001010010011011110101000110111001000010100100010101010"
  1989. },
  1990. /*10*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A123456", 0, 9, 55, "Alphanumeric followed by 6 digits, terminating",
  1991. "1101100110111011101011110001011100010001100011110101001"
  1992. "1101101110111001001011100001110010001011100011100101001"
  1993. "1101101100111100000100010101001111101000111011101101001"
  1994. "1101101000100110001001110001011100110111000011101001001"
  1995. "1101001000110110000010000101100110010010000011101001101"
  1996. "0001000000000000000000000000000000000000000000000000010"
  1997. "0010000000000000000000000000000000000000000000000000001"
  1998. "0001000000000000000000000000000000000000000000000000010"
  1999. "0001010010011011110101000110111001000010100100010101010"
  2000. },
  2001. /*11*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A12345", 0, 9, 55, "Alphanumeric followed by 5 digits, terminating",
  2002. "1101100110111011101011110001011100010001100011110101001"
  2003. "1101101110111001001011100001111001000101111011100101001"
  2004. "1101101100111000101110001101001111001011110011101101001"
  2005. "1101101000111010011111101101100111110010001011101001001"
  2006. "1101001000111000100010011101000101110011100011101001101"
  2007. "0001000000000000000000000000000000000000000000000000010"
  2008. "0010000000000000000000000000000000000000000000000000001"
  2009. "0001000000000000000000000000000000000000000000000000010"
  2010. "0001010010011011110101000110111001000010100100010101010"
  2011. },
  2012. /*12*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A1234", 0, 9, 55, "Alphanumeric followed by 4 digits, terminating",
  2013. "1101100110111011101011110001011100010001100011110101001"
  2014. "1101101110111001001011100001110110010011000011100101001"
  2015. "1101101100111100110111001101011111101011000011101101001"
  2016. "1101101000101111001100011001000001010001111011101001001"
  2017. "1101001000110111011000100001110000100100111011101001101"
  2018. "0001000000000000000000000000000000000000000000000000010"
  2019. "0010000000000000000000000000000000000000000000000000001"
  2020. "0001000000000000000000000000000000000000000000000000010"
  2021. "0001010010011011110101000110111001000010100100010101010"
  2022. },
  2023. /*13*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A123", 0, 9, 55, "Alphanumeric followed by 3 digits, terminating",
  2024. "1101100110111011101011110001011100010001100011110101001"
  2025. "1101101110110011101100100001001000111001110011100101001"
  2026. "1101101100100101111100110001011101001111100011101101001"
  2027. "1101101000110111110000100101001111000001010011101001001"
  2028. "1101001000110010100001100001110010001101111011101001101"
  2029. "0001000000000000000000000000000000000000000000000000010"
  2030. "0010000000000000000000000000000000000000000000000000001"
  2031. "0001000000000000000000000000000000000000000000000000010"
  2032. "0001010010011011110101000110111001000010100100010101010"
  2033. },
  2034. /*14*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A123[10]C", 0, 9, 55, "Alphanumeric followed by 3 digits, 2-digit AI (3 numerics including FNC1) and alphanumeric",
  2035. "1101100110111011101011110001011100010001100011110101001"
  2036. "1101101110111001001011100001100010101100000011100101001"
  2037. "1101101100110100001110010001110111101111101011101101001"
  2038. "1101101000101110001100111001001110010011000011101001001"
  2039. "1101001000101100111001100001100100111001111011101001101"
  2040. "0001000000000000000000000000000000000000000000000000010"
  2041. "0010000000000000000000000000000000000000000000000000001"
  2042. "0001000000000000000000000000000000000000000000000000010"
  2043. "0001010010011011110101000110111001000010100100010101010"
  2044. },
  2045. /*15*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A12[10]C", 0, 9, 55, "Alphanumeric followed by 2 digits, 2-digit AI (3 numerics including FNC1) and alphanumeric",
  2046. "1101100110111011101011110001011100010001100011110101001"
  2047. "1101101110110011101100100001000001001010000011100101001"
  2048. "1101101100111110110100001001111110111101101011101101001"
  2049. "1101101000100110010000011101100111000010111011101001001"
  2050. "1101001000110110001000100001101100100000010011101001101"
  2051. "0001000000000000000000000000000000000000000000000000010"
  2052. "0010000000000000000000000000000000000000000000000000001"
  2053. "0001000000000000000000000000000000000000000000000000010"
  2054. "0001010010011011110101000110111001000010100100010101010"
  2055. },
  2056. /*16*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A12[10]1", 0, 9, 55, "Alphanumeric followed by 2 digits, 2-digit AI (3 numerics including FNC1) and 1 digit, terminating",
  2057. "1101100110111011101011110001011100010001100011110101001"
  2058. "1101101110111100100101111001000010000110110011100101001"
  2059. "1101101100100100011110010001001110010111110011101101001"
  2060. "1101101000111101111010111101000100100111100011101001001"
  2061. "1101001000111101110010011001001000001101100011101001101"
  2062. "0001000000000000000000000000000000000000000000000000010"
  2063. "0010000000000000000000000000000000000000000000000000001"
  2064. "0001000000000000000000000000000000000000000000000000010"
  2065. "0001010010011011110101000110111001000010100100010101010"
  2066. },
  2067. /*17*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A1[10]1", 0, 9, 55, "Alphanumeric followed by 1 digit, 2-digit AI (3 numerics including FNC1) and 1 digit, terminating; **NOT SAME** as tec-it.com, which does not switch to numeric mode after 'A'; same as BWIPP",
  2068. "1101100110111011101011110001011100010001100011110101001"
  2069. "1101101110110010011001110001110010010011100011100101001"
  2070. "1101101100111110110001001001010111111000111011101101001"
  2071. "1101101000111011110010011101011101100111000011101001001"
  2072. "1101001000110100001101110001000001010100000011101001101"
  2073. "0001000000000000000000000000000000000000000000000000010"
  2074. "0010000000000000000000000000000000000000000000000000001"
  2075. "0001000000000000000000000000000000000000000000000000010"
  2076. "0001010010011011110101000110111001000010100100010101010"
  2077. },
  2078. /*18*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]A[10]1", 0, 9, 55, "Alphanumeric followed by 2-digit AI (3 numerics including FNC1) and 1 digit, terminating",
  2079. "1101100110111011101011110001101110001000111011110101001"
  2080. "1101101110111001100010110001100010000010110011100101001"
  2081. "1101101100101111110010011001001101111110110011101101001"
  2082. "1101101000100100100111100001110010111110100011101001001"
  2083. "1101001000101110001111011001111011000100111011101001101"
  2084. "0001000000000000000000000000000000000000000000000000010"
  2085. "0010000000000000000000000000000000000000000000000000001"
  2086. "0001000000000000000000000000000000000000000000000000010"
  2087. "0001010010011011110101000110111001000010100100010101010"
  2088. },
  2089. /*19*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]a1234ABCDEFGb", 0, 12, 55, "ISO-646 followed by 11 non-ISO-646 non-terminating, starting 4 digits",
  2090. "1110111010101100111111011001011111000100111011011011101"
  2091. "1110011010101100001100111101011101000001100011011011001"
  2092. "1111011010100100001001000001001110011110110011011010001"
  2093. "1111001010100111100100111101111110110001011011010010001"
  2094. "1110001010101100110011110001000111001101110011010110001"
  2095. "1100001010101000001000100001000010111001110011010111001"
  2096. "1100011010111011101111000101111100110010001011010111101"
  2097. "1100010010100111010000001101100001010111110011010011101"
  2098. "0001000000000000000000000000000000000000000000000000010"
  2099. "0010000000000000000000000000000000000000000000000000001"
  2100. "0001000000000000000000000000000000000000000000000000010"
  2101. "0001010010011011110101000110111001000010100100010101010"
  2102. },
  2103. /*20*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]a1234ABCDEFb", 0, 12, 55, "ISO-646 followed by 10 non-ISO-646 non-terminating, starting 4 digits",
  2104. "1110111010101100111111011001011111000100111011011011101"
  2105. "1110011010101100001100111101011101000001100011011011001"
  2106. "1111011010100100001001000001001110011110110011011010001"
  2107. "1111001010100111100100111101111110110001011011010010001"
  2108. "1110001010111101101011111101100111100010110011010110001"
  2109. "1100001010110110001000001001111001011011111011010111001"
  2110. "1100011010110111110010111101111100011101101011010111101"
  2111. "1100010010101110000010001101101110000100111011010011101"
  2112. "0001000000000000000000000000000000000000000000000000010"
  2113. "0010000000000000000000000000000000000000000000000000001"
  2114. "0001000000000000000000000000000000000000000000000000010"
  2115. "0001010010011011110101000110111001000010100100010101010"
  2116. },
  2117. /*21*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]a1234ABCDEF", 0, 11, 55, "ISO-646 followed by 10 non-ISO-646 terminating, starting 4 digits",
  2118. "1110110110101100111111011001011111000100111011100010101"
  2119. "1110010110101100001100111101011101000001100011000010101"
  2120. "1100010110100100001001000001001110011110110011000110101"
  2121. "1100010100100111100100111101001001111001000011000100101"
  2122. "1100110100110011111000101001011110000011011011100100101"
  2123. "1101110100111011101001000001110001000100111011110100101"
  2124. "1101100100110001011100100001110001011000100011110101101"
  2125. "0001000000000000000000000000000000000000000000000000010"
  2126. "0010000000000000000000000000000000000000000000000000001"
  2127. "0001000000000000000000000000000000000000000000000000010"
  2128. "0001010010011011110101000110111001000010100100010101010"
  2129. },
  2130. /*22*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]a1234ABCDEb", 0, 11, 55, "ISO-646 followed by 9 non-ISO-646 non-terminating, starting 4 digits",
  2131. "1110110110101100111111011001011111000100111011100010101"
  2132. "1110010110101100000010011101110111100010111011000010101"
  2133. "1100010110110010011100111101011000111100111011000110101"
  2134. "1100010100111101000110001101001011110010000011000100101"
  2135. "1100110100100001100001011101011110011011000011100100101"
  2136. "1101110100111010101110000001100101001100000011110100101"
  2137. "1101100100111100100100100001110001100111010011110101101"
  2138. "0001000000000000000000000000000000000000000000000000010"
  2139. "0010000000000000000000000000000000000000000000000000001"
  2140. "0001000000000000000000000000000000000000000000000000010"
  2141. "0001010010011011110101000110111001000010100100010101010"
  2142. },
  2143. /*23*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]a1234ABCDE", 0, 10, 55, "ISO-646 followed by 9 non-ISO-646 terminating, starting 4 digits",
  2144. "1100100010111001101001100001111001111010100011100101101"
  2145. "1110100010111110010010001101110110011100100011000101101"
  2146. "1110110010100010100011110001001111000011011011000101001"
  2147. "1100110010100000100010000101110110001000110011001101001"
  2148. "1101110010100010001111000101000011001111101011011101001"
  2149. "1101111010111110101111011001010001000001111011011001001"
  2150. "0001000000000000000000000000000000000000000000000000010"
  2151. "0010000000000000000000000000000000000000000000000000001"
  2152. "0001000000000000000000000000000000000000000000000000010"
  2153. "0001010010011011110101000110111001000010100100010101010"
  2154. },
  2155. /*24*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]a123ABCDEFGb", 0, 12, 55, "ISO-646 followed by 10 non-ISO-646 non-terminating, starting 3 digits (5 alphanumerics rule applies)",
  2156. "1110111010101100111111011001011111000100111011011011101"
  2157. "1110011010100100000010111101101111001100111011011011001"
  2158. "1111011010111101100100011101001011110111100011011010001"
  2159. "1111001010111110001010110001101001110000100011010010001"
  2160. "1110001010110011100010111001101110100001110011010110001"
  2161. "1100001010110100111101111101100110100010000011010111001"
  2162. "1100011010101000111111011101110110111001000011010111101"
  2163. "1100010010100011110110110001000111100100001011010011101"
  2164. "0001000000000000000000000000000000000000000000000000010"
  2165. "0010000000000000000000000000000000000000000000000000001"
  2166. "0001000000000000000000000000000000000000000000000000010"
  2167. "0001010010011011110101000110111001000010100100010101010"
  2168. },
  2169. /*25*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCDEF12345b", 0, 12, 55, "ISO-646 followed by 11 non-ISO-646 non-terminating, starting 6 letters",
  2170. "1110111010101100111111011001011111000100111011011011101"
  2171. "1110011010101100000110111101111010011111011011011011001"
  2172. "1111011010100001001100001101010010000010000011011010001"
  2173. "1111001010101111110011011101110100110100000011010010001"
  2174. "1110001010111110101110100001001101011100000011010110001"
  2175. "1100001010100010011000011001100001000010011011010111001"
  2176. "1100011010111000101110110001110100111000011011010111101"
  2177. "1100010010101100010011100001001110000110111011010011101"
  2178. "0001000000000000000000000000000000000000000000000000010"
  2179. "0010000000000000000000000000000000000000000000000000001"
  2180. "0001000000000000000000000000000000000000000000000000010"
  2181. "0001010010011011110101000110111001000010100100010101010"
  2182. },
  2183. /*26*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCDEF1234b", 0, 12, 55, "ISO-646 followed by 10 non-ISO-646 non-terminating, starting 6 letters",
  2184. "1110111010101100111111011001011111000100111011011011101"
  2185. "1110011010101100000110111101111010011111011011011011001"
  2186. "1111011010100001001100001101010010000010000011011010001"
  2187. "1111001010101111110011011101110100110100000011010010001"
  2188. "1110001010111111010110000101110001110101111011010110001"
  2189. "1100001010111010001011100001100001001000011011010111001"
  2190. "1100011010101001111010000001111100100010011011010111101"
  2191. "1100010010110100111111010001011001000001110011010011101"
  2192. "0001000000000000000000000000000000000000000000000000010"
  2193. "0010000000000000000000000000000000000000000000000000001"
  2194. "0001000000000000000000000000000000000000000000000000010"
  2195. "0001010010011011110101000110111001000010100100010101010"
  2196. },
  2197. /*27*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCDE12345b", 0, 12, 55, "ISO-646 followed by 10 non-ISO-646 non-terminating, starting 5 letters",
  2198. "1110111010101100111111011001011111000100111011011011101"
  2199. "1110011010101100000110111101111010011111011011011011001"
  2200. "1111011010100001001100001101010010000010000011011010001"
  2201. "1111001010111001101110010001101000011100010011010010001"
  2202. "1110001010111011011111101001011101000000110011010110001"
  2203. "1100001010100011000111011001110000100101110011010111001"
  2204. "1100011010110100001110100001110110011100010011010111101"
  2205. "1100010010111111010111001101110111100101110011010011101"
  2206. "0001000000000000000000000000000000000000000000000000010"
  2207. "0010000000000000000000000000000000000000000000000000001"
  2208. "0001000000000000000000000000000000000000000000000000010"
  2209. "0001010010011011110101000110111001000010100100010101010"
  2210. },
  2211. /*28*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCDE12345", 0, 11, 55, "ISO-646 followed by 10 non-ISO-646 terminating, starting 5 letters",
  2212. "1110110110101100111111011001011111000100111011100010101"
  2213. "1110010110101100000110111101111010011111011011000010101"
  2214. "1100010110100001001100001101010010000010000011000110101"
  2215. "1100010100101100101111110001101000001111011011000100101"
  2216. "1100110100101000000100111101010000011011111011100100101"
  2217. "1101110100110011101100010001110001100101100011110100101"
  2218. "1101100100111100110110000101111110101001110011110101101"
  2219. "0001000000000000000000000000000000000000000000000000010"
  2220. "0010000000000000000000000000000000000000000000000000001"
  2221. "0001000000000000000000000000000000000000000000000000010"
  2222. "0001010010011011110101000110111001000010100100010101010"
  2223. },
  2224. /*29*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCD012345b", 0, 12, 55, "ISO-646 followed by 10 non-ISO-646 non-terminating, starting 4 letters + numeric",
  2225. "1110111010101100111111011001011111000100111011011011101"
  2226. "1110011010101100000110111101111010011111011011011011001"
  2227. "1111011010100001001100001101110101000111000011011010001"
  2228. "1111001010110010111000100001001101011111100011010010001"
  2229. "1110001010110010101111100001000010010111100011010110001"
  2230. "1100001010111101001011110001001011110011110011010111001"
  2231. "1100011010111000101110110001110001011000100011010111101"
  2232. "1100010010111101101011111101000000110101110011010011101"
  2233. "0001000000000000000000000000000000000000000000000000010"
  2234. "0010000000000000000000000000000000000000000000000000001"
  2235. "0001000000000000000000000000000000000000000000000000010"
  2236. "0001010010011011110101000110111001000010100100010101010"
  2237. },
  2238. /*30*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCD012345", 0, 10, 55, "ISO-646 followed by 10 non-ISO-646 terminating, starting 4 letters + numeric",
  2239. "1100100010111001101001100001111001111010100011100101101"
  2240. "1110100010111001001101000001111010011011000011000101101"
  2241. "1110110010100001100100011101110101000111111011000101001"
  2242. "1100110010111101100100011101110001011011110011001101001"
  2243. "1101110010111000100011010001110010110001000011011101001"
  2244. "1101111010111000110101111101000110010001110011011001001"
  2245. "0001000000000000000000000000000000000000000000000000010"
  2246. "0010000000000000000000000000000000000000000000000000001"
  2247. "0001000000000000000000000000000000000000000000000000010"
  2248. "0001010010011011110101000110111001000010100100010101010"
  2249. },
  2250. /*31*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCDE1234b", 0, 11, 55, "ISO-646 followed by 9 non-ISO-646 non-terminating, starting 5 letters",
  2251. "1110110110101100111111011001011111000100111011100010101"
  2252. "1110010110100010110001111101011000001101111011000010101"
  2253. "1100010110111101101100111101000110000110100011000110101"
  2254. "1100010100111001101110010001101000111000010011000100101"
  2255. "1100110100100111001110111101001111101100100011100100101"
  2256. "1101110100110011000100000101100101001100000011110100101"
  2257. "1101100100111100001010000101100111011111010011110101101"
  2258. "0001000000000000000000000000000000000000000000000000010"
  2259. "0010000000000000000000000000000000000000000000000000001"
  2260. "0001000000000000000000000000000000000000000000000000010"
  2261. "0001010010011011110101000110111001000010100100010101010"
  2262. },
  2263. /*32*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCDE1234", 0, 10, 55, "ISO-646 followed by 9 non-ISO-646 terminating, starting 5 letters",
  2264. "1100100010111001101001100001111001111010100011100101101"
  2265. "1110100010111001001101000001111010011011000011000101101"
  2266. "1110110010100001100100011101110101111110011011000101001"
  2267. "1100110010100100000100001001111011010011100011001101001"
  2268. "1101110010111101011001100001111010011000011011011101001"
  2269. "1101111010111010111110100001111100101110010011011001001"
  2270. "0001000000000000000000000000000000000000000000000000010"
  2271. "0010000000000000000000000000000000000000000000000000001"
  2272. "0001000000000000000000000000000000000000000000000000010"
  2273. "0001010010011011110101000110111001000010100100010101010"
  2274. },
  2275. /*33*/ { BARCODE_UPCE_CC, 1, "1234567", "[91]aABCDE123", 0, 10, 55, "ISO-646 followed by 8 non-ISO-646 terminating, starting 5 letters",
  2276. "1100100010111001101001100001111001111010100011100101101"
  2277. "1110100010111001001101000001111010011011000011000101101"
  2278. "1110110010100001100100011101110101111110011011000101001"
  2279. "1100110010110011000100000101010000010001000011001101001"
  2280. "1101110010111000111011110101100010011101000011011101001"
  2281. "1101111010101101100001111001010000011011111011011001001"
  2282. "0001000000000000000000000000000000000000000000000000010"
  2283. "0010000000000000000000000000000000000000000000000000001"
  2284. "0001000000000000000000000000000000000000000000000000010"
  2285. "0001010010011011110101000110111001000010100100010101010"
  2286. },
  2287. };
  2288. const int data_size = ARRAY_SIZE(data);
  2289. int i, length, composite_length, ret;
  2290. struct zint_symbol *symbol = NULL;
  2291. char bwipp_buf[8192];
  2292. char bwipp_msg[1024];
  2293. int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
  2294. testStartSymbol("test_encodation_0", &symbol);
  2295. for (i = 0; i < data_size; i++) {
  2296. if (testContinue(p_ctx, i)) continue;
  2297. symbol = ZBarcode_Create();
  2298. assert_nonnull(symbol, "Symbol not created\n");
  2299. length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  2300. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  2301. strcpy(symbol->primary, data[i].data);
  2302. composite_length = (int) strlen(data[i].composite);
  2303. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  2304. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  2305. if (p_ctx->generate) {
  2306. test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, -1 /*bwipp_cmp*/);
  2307. } else {
  2308. int width, row;
  2309. assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
  2310. assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
  2311. ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
  2312. assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
  2313. if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
  2314. ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
  2315. assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
  2316. ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
  2317. assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
  2318. i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
  2319. }
  2320. }
  2321. ZBarcode_Delete(symbol);
  2322. }
  2323. testFinish();
  2324. }
  2325. static void test_encodation_10(const testCtx *const p_ctx) {
  2326. int debug = p_ctx->debug;
  2327. struct item {
  2328. int symbology;
  2329. int option_1;
  2330. char *data;
  2331. char *composite;
  2332. int ret;
  2333. int expected_rows;
  2334. int expected_width;
  2335. char *comment;
  2336. char *expected;
  2337. };
  2338. /* Verified via bwipp_dump.ps against BWIPP, and manually, with noted exceptions, against tec-it.com */
  2339. static const struct item data[] = {
  2340. /* 0*/ { BARCODE_UPCE_CC, 1, "1234567", "[11]201001[10]AB1234", 0, 9, 55, "Mode '10' date + even-numbered numeric lot, 1st fit, alphanumeric latch and padding",
  2341. "1101100110101110000100011001001000100111100011110101001"
  2342. "1101101110110010100011000001100110010000001011100101001"
  2343. "1101101100111011011101000001110100111000110011101101001"
  2344. "1101101000111110101110000101000110000010111011101001001"
  2345. "1101001000101100011010000001100110001010000011101001101"
  2346. "0001000000000000000000000000000000000000000000000000010"
  2347. "0010000000000000000000000000000000000000000000000000001"
  2348. "0001000000000000000000000000000000000000000000000000010"
  2349. "0001010010011011110101000110111001000010100100010101010"
  2350. },
  2351. /* 1*/ { BARCODE_UPCE_CC, 1, "1234567", "[11]201001[10]AB12345", 0, 9, 55, "Mode '10' date + odd-numbered numeric lot, 1st fit, 7-bit final, no alphanumeric latch or padding",
  2352. "1101100110101110000100011001001000100111100011110101001"
  2353. "1101101110110010100011000001100110010000001011100101001"
  2354. "1101101100111011011101000001111010000110110011101101001"
  2355. "1101101000100111101110111001000001001001111011101001001"
  2356. "1101001000101100011100011001111101010111110011101001101"
  2357. "0001000000000000000000000000000000000000000000000000010"
  2358. "0010000000000000000000000000000000000000000000000000001"
  2359. "0001000000000000000000000000000000000000000000000000010"
  2360. "0001010010011011110101000110111001000010100100010101010"
  2361. },
  2362. /* 2*/ { BARCODE_UPCE_CC, 1, "1234567", "[11]201001", 0, 9, 55, "Mode '10' date, no lot or other data",
  2363. "1101100110101110000100011001001000100111100011110101001"
  2364. "1101101110110010100110000001010000010010000011100101001"
  2365. "1101101100111011000001110101000001011111011011101101001"
  2366. "1101101000101000100111100001011110000101000011101001001"
  2367. "1101001000111100111001001101000110001100001011101001101"
  2368. "0001000000000000000000000000000000000000000000000000010"
  2369. "0010000000000000000000000000000000000000000000000000001"
  2370. "0001000000000000000000000000000000000000000000000000010"
  2371. "0001010010011011110101000110111001000010100100010101010"
  2372. },
  2373. /* 3*/ { BARCODE_UPCE_CC, 1, "1234567", "[11]201001[20]12", 0, 9, 55, "Mode '10' date, no lot, other data",
  2374. "1101100110101110000100011001100100010011111011110101001"
  2375. "1101101110101110111010000001000101100001100011100101001"
  2376. "1101101100111010011000100001111110101001110011101101001"
  2377. "1101101000111111010110010001010100001111000011101001001"
  2378. "1101001000111001011011110001100001101010000011101001101"
  2379. "0001000000000000000000000000000000000000000000000000010"
  2380. "0010000000000000000000000000000000000000000000000000001"
  2381. "0001000000000000000000000000000000000000000000000000010"
  2382. "0001010010011011110101000110111001000010100100010101010"
  2383. },
  2384. /* 4*/ { BARCODE_UPCE_CC, 1, "1234567", "[10]1234", 0, 9, 55, "Mode '10' no date, numeric lot, no other data; **NOT SAME** as tec-it.com; same as BWIPP",
  2385. "1101100110100111000110011101110011100101111011110101001"
  2386. "1101101110110100100110000001111011100101100011100101001"
  2387. "1101101100100111101011110001111110011010110011101101001"
  2388. "1101101000100110110000111101101010111110000011101001001"
  2389. "1101001000110100111000111101000001000010001011101001101"
  2390. "0001000000000000000000000000000000000000000000000000010"
  2391. "0010000000000000000000000000000000000000000000000000001"
  2392. "0001000000000000000000000000000000000000000000000000010"
  2393. "0001010010011011110101000110111001000010100100010101010"
  2394. },
  2395. /* 5*/ { BARCODE_UPCE_CC, 1, "1234567", "[10]ABCD", 0, 9, 55, "Mode '10' no date, alphanumeric lot, no other data; **NOT SAME** as tec-it.com; same as BWIPP",
  2396. "1101100110101111001100011001111000010111101011110101001"
  2397. "1101101110100010111100111101100110010010000011100101001"
  2398. "1101101100100111101001111001000010111110110011101101001"
  2399. "1101101000110001100010111101011101000001100011101001001"
  2400. "1101001000111010000101110001101000011101111011101001101"
  2401. "0001000000000000000000000000000000000000000000000000010"
  2402. "0010000000000000000000000000000000000000000000000000001"
  2403. "0001000000000000000000000000000000000000000000000000010"
  2404. "0001010010011011110101000110111001000010100100010101010"
  2405. },
  2406. };
  2407. const int data_size = ARRAY_SIZE(data);
  2408. int i, length, composite_length, ret;
  2409. struct zint_symbol *symbol = NULL;
  2410. char bwipp_buf[8192];
  2411. char bwipp_msg[1024];
  2412. int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
  2413. testStartSymbol("test_encodation_10", &symbol);
  2414. for (i = 0; i < data_size; i++) {
  2415. if (testContinue(p_ctx, i)) continue;
  2416. symbol = ZBarcode_Create();
  2417. assert_nonnull(symbol, "Symbol not created\n");
  2418. length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  2419. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  2420. strcpy(symbol->primary, data[i].data);
  2421. composite_length = (int) strlen(data[i].composite);
  2422. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  2423. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  2424. if (p_ctx->generate) {
  2425. test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, -1 /*bwipp_cmp*/);
  2426. } else {
  2427. int width, row;
  2428. assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
  2429. assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
  2430. ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
  2431. assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
  2432. if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
  2433. ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
  2434. assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
  2435. ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
  2436. assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
  2437. i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
  2438. }
  2439. }
  2440. ZBarcode_Delete(symbol);
  2441. }
  2442. testFinish();
  2443. }
  2444. static void test_encodation_11(const testCtx *const p_ctx) {
  2445. int debug = p_ctx->debug;
  2446. struct item {
  2447. int symbology;
  2448. int option_1;
  2449. char *data;
  2450. char *composite;
  2451. int ret;
  2452. int expected_rows;
  2453. int expected_width;
  2454. char *comment;
  2455. char *expected;
  2456. };
  2457. /* Verified via bwipp_dump.ps against BWIPP, and manually against tec-it.com (with noted exception) */
  2458. static const struct item data[] = {
  2459. /* 0*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]A", 0, 9, 55, "Mode '11', letter prefix only",
  2460. "1101100110100111100000101001110110010011111011110101001"
  2461. "1101101110110001000101100001100011010010000011100101001"
  2462. "1101101100110001000011100101001110010011111011101101001"
  2463. "1101101000110100111111010001000001100010111011101001001"
  2464. "1101001000110001010110000001001100011100011011101001101"
  2465. "0001000000000000000000000000000000000000000000000000010"
  2466. "0010000000000000000000000000000000000000000000000000001"
  2467. "0001000000000000000000000000000000000000000000000000010"
  2468. "0001010010011011110101000110111001000010100100010101010"
  2469. },
  2470. /* 1*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1A", 0, 9, 55, "Mode '11', 1 digit letter prefix only",
  2471. "1101100110100111100000101001011001000111000011110101001"
  2472. "1101101110101101111011100001011100111010000011100101001"
  2473. "1101101100111000010011010001101011100001000011101101001"
  2474. "1101101000101100011001111001000111110110001011101001001"
  2475. "1101001000100010001110111001001100111001100011101001101"
  2476. "0001000000000000000000000000000000000000000000000000010"
  2477. "0010000000000000000000000000000000000000000000000000001"
  2478. "0001000000000000000000000000000000000000000000000000010"
  2479. "0001010010011011110101000110111001000010100100010101010"
  2480. },
  2481. /* 2*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]12A", 0, 9, 55, "Mode '11', 2 digit letter prefix only",
  2482. "1101100110100111100000101001011001101111000011110101001"
  2483. "1101101110110001010000110001110111010000010011100101001"
  2484. "1101101100111110011010000101111100100110111011101101001"
  2485. "1101101000110111100101100001000110010001110011101001001"
  2486. "1101001000100100111101111001000010011100111011101001101"
  2487. "0001000000000000000000000000000000000000000000000000010"
  2488. "0010000000000000000000000000000000000000000000000000001"
  2489. "0001000000000000000000000000000000000000000000000000010"
  2490. "0001010010011011110101000110111001000010100100010101010"
  2491. },
  2492. /* 3*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]123A", 0, 9, 55, "Mode '11', 3 digit letter prefix only",
  2493. "1101100110100111100000101001100110101111000011110101001"
  2494. "1101101110100001001010000001101110110100000011100101001"
  2495. "1101101100111110110000101001100101111100111011101101001"
  2496. "1101101000111001110010111101110101111110011011101001001"
  2497. "1101001000110011000001001001101110111001100011101001101"
  2498. "0001000000000000000000000000000000000000000000000000010"
  2499. "0010000000000000000000000000000000000000000000000000001"
  2500. "0001000000000000000000000000000000000000000000000000010"
  2501. "0001010010011011110101000110111001000010100100010101010"
  2502. },
  2503. /* 4*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]30B", 0, 9, 55, "Mode '11', 2 digit <= 30 table3 letter prefix only",
  2504. "1101100110110111110000100101011100100110000011110101001"
  2505. "1101101110101111011111001101000011000111011011100101001"
  2506. "1101101100110100111000000101110000100011010011101101001"
  2507. "1101101000111101011111001101110001111110101011101001001"
  2508. "1101001000111100110010011101000100000010100011101001101"
  2509. "0001000000000000000000000000000000000000000000000000010"
  2510. "0010000000000000000000000000000000000000000000000000001"
  2511. "0001000000000000000000000000000000000000000000000000010"
  2512. "0001010010011011110101000110111001000010100100010101010"
  2513. },
  2514. /* 5*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]A1234", 0, 9, 55, "Mode '11', even-numbered numeric [90]",
  2515. "1101100110100111100000101001110110010011111011110101001"
  2516. "1101101110110001000100110001101000100110000011100101001"
  2517. "1101101100111100010111011101100011011110100011101101001"
  2518. "1101101000101001100001111101001001110111111011101001001"
  2519. "1101001000111011100100100001101000010000011011101001101"
  2520. "0001000000000000000000000000000000000000000000000000010"
  2521. "0010000000000000000000000000000000000000000000000000001"
  2522. "0001000000000000000000000000000000000000000000000000010"
  2523. "0001010010011011110101000110111001000010100100010101010"
  2524. },
  2525. /* 6*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]A12345", 0, 9, 55, "Mode '11', odd-numbered numeric [90]",
  2526. "1101100110100111100000101001110110010011111011110101001"
  2527. "1101101110110001000100110001110100010011100011100101001"
  2528. "1101101100101000011110010001110100011010000011101101001"
  2529. "1101101000101110000010110001001111000100001011101001001"
  2530. "1101001000111000100010111001011000111100111011101001101"
  2531. "0001000000000000000000000000000000000000000000000000010"
  2532. "0010000000000000000000000000000000000000000000000000001"
  2533. "0001000000000000000000000000000000000000000000000000010"
  2534. "0001010010011011110101000110111001000010100100010101010"
  2535. },
  2536. /* 7*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1ABC4", 0, 9, 55, "Mode '11', alpha [90]",
  2537. "1101100110100111110110010001001110011000111011110101001"
  2538. "1101101110110110011000011001010011000011000011100101001"
  2539. "1101101100101000111100000101110000100110010011101101001"
  2540. "1101101000100111101100001101000001001011110011101001001"
  2541. "1101001000110111001101000001000010000110011011101001101"
  2542. "0001000000000000000000000000000000000000000000000000010"
  2543. "0010000000000000000000000000000000000000000000000000001"
  2544. "0001000000000000000000000000000000000000000000000000010"
  2545. "0001010010011011110101000110111001000010100100010101010"
  2546. },
  2547. /* 8*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1AB34", 0, 9, 55, "Mode '11', alphanumeric [90] (letters <= numbers)",
  2548. "1101100110100011100110111001011111101110010011110101001"
  2549. "1101101110110000110100010001100101100011100011100101001"
  2550. "1101101100110010000011100101101100011110001011101101001"
  2551. "1101101000100111011101111001110011111101001011101001001"
  2552. "1101001000111100010101111001110011000100011011101001101"
  2553. "0001000000000000000000000000000000000000000000000000010"
  2554. "0010000000000000000000000000000000000000000000000000001"
  2555. "0001000000000000000000000000000000000000000000000000010"
  2556. "0001010010011011110101000110111001000010100100010101010"
  2557. },
  2558. /* 9*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1AB.D", 0, 9, 55, "Mode '11', alphanumeric [90]",
  2559. "1101100110100011100110111001011111101110010011110101001"
  2560. "1101101110110000110100010001000010100000100011100101001"
  2561. "1101101100101110100001111101110111000111101011101101001"
  2562. "1101101000100011001000011101011011001111000011101001001"
  2563. "1101001000110010000010001101101000111011110011101001101"
  2564. "0001000000000000000000000000000000000000000000000000010"
  2565. "0010000000000000000000000000000000000000000000000000001"
  2566. "0001000000000000000000000000000000000000000000000000010"
  2567. "0001010010011011110101000110111001000010100100010101010"
  2568. },
  2569. /*10*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1AB+D", 0, 9, 55, "Mode '11', ISO-646 [90]",
  2570. "1101100110100011100110111001011111101110010011110101001"
  2571. "1101101110110000110100010001101000111001111011100101001"
  2572. "1101101100111110110100001001100101111101110011101101001"
  2573. "1101101000100001011001111101000111100001001011101001001"
  2574. "1101001000100010000001000101101100100010000011101001101"
  2575. "0001000000000000000000000000000000000000000000000000010"
  2576. "0010000000000000000000000000000000000000000000000000001"
  2577. "0001000000000000000000000000000000000000000000000000010"
  2578. "0001010010011011110101000110111001000010100100010101010"
  2579. },
  2580. /*11*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1A+BD", 0, 9, 55, "Mode '11', immediate ISO-646 [90]",
  2581. "1101100110100011100110111001011111101110010011110101001"
  2582. "1101101110101111000111100101111011101011000011100101001"
  2583. "1101101100101000011110010001001111001011110011101101001"
  2584. "1101101000100111110011001001101111101001000011101001001"
  2585. "1101001000110110001000001001101110001100001011101001101"
  2586. "0001000000000000000000000000000000000000000000000000010"
  2587. "0010000000000000000000000000000000000000000000000000001"
  2588. "0001000000000000000000000000000000000000000000000000010"
  2589. "0001010010011011110101000110111001000010100100010101010"
  2590. },
  2591. /*12*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1AB#D", ZINT_ERROR_INVALID_DATA, 0, 0, "Mode '11', invalid char [90]", "Error 441: Invalid character in input (2D component)" },
  2592. /*13*/ { BARCODE_UPCE_CC, 2, "1234567", "[90]1AB#D", ZINT_ERROR_INVALID_DATA, 0, 0, "Mode '11', invalid char [90]", "Error 441: Invalid character in input (2D component)" },
  2593. /*14*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]A12345[21]AB", 0, 10, 55, "Mode '11', numeric [90], with [21]",
  2594. "1100100010111000111011011001001100011000010011100101101"
  2595. "1110100010101000001111001001111100110100010011000101101"
  2596. "1110110010101110010000110001100111000100111011000101001"
  2597. "1100110010100001100011000101010000010000100011001101001"
  2598. "1101110010111101101110011001101000001110010011011101001"
  2599. "1101111010100001000100111101001010001111000011011001001"
  2600. "0001000000000000000000000000000000000000000000000000010"
  2601. "0010000000000000000000000000000000000000000000000000001"
  2602. "0001000000000000000000000000000000000000000000000000010"
  2603. "0001010010011011110101000110111001000010100100010101010"
  2604. },
  2605. /*15*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1ABC4[21]AB12", 0, 10, 55, "Mode '11', alpha [90], with [21]",
  2606. "1100100010100011100111101101011000111000110011100101101"
  2607. "1110100010111010000110001001110100011000001011000101101"
  2608. "1110110010100001100100011101110111111010100011000101001"
  2609. "1100110010110100100001100001001001111011110011001101001"
  2610. "1101110010111100101100011001111101001000110011011101001"
  2611. "1101111010101110100001100001011101100111000011011001001"
  2612. "0001000000000000000000000000000000000000000000000000010"
  2613. "0010000000000000000000000000000000000000000000000000001"
  2614. "0001000000000000000000000000000000000000000000000000010"
  2615. "0001010010011011110101000110111001000010100100010101010"
  2616. },
  2617. /*16*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1AB.D[21]AB", 0, 10, 55, "Mode '11', alphanumeric [90], with [21]",
  2618. "1100100010110011100011000101110001110110011011100101101"
  2619. "1110100010111101101100100001110010011100011011000101101"
  2620. "1110110010110000110101111001011100110001110011000101001"
  2621. "1100110010110011101100000101101001110001111011001101001"
  2622. "1101110010110110011110001001100110001111001011011101001"
  2623. "1101111010100110111011111001111001000111101011011001001"
  2624. "0001000000000000000000000000000000000000000000000000010"
  2625. "0010000000000000000000000000000000000000000000000000001"
  2626. "0001000000000000000000000000000000000000000000000000010"
  2627. "0001010010011011110101000110111001000010100100010101010"
  2628. },
  2629. /*17*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1AB+D[21]A.", 0, 10, 55, "Mode '11', ISO-646 [90], with [21]; **NOT SAME** as tec-it.com, which probably includes '21' in 5 alphanumeric count",
  2630. "1100100010110011100011000101110001110110011011100101101"
  2631. "1110100010111101101100100001110101110001100011000101101"
  2632. "1110110010100000111000101101110010111110001011000101001"
  2633. "1100110010110111011000100001110110000100011011001101001"
  2634. "1101110010111000010001100101111010001110111011011101001"
  2635. "1101111010110001100100111101111101001110010011011001001"
  2636. "0001000000000000000000000000000000000000000000000000010"
  2637. "0010000000000000000000000000000000000000000000000000001"
  2638. "0001000000000000000000000000000000000000000000000000010"
  2639. "0001010010011011110101000110111001000010100100010101010"
  2640. },
  2641. /*18*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1A+BD[21]A12", 0, 11, 55, "Mode '11', immediate ISO-646 [90], with [21]; tec-it.com same, probably since have 5 alphanumerics with or without '21'",
  2642. "1110110110111100011000110101100111101011111011100010101"
  2643. "1110010110100100001101111101000100010111100011000010101"
  2644. "1100010110100010100000100001110011101000001011000110101"
  2645. "1100010100100001011111011001010111110110000011000100101"
  2646. "1100110100100000011010011101110001111101011011100100101"
  2647. "1101110100100000100011011001100001101001000011110100101"
  2648. "1101100100111010111100011101011110100011110011110101101"
  2649. "0001000000000000000000000000000000000000000000000000010"
  2650. "0010000000000000000000000000000000000000000000000000001"
  2651. "0001000000000000000000000000000000000000000000000000010"
  2652. "0001010010011011110101000110111001000010100100010101010"
  2653. },
  2654. /*19*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]A12[8004]12", 0, 9, 55, "Mode '11', numeric [90], with [8004]",
  2655. "1101100110110001111010011001000001101101111011110101001"
  2656. "1101101110110100100000110001011100111101100011100101001"
  2657. "1101101100110100000111010001100100001110001011101101001"
  2658. "1101101000101110001001100001101111001011000011101001001"
  2659. "1101001000100100110000110001101000010000110011101001101"
  2660. "0001000000000000000000000000000000000000000000000000010"
  2661. "0010000000000000000000000000000000000000000000000000001"
  2662. "0001000000000000000000000000000000000000000000000000010"
  2663. "0001010010011011110101000110111001000010100100010101010"
  2664. },
  2665. /*20*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]AB[8004]12", 0, 9, 55, "Mode '11', alpha [90], with [8004]",
  2666. "1101100110100111110011001001100101111110010011110101001"
  2667. "1101101110101000100000100001011000111001100011100101001"
  2668. "1101101100100111110100011101111000100001001011101101001"
  2669. "1101101000101000110011111001010001110111111011101001001"
  2670. "1101001000110011101100001001111011100001011011101001101"
  2671. "0001000000000000000000000000000000000000000000000000010"
  2672. "0010000000000000000000000000000000000000000000000000001"
  2673. "0001000000000000000000000000000000000000000000000000010"
  2674. "0001010010011011110101000110111001000010100100010101010"
  2675. },
  2676. /*21*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]A.[8004]12", 0, 9, 55, "Mode '11', alphanumeric [90], with [8004]",
  2677. "1101100110110111110011001101111110100110001011110101001"
  2678. "1101101110100010001001000001100101100011100011100101001"
  2679. "1101101100100001011110001001100001100111101011101101001"
  2680. "1101101000100111100100001001011110001110111011101001001"
  2681. "1101001000101101111100111101100011010100000011101001101"
  2682. "0001000000000000000000000000000000000000000000000000010"
  2683. "0010000000000000000000000000000000000000000000000000001"
  2684. "0001000000000000000000000000000000000000000000000000010"
  2685. "0001010010011011110101000110111001000010100100010101010"
  2686. },
  2687. /*22*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]A+[8004]12", 0, 9, 55, "Mode '11', ISO-646 [90], with [8004]",
  2688. "1101100110110111110011001101111110100110001011110101001"
  2689. "1101101110111100110010111001001110001110100011100101001"
  2690. "1101101100111001011100011001101001110000010011101101001"
  2691. "1101101000101100000110111101000110001001110011101001001"
  2692. "1101001000100011000110000101111100110101111011101001101"
  2693. "0001000000000000000000000000000000000000000000000000010"
  2694. "0010000000000000000000000000000000000000000000000000001"
  2695. "0001000000000000000000000000000000000000000000000000010"
  2696. "0001010010011011110101000110111001000010100100010101010"
  2697. },
  2698. /*23*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]12A1[10]12", 0, 9, 55, "Mode '11', numeric [90], other data",
  2699. "1101100110100111100000101001011001101111000011110101001"
  2700. "1101101110111000101101111001110110100001100011100101001"
  2701. "1101101100111100001010001001110000100110010011101101001"
  2702. "1101101000100000111010001101001000011011111011101001001"
  2703. "1101001000100010111011100001100001101100011011101001101"
  2704. "0001000000000000000000000000000000000000000000000000010"
  2705. "0010000000000000000000000000000000000000000000000000001"
  2706. "0001000000000000000000000000000000000000000000000000010"
  2707. "0001010010011011110101000110111001000010100100010101010"
  2708. },
  2709. /*24*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]123AB[10]12", 0, 9, 55, "Mode '11', alpha [90], other data",
  2710. "1101100110100111110110010001100011101000111011110101001"
  2711. "1101101110111001110100000101100110001100110011100101001"
  2712. "1101101100110110011111001101111010100001000011101101001"
  2713. "1101101000100110111011111001000001100010111011101001001"
  2714. "1101001000110010010000110001011110011110010011101001101"
  2715. "0001000000000000000000000000000000000000000000000000010"
  2716. "0010000000000000000000000000000000000000000000000000001"
  2717. "0001000000000000000000000000000000000000000000000000010"
  2718. "0001010010011011110101000110111001000010100100010101010"
  2719. },
  2720. /*25*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]123AB.D[10]12", 0, 10, 55, "Mode '11', alphanumeric [90], other data",
  2721. "1100100010100011000110000101110110000100110011100101101"
  2722. "1110100010101101111100100001011111001001110011000101101"
  2723. "1110110010101111100110001001101111001000110011000101001"
  2724. "1100110010110110111100111101010111110111110011001101001"
  2725. "1101110010101000011111001101111100110100100011011101001"
  2726. "1101111010110011111100110101110101111101000011011001001"
  2727. "0001000000000000000000000000000000000000000000000000010"
  2728. "0010000000000000000000000000000000000000000000000000001"
  2729. "0001000000000000000000000000000000000000000000000000010"
  2730. "0001010010011011110101000110111001000010100100010101010"
  2731. },
  2732. /*26*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]123AB+D[10]12", 0, 10, 55, "Mode '11', ISO-646 [90], other data",
  2733. "1100100010100011000110000101110110000100110011100101101"
  2734. "1110100010101101111100100001100100111000001011000101101"
  2735. "1110110010100010110011111001000110100111000011000101001"
  2736. "1100110010111011100100001001110010110011110011001101001"
  2737. "1101110010111101000000100101111001101101000011011101001"
  2738. "1101111010101101000001110001101111100001001011011001001"
  2739. "0001000000000000000000000000000000000000000000000000010"
  2740. "0010000000000000000000000000000000000000000000000000001"
  2741. "0001000000000000000000000000000000000000000000000000010"
  2742. "0001010010011011110101000110111001000010100100010101010"
  2743. },
  2744. /*27*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]A123[21]AB[91]A123", 0, 12, 55, "Mode '11', numeric [90], with [21], other data",
  2745. "1110111010100001100111110101100010011110110011011011101"
  2746. "1110011010111111011011100101001110110011100011011011001"
  2747. "1111011010101000111011100001001011110011110011011010001"
  2748. "1111001010111100100100100001111010111101111011010010001"
  2749. "1110001010101100110111100001100111110100010011010110001"
  2750. "1100001010100110111001100001111101111001011011010111001"
  2751. "1100011010111110001011011101101001110010000011010111101"
  2752. "1100010010111001110010111101101111101100110011010011101"
  2753. "0001000000000000000000000000000000000000000000000000010"
  2754. "0010000000000000000000000000000000000000000000000000001"
  2755. "0001000000000000000000000000000000000000000000000000010"
  2756. "0001010010011011110101000110111001000010100100010101010"
  2757. },
  2758. /*28*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]AB[8004]12[10]12", 0, 10, 55, "Mode '11', alpha [90], with [8004], other data",
  2759. "1100100010110000110000101001101111011101000011100101101"
  2760. "1110100010110100011110001101001110001011111011000101101"
  2761. "1110110010100011100110111001011101101110000011000101001"
  2762. "1100110010100000100010001001010000010000100011001101001"
  2763. "1101110010111010000110000101101011100010000011011101001"
  2764. "1101111010110011110010001101000111101100110011011001001"
  2765. "0001000000000000000000000000000000000000000000000000010"
  2766. "0010000000000000000000000000000000000000000000000000001"
  2767. "0001000000000000000000000000000000000000000000000000010"
  2768. "0001010010011011110101000110111001000010100100010101010"
  2769. },
  2770. /*29*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]12A1234B", 0, 9, 55, "Mode '11', alphanumeric [90], with first 4 digits (choosing NUMERIC would be better, not implemented)",
  2771. "1101100110100011100110111001001111100011001011110101001"
  2772. "1101101110100101100000110001111010110011111011100101001"
  2773. "1101101100111100000101001001111110111101101011101101001"
  2774. "1101101000100000011101011001001110100000110011101001001"
  2775. "1101001000111000110100011001100011000010001011101001101"
  2776. "0001000000000000000000000000000000000000000000000000010"
  2777. "0010000000000000000000000000000000000000000000000000001"
  2778. "0001000000000000000000000000000000000000000000000000010"
  2779. "0001010010011011110101000110111001000010100100010101010"
  2780. },
  2781. /*30*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]1.A", 0, 9, 55, "Fails Mode '11' test2, starting with digits then uppercase",
  2782. "1101100110111001101111110101111010000111101011110101001"
  2783. "1101101110110010001100111001000001000010001011100101001"
  2784. "1101101100100010111100100001110011011101000011101101001"
  2785. "1101101000111001010111111001011100000100011011101001001"
  2786. "1101001000111010001011100001101100001001000011101001101"
  2787. "0001000000000000000000000000000000000000000000000000010"
  2788. "0010000000000000000000000000000000000000000000000000001"
  2789. "0001000000000000000000000000000000000000000000000000010"
  2790. "0001010010011011110101000110111001000010100100010101010"
  2791. },
  2792. /*31*/ { BARCODE_UPCE_CC, 1, "1234567", "[90]01A", 0, 9, 55, "Fails Mode '11' test3, no leading zeroes",
  2793. "1101100110111001101111110101000101011110000011110101001"
  2794. "1101101110101101111011100001000100111011100011100101001"
  2795. "1101101100111110111011101101111000001010010011101101001"
  2796. "1101101000101111001101100001111011001111101011101001001"
  2797. "1101001000111011111011100101110001010111000011101001101"
  2798. "0001000000000000000000000000000000000000000000000000010"
  2799. "0010000000000000000000000000000000000000000000000000001"
  2800. "0001000000000000000000000000000000000000000000000000010"
  2801. "0001010010011011110101000110111001000010100100010101010"
  2802. },
  2803. };
  2804. const int data_size = ARRAY_SIZE(data);
  2805. int i, length, composite_length, ret;
  2806. struct zint_symbol *symbol = NULL;
  2807. char bwipp_buf[8192];
  2808. char bwipp_msg[1024];
  2809. int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
  2810. testStartSymbol("test_encodation_11", &symbol);
  2811. for (i = 0; i < data_size; i++) {
  2812. if (testContinue(p_ctx, i)) continue;
  2813. symbol = ZBarcode_Create();
  2814. assert_nonnull(symbol, "Symbol not created\n");
  2815. length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  2816. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  2817. strcpy(symbol->primary, data[i].data);
  2818. composite_length = (int) strlen(data[i].composite);
  2819. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  2820. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  2821. if (p_ctx->generate) {
  2822. test_helper_generate(symbol, ret, i, data[i].data, data[i].composite, data[i].option_1, data[i].comment, -1 /*bwipp_cmp*/);
  2823. } else {
  2824. assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
  2825. assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
  2826. if (ret < ZINT_ERROR) {
  2827. int width, row;
  2828. ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
  2829. assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
  2830. if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
  2831. ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
  2832. assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
  2833. ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
  2834. assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
  2835. i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
  2836. }
  2837. }
  2838. }
  2839. ZBarcode_Delete(symbol);
  2840. }
  2841. testFinish();
  2842. }
  2843. static void test_addongap(const testCtx *const p_ctx) {
  2844. int debug = p_ctx->debug;
  2845. struct item {
  2846. int symbology;
  2847. int option_1;
  2848. int option_2;
  2849. char *data;
  2850. int ret;
  2851. int expected_rows;
  2852. int expected_width;
  2853. char *comment;
  2854. char *expected;
  2855. };
  2856. /* Verified via bwipp_dump.ps against BWIPP */
  2857. static const struct item data[] = {
  2858. /* 0*/ { BARCODE_EANX_CC, 1, -1, "1234567+12", 0, 8, 98, "EAN-8 default 7 gap",
  2859. "10010001111100110101001100011110001011001100110110011110000101110100110100000000000000000000000000"
  2860. "10000011100101100101011100010111100010001000100000100101111001110101110100000000000000000000000000"
  2861. "11001101001000000101011000011010011100011110110001100110011001110101100100000000000000000000000000"
  2862. "11111000101001100101001000011100001011100110111000110111010001110101000100000000000000000000000000"
  2863. "00001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  2864. "00010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000"
  2865. "00001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  2866. "00001010011001001001101111010100011010101001110101000010001001110010101000000010110011001010010011"
  2867. },
  2868. /* 1*/ { BARCODE_EANX_CC, 1, 8, "1234567+12", 0, 8, 99, "EAN-8 8 gap",
  2869. "100100011111001101010011000111100010110011001101100111100001011101001101000000000000000000000000000"
  2870. "100000111001011001010111000101111000100010001000001001011110011101011101000000000000000000000000000"
  2871. "110011010010000001010110000110100111000111101100011001100110011101011001000000000000000000000000000"
  2872. "111110001010011001010010000111000010111001101110001101110100011101010001000000000000000000000000000"
  2873. "000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000"
  2874. "000100000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000"
  2875. "000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000"
  2876. "000010100110010010011011110101000110101010011101010000100010011100101010000000010110011001010010011"
  2877. },
  2878. /* 2*/ { BARCODE_EANX_CC, 1, -1, "123456789012+12345", 0, 7, 152, "EAN-13 default 7 gap",
  2879. "11011011101111001101001110011100010001001110100111010010001011000001100111100111101000101101100010100000000000000000000000000000000000000000000000000000"
  2880. "11011011001100010001110010011100110001110010100110010010010001111101100111101001010000001100100010100000000000000000000000000000000000000000000000000000"
  2881. "11011010001110111110101100010000101011110000100110011010000110001001110101111101100000101110100010100000000000000000000000000000000000000000000000000000"
  2882. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
  2883. "00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000"
  2884. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000"
  2885. "00010100100110111101001110101100010000101001000101010100100011101001110010110011011011001001000101000000010110110011010010011010100001010100011010110001"
  2886. },
  2887. /* 3*/ { BARCODE_EANX_CC, 1, 9, "123456789012+12345", 0, 7, 154, "EAN-13 9 gap",
  2888. "1101101110111100110100111001110001000100111010011101001000101100000110011110011110100010110110001010000000000000000000000000000000000000000000000000000000"
  2889. "1101101100110001000111001001110011000111001010011001001001000111110110011110100101000000110010001010000000000000000000000000000000000000000000000000000000"
  2890. "1101101000111011111010110001000010101111000010011001101000011000100111010111110110000010111010001010000000000000000000000000000000000000000000000000000000"
  2891. "0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
  2892. "0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000"
  2893. "0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
  2894. "0001010010011011110100111010110001000010100100010101010010001110100111001011001101101100100100010100000000010110110011010010011010100001010100011010110001"
  2895. },
  2896. /* 4*/ { BARCODE_UPCA_CC, 1, -1, "12345678901+12345", 0, 7, 154, "UPC-A default 9 gap",
  2897. "1101101110111100110100111001110001000100111010011101001000101100000110011110011110100010110110001010000000000000000000000000000000000000000000000000000000"
  2898. "1101101100110001000111001001110011000111001010011001001001000111110110011110100101000000110010001010000000000000000000000000000000000000000000000000000000"
  2899. "1101101000111011111010110001000010101111000010011001101000011000100111010111110110000010111010001010000000000000000000000000000000000000000000000000000000"
  2900. "0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
  2901. "0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000"
  2902. "0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
  2903. "0001010011001001001101111010100011011000101011110101010001001001000111010011100101100110110110010100000000010110110011010010011010100001010100011010110001"
  2904. },
  2905. /* 5*/ { BARCODE_UPCA_CC, 1, 10, "12345678901+12345", 0, 7, 155, "UPC-A 10 gap",
  2906. "11011011101111001101001110011100010001001110100111010010001011000001100111100111101000101101100010100000000000000000000000000000000000000000000000000000000"
  2907. "11011011001100010001110010011100110001110010100110010010010001111101100111101001010000001100100010100000000000000000000000000000000000000000000000000000000"
  2908. "11011010001110111110101100010000101011110000100110011010000110001001110101111101100000101110100010100000000000000000000000000000000000000000000000000000000"
  2909. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000"
  2910. "00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000"
  2911. "00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000"
  2912. "00010100110010010011011110101000110110001010111101010100010010010001110100111001011001101101100101000000000010110110011010010011010100001010100011010110001"
  2913. },
  2914. /* 6*/ { BARCODE_UPCE_CC, 1, -1, "1234567+12", 0, 9, 81, "UPC-E default 7 gap",
  2915. "110110011011101110101111000110111111011001001111010100100000000000000000000000000"
  2916. "110110111010111001111001100100110011000010001110010100100000000000000000000000000"
  2917. "110110110010010111101000000110100000111010001110110100100000000000000000000000000"
  2918. "110110100011001001000111110101100001100111101110100100100000000000000000000000000"
  2919. "110100100011001000001001100110100100011000001110100110100000000000000000000000000"
  2920. "000100000000000000000000000000000000000000000000000001000000000000000000000000000"
  2921. "001000000000000000000000000000000000000000000000000000100000000000000000000000000"
  2922. "000100000000000000000000000000000000000000000000000001000000000000000000000000000"
  2923. "000101001001101111010100011011100100001010010001010101000000010110011001010010011"
  2924. },
  2925. /* 7*/ { BARCODE_UPCE_CC, 1, 12, "1234567+12", 0, 9, 86, "UPC-E 12 gap",
  2926. "11011001101110111010111100011011111101100100111101010010000000000000000000000000000000"
  2927. "11011011101011100111100110010011001100001000111001010010000000000000000000000000000000"
  2928. "11011011001001011110100000011010000011101000111011010010000000000000000000000000000000"
  2929. "11011010001100100100011111010110000110011110111010010010000000000000000000000000000000"
  2930. "11010010001100100000100110011010010001100000111010011010000000000000000000000000000000"
  2931. "00010000000000000000000000000000000000000000000000000100000000000000000000000000000000"
  2932. "00100000000000000000000000000000000000000000000000000010000000000000000000000000000000"
  2933. "00010000000000000000000000000000000000000000000000000100000000000000000000000000000000"
  2934. "00010100100110111101010001101110010000101001000101010100000000000010110011001010010011"
  2935. },
  2936. };
  2937. const int data_size = ARRAY_SIZE(data);
  2938. int i, length, composite_length, ret;
  2939. struct zint_symbol *symbol = NULL;
  2940. char bwipp_buf[8192];
  2941. char bwipp_msg[1024];
  2942. char *composite = "[91]12";
  2943. int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
  2944. testStartSymbol("test_addongap", &symbol);
  2945. for (i = 0; i < data_size; i++) {
  2946. if (testContinue(p_ctx, i)) continue;
  2947. symbol = ZBarcode_Create();
  2948. assert_nonnull(symbol, "Symbol not created\n");
  2949. length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
  2950. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  2951. strcpy(symbol->primary, data[i].data);
  2952. composite_length = (int) strlen(composite);
  2953. ret = ZBarcode_Encode(symbol, (const unsigned char *) composite, composite_length);
  2954. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  2955. if (p_ctx->generate) {
  2956. printf(" /*%3d*/ { %s, %d, %d, \"%s\", %s, %d, %d, \"%s\",\n",
  2957. i, testUtilBarcodeName(data[i].symbology), data[i].option_1, data[i].option_2, data[i].data,
  2958. testUtilErrorName(data[i].ret), symbol->rows, symbol->width, data[i].comment);
  2959. testUtilModulesPrint(symbol, " ", "\n");
  2960. printf(" },\n");
  2961. } else {
  2962. int width, row;
  2963. assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data);
  2964. assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data);
  2965. ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row);
  2966. assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data);
  2967. if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, debug)) {
  2968. ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
  2969. assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
  2970. ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected);
  2971. assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
  2972. i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected);
  2973. }
  2974. }
  2975. ZBarcode_Delete(symbol);
  2976. }
  2977. testFinish();
  2978. }
  2979. static void test_gs1parens(const testCtx *const p_ctx) {
  2980. int debug = p_ctx->debug;
  2981. struct item {
  2982. int symbology;
  2983. int input_mode;
  2984. char *data;
  2985. char *composite;
  2986. int ret;
  2987. int expected_rows;
  2988. int expected_width;
  2989. };
  2990. /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
  2991. static const struct item data[] = {
  2992. /* 0*/ { BARCODE_EANX_CC, -1, "1234567", "[21]A12345678", 0, 8, 72 }, /* EAN-8 */
  2993. /* 1*/ { BARCODE_EANX_CC, GS1PARENS_MODE, "1234567", "(21)A12345678", 0, 8, 72 }, /* EAN-8 */
  2994. /* 2*/ { BARCODE_EANX_CC, -1, "123456789012", "[21]A12345678", 0, 7, 99 }, /* EAN-13 */
  2995. /* 3*/ { BARCODE_EANX_CC, GS1PARENS_MODE, "123456789012", "(21)A12345678", 0, 7, 99 }, /* EAN-13 */
  2996. /* 4*/ { BARCODE_GS1_128_CC, -1, "[01]12345678901231", "[21]A12345678", 0, 5, 145 },
  2997. /* 5*/ { BARCODE_GS1_128_CC, GS1PARENS_MODE, "(01)12345678901231", "(21)A12345678", 0, 5, 145 },
  2998. /* 6*/ { BARCODE_DBAR_OMN_CC, -1, "12345678901231", "[21]A12345678", 0, 5, 100 },
  2999. /* 7*/ { BARCODE_DBAR_OMN_CC, GS1PARENS_MODE, "12345678901231", "(21)A12345678", 0, 5, 100 },
  3000. /* 8*/ { BARCODE_DBAR_LTD_CC, -1, "12345678901231", "[21]A12345678", 0, 6, 79 },
  3001. /* 9*/ { BARCODE_DBAR_LTD_CC, GS1PARENS_MODE, "12345678901231", "(21)A12345678", 0, 6, 79 },
  3002. /* 10*/ { BARCODE_DBAR_EXP_CC, -1, "[01]12345678901231[3103]001234", "[21]A12345678", 0, 5, 200 },
  3003. /* 11*/ { BARCODE_DBAR_EXP_CC, GS1PARENS_MODE, "(01)12345678901231(3103)001234", "(21)A12345678", 0, 5, 200 },
  3004. /* 12*/ { BARCODE_UPCA_CC, -1, "12345678901", "[21]A12345678", 0, 7, 99 },
  3005. /* 13*/ { BARCODE_UPCA_CC, GS1PARENS_MODE, "12345678901", "(21)A12345678", 0, 7, 99 },
  3006. /* 14*/ { BARCODE_UPCE_CC, -1, "1234567", "[21]A12345678", 0, 9, 55 },
  3007. /* 15*/ { BARCODE_UPCE_CC, GS1PARENS_MODE, "1234567", "(21)A12345678", 0, 9, 55 },
  3008. /* 16*/ { BARCODE_DBAR_STK_CC, -1, "12345678901231", "[21]A12345678", 0, 9, 56 },
  3009. /* 17*/ { BARCODE_DBAR_STK_CC, GS1PARENS_MODE, "12345678901231", "(21)A12345678", 0, 9, 56 },
  3010. /* 18*/ { BARCODE_DBAR_OMNSTK_CC, -1, "12345678901231", "[21]A12345678", 0, 11, 56 },
  3011. /* 19*/ { BARCODE_DBAR_OMNSTK_CC, GS1PARENS_MODE, "12345678901231", "(21)A12345678", 0, 11, 56 },
  3012. /* 20*/ { BARCODE_DBAR_EXPSTK_CC, -1, "[01]12345678901231[3103]001234", "[21]A12345678", 0, 9, 102 },
  3013. /* 21*/ { BARCODE_DBAR_EXPSTK_CC, GS1PARENS_MODE, "(01)12345678901231(3103)001234", "(21)A12345678", 0, 9, 102 },
  3014. };
  3015. const int data_size = ARRAY_SIZE(data);
  3016. int i, length, composite_length, ret;
  3017. struct zint_symbol *symbol = NULL;
  3018. testStartSymbol("test_gs1parens", &symbol);
  3019. for (i = 0; i < data_size; i++) {
  3020. if (testContinue(p_ctx, i)) continue;
  3021. symbol = ZBarcode_Create();
  3022. assert_nonnull(symbol, "Symbol not created\n");
  3023. length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  3024. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  3025. strcpy(symbol->primary, data[i].data);
  3026. composite_length = (int) strlen(data[i].composite);
  3027. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  3028. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  3029. assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d\n", i, symbol->rows, data[i].expected_rows);
  3030. assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n", i, symbol->width, data[i].expected_width);
  3031. ZBarcode_Delete(symbol);
  3032. }
  3033. testFinish();
  3034. }
  3035. static void test_hrt(const testCtx *const p_ctx) {
  3036. int debug = p_ctx->debug;
  3037. struct item {
  3038. int symbology;
  3039. int input_mode;
  3040. char *data;
  3041. char *composite;
  3042. int ret;
  3043. char *expected;
  3044. };
  3045. /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
  3046. static const struct item data[] = {
  3047. /* 0*/ { BARCODE_EANX_CC, -1, "1234567", "[20]12", 0, "12345670" }, /* EAN-8 */
  3048. /* 1*/ { BARCODE_EANX_CC, -1, "123456789012", "[20]12", 0, "1234567890128" }, /* EAN-13 */
  3049. /* 2*/ { BARCODE_EANX_CC, -1, "1234567890128", "[20]12", 0, "1234567890128" },
  3050. /* 3*/ { BARCODE_EANX_CC, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "" },
  3051. /* 4*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, "" }, /* Still checked */
  3052. /* 5*/ { BARCODE_EANX_CC, -1, "1234567890128", "[20]1A", ZINT_WARN_NONCOMPLIANT, "1234567890128" }, /* AI (20) should be 2 nos. */
  3053. /* 6*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, "1234567890128", "[20]1A", 0, "1234567890128" },
  3054. /* 7*/ { BARCODE_DBAR_OMN_CC, -1, "1234567890123", "[20]12", 0, "(01)12345678901231" },
  3055. /* 8*/ { BARCODE_DBAR_OMN_CC, -1, "12345678901231", "[20]12", 0, "(01)12345678901231" },
  3056. /* 9*/ { BARCODE_DBAR_OMN_CC, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "" },
  3057. /* 10*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "" }, /* Still checked */
  3058. /* 11*/ { BARCODE_DBAR_OMN_CC, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, "(01)12345678901231" }, /* AI (20) should be 2 nos. */
  3059. /* 12*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, "12345678901231", "[20]1A", 0, "(01)12345678901231" },
  3060. /* 13*/ { BARCODE_DBAR_LTD_CC, -1, "1234567890123", "[20]12", 0, "(01)12345678901231" },
  3061. /* 14*/ { BARCODE_DBAR_LTD_CC, -1, "12345678901231", "[20]12", 0, "(01)12345678901231" },
  3062. /* 15*/ { BARCODE_DBAR_LTD_CC, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "" },
  3063. /* 16*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, "" }, /* Still checked */
  3064. /* 17*/ { BARCODE_DBAR_LTD_CC, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, "(01)12345678901231" }, /* AI (20) should be 2 nos. */
  3065. /* 18*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, "12345678901231", "[20]1A", 0, "(01)12345678901231" },
  3066. /* 19*/ { BARCODE_UPCA_CC, -1, "12345678901", "[20]12", 0, "123456789012" },
  3067. /* 20*/ { BARCODE_UPCA_CC, -1, "123456789012", "[20]12", 0, "123456789012" },
  3068. /* 21*/ { BARCODE_UPCA_CC, -1, "123456789013", "[20]12", ZINT_ERROR_INVALID_CHECK, "" },
  3069. /* 22*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, "123456789013", "[20]12", ZINT_ERROR_INVALID_CHECK, "" }, /* Still checked */
  3070. /* 23*/ { BARCODE_UPCA_CC, -1, "123456789012", "[20]1A", ZINT_WARN_NONCOMPLIANT, "123456789012" }, /* AI (20) should be 2 nos. */
  3071. /* 24*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, "123456789012", "[20]1A", 0, "123456789012" },
  3072. /* 25*/ { BARCODE_UPCE_CC, -1, "123456", "[20]12", 0, "01234565" },
  3073. /* 26*/ { BARCODE_UPCE_CC, -1, "1234567", "[20]12", 0, "12345670" },
  3074. /* 27*/ { BARCODE_UPCE_CC, -1, "12345670", "[20]12", 0, "12345670" },
  3075. /* 28*/ { BARCODE_UPCE_CC, -1, "12345671", "[20]12", ZINT_ERROR_INVALID_CHECK, "" },
  3076. /* 29*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, "12345671", "[20]12", ZINT_ERROR_INVALID_CHECK, "" }, /* Still checked */
  3077. /* 30*/ { BARCODE_UPCE_CC, -1, "12345670", "[20]12", 0, "12345670" }, /* Check digit can now be given for UPCE_CC, like UPCA_CC */
  3078. /* 31*/ { BARCODE_UPCE_CC, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, "12345670" }, /* AI (20) should be 2 nos. */
  3079. /* 32*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, "1234567", "[20]1A", 0, "12345670" },
  3080. /* 33*/ { BARCODE_DBAR_STK_CC, -1, "12345678901231", "[20]12", 0, "" }, /* No HRT for stacked symbologies */
  3081. /* 34*/ { BARCODE_DBAR_OMNSTK_CC, -1, "12345678901231", "[20]12", 0, "" },
  3082. };
  3083. const int data_size = ARRAY_SIZE(data);
  3084. int i, length, composite_length, ret;
  3085. struct zint_symbol *symbol = NULL;
  3086. testStartSymbol("test_hrt", &symbol);
  3087. for (i = 0; i < data_size; i++) {
  3088. if (testContinue(p_ctx, i)) continue;
  3089. symbol = ZBarcode_Create();
  3090. assert_nonnull(symbol, "Symbol not created\n");
  3091. length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  3092. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  3093. strcpy(symbol->primary, data[i].data);
  3094. composite_length = (int) strlen(data[i].composite);
  3095. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  3096. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, data[i].ret, ret, symbol->errtxt);
  3097. assert_zero(strcmp((const char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
  3098. ZBarcode_Delete(symbol);
  3099. }
  3100. testFinish();
  3101. }
  3102. /* See also `test_gs1nocheck_mode()` in "test.gs1.c" for GS1_128-based and DBAR_EXP-based symbologies */
  3103. static void test_input(const testCtx *const p_ctx) {
  3104. int debug = p_ctx->debug;
  3105. struct item {
  3106. int symbology;
  3107. int input_mode;
  3108. int option_1;
  3109. int option_2;
  3110. int option_3;
  3111. char *data;
  3112. char *composite;
  3113. int ret;
  3114. int expected_rows;
  3115. int expected_width;
  3116. char *expected_errtxt;
  3117. };
  3118. /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
  3119. static const struct item data[] = {
  3120. /* 0*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567", "[20]12", 0, 8, 72, "" }, /* EAN-8 */
  3121. /* 1*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "123456A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 7 in input (digits and \"+\" only) (linear component)" }, /* EAN-8 */
  3122. /* 2*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 7 in input (digits and \"+\" only) (linear component)" }, /* Linear component still checked */
  3123. /* 3*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" },
  3124. /* 4*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[20]1A", 0, 8, 72, "" },
  3125. /* 5*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 8, 72, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)" },
  3126. /* 6*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[02]12345678901234", 0, 8, 72, "" },
  3127. /* 7*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "12345671", "[20]12", 0, 7, 99, "" }, /* EAN-13 for EANX_CC as length 8 only EAN-8 for EANX_CHK */
  3128. /* 8*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "123456789012", "[20]12", 0, 7, 99, "" }, /* EAN-13 */
  3129. /* 9*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[20]12", 0, 7, 99, "" }, /* EAN-13 */
  3130. /* 10*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 275: Invalid check digit '3', expecting '8' (linear component)" },
  3131. /* 11*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 275: Invalid check digit '3', expecting '8' (linear component)" }, /* Linear component still checked */
  3132. /* 12*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "12345678901234", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 294: Input length 14 too long (maximum 13) (linear component)" },
  3133. /* 13*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901234", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 294: Input length 14 too long (maximum 13) (linear component)" },
  3134. /* 14*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "123456789012A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 13 in input (digits and \"+\" only) (linear component)" },
  3135. /* 15*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 13 in input (digits and \"+\" only) (linear component)" },
  3136. /* 16*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[20]1A", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" }, /* AI (20) should be 2 nos. */
  3137. /* 17*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890128", "[20]1A", 0, 7, 99, "" },
  3138. /* 18*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)" },
  3139. /* 19*/ { BARCODE_EANX_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890128", "[02]12345678901234", 0, 7, 99, "" },
  3140. /* 20*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567", 0, 48, 99, "" }, /* Max CC-B for EAN-13 */
  3141. /* 21*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "1234567890128", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]1234567890123456789012345678901234567890123456789012345678", ZINT_ERROR_TOO_LONG, -1, -1, "Error 444: Input too long (2D component)" },
  3142. /* 22*/ { BARCODE_EANX_CC, -1, 3, -1, -1, "1234567890128", "[20]12", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 447: Invalid mode (CC-C only valid with GS1-128 linear component)" },
  3143. /* 23*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "123456789012345678901", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 449: Input length 21 wrong (linear component)" },
  3144. /* 24*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "1234567890123", "[20]12", 0, 5, 100, "" },
  3145. /* 25*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "12345678901231", "[20]12", 0, 5, 100, "" },
  3146. /* 26*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '2', expecting '1' (linear component)" },
  3147. /* 27*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '2', expecting '1' (linear component)" }, /* Linear component still checked */
  3148. /* 28*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "123456789012312", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)" },
  3149. /* 29*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012312", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)" },
  3150. /* 30*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)" },
  3151. /* 31*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)" },
  3152. /* 32*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 5, 100, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" }, /* AI (20) should be 2 nos. */
  3153. /* 33*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[20]1A", 0, 5, 100, "" },
  3154. /* 34*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 5, 100, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)" },
  3155. /* 35*/ { BARCODE_DBAR_OMN_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[02]12345678901234", 0, 5, 100, "" },
  3156. /* 36*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "1234567890123", "[20]12", 0, 6, 79, "" },
  3157. /* 37*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901231", "[20]12", 0, 6, 79, "" },
  3158. /* 38*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '2', expecting '1' (linear component)" },
  3159. /* 39*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 389: Invalid check digit '2', expecting '1' (linear component)" }, /* Linear component still checked */
  3160. /* 40*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "123456789012345", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 15 too long (maximum 14) (linear component)" },
  3161. /* 41*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012345", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 382: Input length 15 too long (maximum 14) (linear component)" },
  3162. /* 42*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "A1234567890123", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character at position 1 in input (digits only) (linear component)" },
  3163. /* 43*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "A1234567890123", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 383: Invalid character at position 1 in input (digits only) (linear component)" },
  3164. /* 44*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 6, 79, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" }, /* AI (20) should be 2 nos. */
  3165. /* 45*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[20]1A", 0, 6, 79, "" },
  3166. /* 46*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 6, 79, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)" },
  3167. /* 47*/ { BARCODE_DBAR_LTD_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[02]12345678901234", 0, 6, 79, "" },
  3168. /* 48*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "12345678901", "[20]12", 0, 7, 99, "" },
  3169. /* 49*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789012", "[20]12", 0, 7, 99, "" },
  3170. /* 50*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789013", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 270: Invalid check digit '3', expecting '2' (linear component)" },
  3171. /* 51*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789013", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 270: Invalid check digit '3', expecting '2' (linear component)" }, /* Linear component still checked */
  3172. /* 52*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 289: Input length 13 wrong (11 or 12 only) (linear component)" },
  3173. /* 53*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 289: Input length 13 wrong (11 or 12 only) (linear component)" },
  3174. /* 54*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "12345678901A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 12 in input (digits and \"+\" only) (linear component)" },
  3175. /* 55*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 12 in input (digits and \"+\" only) (linear component)" },
  3176. /* 56*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789012", "[20]1A", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" }, /* AI (20) should be 2 nos. */
  3177. /* 57*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012", "[20]1A", 0, 7, 99, "" },
  3178. /* 58*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "123456789012", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 7, 99, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)" },
  3179. /* 59*/ { BARCODE_UPCA_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012", "[02]12345678901234", 0, 7, 99, "" },
  3180. /* 60*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "123456", "[20]12", 0, 9, 55, "" },
  3181. /* 61*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567", "[20]12", 0, 9, 55, "" },
  3182. /* 62*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "12345670", "[20]12", 0, 9, 55, "" }, /* Check digit can now be given for UPCE_CC, like UPCA_CC */
  3183. /* 63*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "12345671", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 274: Invalid check digit '1', expecting '0' (linear component)" },
  3184. /* 64*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345671", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 274: Invalid check digit '1', expecting '0' (linear component)" }, /* Linear component still checked */
  3185. /* 65*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "123456712", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 291: Input length 9 wrong (6, 7 or 8 only) (linear component)" },
  3186. /* 66*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456712", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 291: Input length 9 wrong (6, 7 or 8 only) (linear component)" },
  3187. /* 67*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 8 in input (digits and \"+\" only) (linear component)" },
  3188. /* 68*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 284: Invalid character at position 8 in input (digits and \"+\" only) (linear component)" },
  3189. /* 69*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567", "[20]1A", ZINT_WARN_NONCOMPLIANT, 9, 55, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" }, /* AI (20) should be 2 nos. */
  3190. /* 70*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[20]1A", 0, 9, 55, "" },
  3191. /* 71*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, "1234567", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 9, 55, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)" },
  3192. /* 72*/ { BARCODE_UPCE_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567", "[02]12345678901234", 0, 9, 55, "" },
  3193. /* 73*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "1234567890123", "[20]12", 0, 9, 56, "" },
  3194. /* 74*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901231", "[20]12", 0, 9, 56, "" },
  3195. /* 75*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '2', expecting '1' (linear component)" },
  3196. /* 76*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '2', expecting '1' (linear component)" }, /* Linear component still checked */
  3197. /* 77*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "123456789012323", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)" },
  3198. /* 78*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012323", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)" },
  3199. /* 79*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)" },
  3200. /* 80*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)" },
  3201. /* 81*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 9, 56, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" }, /* AI (20) should be 2 nos. */
  3202. /* 82*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[20]1A", 0, 9, 56, "" },
  3203. /* 83*/ { BARCODE_DBAR_STK_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 9, 56, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)" },
  3204. /* 84*/ { BARCODE_DBAR_STK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[02]12345678901234", 0, 9, 56, "" },
  3205. /* 85*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "1234567890123", "[20]12", 0, 11, 56, "" },
  3206. /* 86*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901231", "[20]12", 0, 11, 56, "" },
  3207. /* 87*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '2', expecting '1' (linear component)" },
  3208. /* 88*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901232", "[20]12", ZINT_ERROR_INVALID_CHECK, -1, -1, "Error 388: Invalid check digit '2', expecting '1' (linear component)" }, /* Linear component still checked */
  3209. /* 89*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "123456789012312", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)" },
  3210. /* 90*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "123456789012312", "[20]12", ZINT_ERROR_TOO_LONG, -1, -1, "Error 380: Input length 15 too long (maximum 14) (linear component)" },
  3211. /* 91*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)" },
  3212. /* 92*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "1234567890123A", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 381: Invalid character at position 14 in input (digits only) (linear component)" },
  3213. /* 93*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901231", "[20]1A", ZINT_WARN_NONCOMPLIANT, 11, 56, "Warning 261: AI (20) position 2: Non-numeric character 'A' (2D component)" }, /* AI (20) should be 2 nos. */
  3214. /* 94*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[20]1A", 0, 11, 56, "" },
  3215. /* 95*/ { BARCODE_DBAR_OMNSTK_CC, -1, -1, -1, -1, "12345678901231", "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, 11, 56, "Warning 261: AI (02) position 14: Bad checksum '4', expected '1' (2D component)" },
  3216. /* 96*/ { BARCODE_DBAR_OMNSTK_CC, GS1NOCHECK_MODE, -1, -1, -1, "12345678901231", "[02]12345678901234", 0, 11, 56, "" },
  3217. /* 97*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "", "[20]12", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 445: No primary (linear) message" },
  3218. /* 98*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[01]12345678901231", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, 31, 273, "" }, /* Tries CC-A then CC-B then CC-C - ensure errtxt empty */
  3219. /* 99*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890[94]123456789012345678901234567890123456789012345678901234567890123", ZINT_WARN_NONCOMPLIANT, 29, 702, "Warning 843: Input too long, requires 115 characters (maximum 48) (linear component)" }, /* Overlarge linear and CC-C input */
  3220. /*100*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[01]12345678901231[90]123456789012345678901234567890[91]1234567890123456789012345678901234567890123456789012345678901234", "[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[97]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[98]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[99]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL", ZINT_ERROR_TOO_LONG, -1, -1, "Error 442: Input too long (2D component)" }, /* Overlarge linear and oversized CC-C input */
  3221. /*101*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[01]12345678901231", "[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[97]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[98]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[99]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[94]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[95]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[96]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[91]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[92]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI" "JKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL[93]ABCDEFGHIJKLM", ZINT_ERROR_TOO_LONG, -1, -1, "Error 446: 2D component input too long, requires 2991 characters (maximum 2990)" }, /* Reduced length 2291 */
  3222. /*102*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[01]12345678901231", "[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012" "345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[11]121212[20]12", 0, 32, 579, "" }, /* Reduced length 2372 digits (no FNC1s) with not recommended ECC 4 > 2361 digit limit given in ISO/IEC 24723:2010 4.1 (d)(2)(iii) */
  3223. /*103*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[90]ABCDEFGHIJKLMNOPQRSTUVWXYXABCD[91]ABCDEFGHIJKLMNOPQRSTUVWXYABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM", "[20]12", ZINT_WARN_NONCOMPLIANT, 5, 1146, "Warning 843: Input too long, requires 99 characters (maximum 48) (linear component)" },
  3224. /*104*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[90]ABCDEFGHIJKLMNOPQRSTUVWXYXABCD[91]ABCDEFGHIJKLMNOPQRSTUVWXYABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMN", "[20]12", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 344: Input too long, requires 103 symbol characters (maximum 102) (linear component)" },
  3225. /*105*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, -1, -1, "[91]1234567890123456789012345678901234", "[20]12", 0, 13, 102, "" },
  3226. /*106*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, 1, -1, "[91]1234567890123456789012345678901234", "[20]12", 0, 13, 102, "" },
  3227. /*107*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, 2, -1, "[91]1234567890123456789012345678901234", "[20]12", 0, 13, 102, "" },
  3228. /*108*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, 3, -1, "[91]1234567890123456789012345678901234", "[20]12", 0, 9, 151, "" },
  3229. /*109*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, 4, -1, "[91]1234567890123456789012345678901234", "[20]12", 0, 9, 200, "" },
  3230. /*110*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, -1, 2, "[91]1234567890123456789012345678901234", "[20]12", 0, 9, 151, "" },
  3231. /*111*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, -1, 3, "[91]1234567890123456789012345678901234", "[20]12", 0, 13, 102, "" },
  3232. /*112*/ { BARCODE_DBAR_EXPSTK_CC, -1, -1, -1, 4, "[91]1234567890123456789012345678901234", "[20]12", 0, 13, 102, "" },
  3233. };
  3234. const int data_size = ARRAY_SIZE(data);
  3235. int i, length, composite_length, ret;
  3236. struct zint_symbol *symbol = NULL;
  3237. testStartSymbol("test_input", &symbol);
  3238. for (i = 0; i < data_size; i++) {
  3239. if (testContinue(p_ctx, i)) continue;
  3240. symbol = ZBarcode_Create();
  3241. assert_nonnull(symbol, "Symbol not created\n");
  3242. length = testUtilSetSymbol(symbol, data[i].symbology, 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);
  3243. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  3244. strcpy(symbol->primary, data[i].data);
  3245. composite_length = (int) strlen(data[i].composite);
  3246. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  3247. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, data[i].ret, ret, symbol->errtxt);
  3248. assert_zero(strcmp(symbol->errtxt, data[i].expected_errtxt), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected_errtxt);
  3249. if (ret < ZINT_ERROR) {
  3250. assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (symbol->width %d)\n", i, symbol->rows, data[i].expected_rows, symbol->width);
  3251. assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d\n", i, symbol->width, data[i].expected_width);
  3252. }
  3253. ZBarcode_Delete(symbol);
  3254. }
  3255. testFinish();
  3256. }
  3257. /* #181 Christian Hartlage OSS-Fuzz and #300 Andre Maute */
  3258. static void test_fuzz(const testCtx *const p_ctx) {
  3259. int debug = p_ctx->debug;
  3260. struct item {
  3261. int symbology;
  3262. int input_mode;
  3263. int option_1;
  3264. char *data;
  3265. int length;
  3266. char *composite;
  3267. int ret;
  3268. int bwipp_cmp;
  3269. char *expected_errtxt;
  3270. char *comment;
  3271. };
  3272. /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
  3273. static const struct item data[] = {
  3274. /* 0*/ { BARCODE_EANX_CC, -1, -1, "+123456789012345678", -1, "[21]A12345678", ZINT_ERROR_TOO_LONG, 1, "Error 297: Input add-on length 18 too long (maximum 5) (linear component)", "" },
  3275. /* 1*/ { BARCODE_UPCA_CC, -1, -1, "+123456789012345678", -1, "[21]A12345678", ZINT_ERROR_TOO_LONG, 1, "Error 297: Input add-on length 18 too long (maximum 5) (linear component)", "" },
  3276. /* 2*/ { BARCODE_UPCE_CC, -1, -1, "+123456789012345678", -1, "[21]A12345678", ZINT_ERROR_TOO_LONG, 1, "Error 297: Input add-on length 18 too long (maximum 5) (linear component)", "" },
  3277. /* 3*/ { BARCODE_EANX_CC, -1, -1, "+12345", -1, "[21]A12345678", 0 , 0, "", "BWIPP checks for proper EAN data" },
  3278. /* 4*/ { BARCODE_EANX_CC, -1, -1, "+123456", -1, "[21]A12345678", ZINT_ERROR_TOO_LONG, 1, "Error 297: Input add-on length 6 too long (maximum 5) (linear component)", "" },
  3279. /* 5*/ { BARCODE_EANX_CC, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "kks", -1, "()111%", ZINT_ERROR_INVALID_DATA, 1, "Error 284: Invalid character at position 1 in input (digits and \"+\" only) (linear component)", "" }, /* #300 (#5), Andre Maute (`dbar_date()` not checking length + other non-checks) */
  3280. /* 6*/ { BARCODE_UPCA_CC, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\225\215\153\153\153\153\153\153\263\153\153\153\153\153\153\153\153\153\153\163", -1, "()90", ZINT_ERROR_TOO_LONG, 1, "Error 283: Input length 46 too long (maximum 19) (linear component)", "" }, /* #300 (#6), Andre Maute (`dbar_date()` not checking length + other non-checks) */
  3281. /* 7*/ { BARCODE_UPCA_CC, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\225\215\153\153\153\153\153\153\263\153\153\377\002\000\000\153\153\153\153\163\000\000\000\153\153\153\153\153\153\153\060\047\047\043\047\057\153\153\153\153\153\000\000\000\000\153\153\153\161\153\153\153\153\153\153\153\153\153\153\153\153\153\167\167\167\167\167\167\167\167\167\167\167\167\167\167\167\167\001\100\000\000\000\000\000\000\000\167\167\167\167\167\167\167\167\167\167\167\167\167\167", 127, "()904OOOOO)CK0336680OOOOOOOOOOOOOO29[0kkkk%%%%(", ZINT_ERROR_INVALID_DATA, 1, "Error 253: Malformed AI in input (brackets don't match) (2D component)", "" }, /* #300 (#11), Andre Maute (`gs1_verify()` not checking length on resolve AI data loop) */
  3282. /* 8*/ { BARCODE_EANX_CC, GS1PARENS_MODE | GS1NOCHECK_MODE, -1, "\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\153\225\215\153\153\153\153\153\153\263\153\153\377\002\000\000\153\153\153\153\163\000\000\000\153\153\153\153\153\153\153\060\047\047\043\047\057\153\153\153\153\153\000\000\000\000\153\153\153\161\153\153\153\153\153\153\153\153\153\153\153\153\153\167\167\167\167\167\167\167\167\167\167\167\167\167\167\167\167\001\100\000\000\000\000\000\000\000\167\167\167\167\167\167\167\167\167\167\167\167\167\167", 127, "()904OOOOO)CK0336680OOOOOOOOOOOOOO29[0kkkk%%%%(", ZINT_ERROR_INVALID_DATA, 1, "Error 253: Malformed AI in input (brackets don't match) (2D component)", "" }, /* #300 (#11 with EANX_CC) */
  3283. /* 9*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, 3, "[]28", -1, "[]RRR___________________KKKRRR0000", 0, 1, "", "" }, /* #300 (#13), Andre Maute (`calc_padding_ccc()` dividing by zero when linear width == 68) */
  3284. /*10*/ { BARCODE_GS1_128_CC, GS1NOCHECK_MODE, 3, "[]2", -1, "[]RRR___________________KKKRRR0000", 0, 1, "", "" }, /* #300 (#13 shortened to min linear input (but same linear width 68)) */
  3285. };
  3286. const int data_size = ARRAY_SIZE(data);
  3287. int i, length, composite_length, ret;
  3288. struct zint_symbol *symbol = NULL;
  3289. char bwipp_buf[32768];
  3290. char bwipp_msg[1024];
  3291. int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); /* Only do BWIPP test if asked, too slow otherwise */
  3292. testStartSymbol("test_fuzz", &symbol);
  3293. for (i = 0; i < data_size; i++) {
  3294. if (testContinue(p_ctx, i)) continue;
  3295. symbol = ZBarcode_Create();
  3296. assert_nonnull(symbol, "Symbol not created\n");
  3297. length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  3298. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  3299. strcpy(symbol->primary, data[i].data);
  3300. composite_length = (int) strlen(data[i].composite);
  3301. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  3302. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  3303. assert_zero(strcmp(symbol->errtxt, data[i].expected_errtxt), "i:%d strcmp(%s, %s) != 0\n",
  3304. i, symbol->errtxt, data[i].expected_errtxt);
  3305. if (ret < ZINT_ERROR) {
  3306. if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, -1, -1, debug)) {
  3307. if (!data[i].bwipp_cmp) {
  3308. if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment);
  3309. } else {
  3310. char modules_dump[32768];
  3311. assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i);
  3312. ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf), NULL);
  3313. assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
  3314. ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, modules_dump);
  3315. assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n",
  3316. i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, modules_dump);
  3317. }
  3318. }
  3319. }
  3320. ZBarcode_Delete(symbol);
  3321. }
  3322. testFinish();
  3323. }
  3324. #include <time.h>
  3325. #define TEST_PERF_ITERATIONS 1000
  3326. /* Not a real test, just performance indicator */
  3327. static void test_perf(const testCtx *const p_ctx) {
  3328. int debug = p_ctx->debug;
  3329. struct item {
  3330. int symbology;
  3331. int option_1;
  3332. char *data;
  3333. char *composite;
  3334. int ret;
  3335. int expected_rows;
  3336. int expected_width;
  3337. char *comment;
  3338. };
  3339. static const struct item data[] = {
  3340. /* 0*/ { BARCODE_EANX_CC, 1, "123456789012",
  3341. "[91]123456789012345678901234567890123456789012345678901234",
  3342. 0, 11, 99, "58 chars CC-A" },
  3343. /* 1*/ { BARCODE_UPCA_CC, 2, "12345678901",
  3344. "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  3345. "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  3346. "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  3347. "[94]12345678901234567890123456789012345678901234567890",
  3348. 0, 48, 99, "336 chars CC-B" },
  3349. /* 2*/ { BARCODE_GS1_128_CC, 3, "[01]12345678901231",
  3350. "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  3351. "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  3352. "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  3353. "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  3354. "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  3355. "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
  3356. 0, 32, 205, "564 chars CC-C" },
  3357. };
  3358. const int data_size = ARRAY_SIZE(data);
  3359. int i, length, composite_length, ret;
  3360. clock_t start, total_encode = 0, total_buffer = 0, diff_encode, diff_buffer;
  3361. if (!(debug & ZINT_DEBUG_TEST_PERFORMANCE)) { /* -d 256 */
  3362. return;
  3363. }
  3364. for (i = 0; i < data_size; i++) {
  3365. int j;
  3366. if (testContinue(p_ctx, i)) continue;
  3367. diff_encode = diff_buffer = 0;
  3368. for (j = 0; j < TEST_PERF_ITERATIONS; j++) {
  3369. struct zint_symbol *symbol = ZBarcode_Create();
  3370. assert_nonnull(symbol, "Symbol not created\n");
  3371. length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
  3372. assert_zero(length >= 128, "i:%d length %d >= 128\n", i, length);
  3373. strcpy(symbol->primary, data[i].data);
  3374. composite_length = (int) strlen(data[i].composite);
  3375. start = clock();
  3376. ret = ZBarcode_Encode(symbol, (const unsigned char *) data[i].composite, composite_length);
  3377. diff_encode += clock() - start;
  3378. assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
  3379. 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);
  3380. 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);
  3381. start = clock();
  3382. ret = ZBarcode_Buffer(symbol, 0 /*rotate_angle*/);
  3383. diff_buffer += clock() - start;
  3384. assert_zero(ret, "i:%d ZBarcode_Buffer ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
  3385. ZBarcode_Delete(symbol);
  3386. }
  3387. printf("%s: diff_encode %gms, diff_buffer %gms\n", data[i].comment, diff_encode * 1000.0 / CLOCKS_PER_SEC, diff_buffer * 1000.0 / CLOCKS_PER_SEC);
  3388. total_encode += diff_encode;
  3389. total_buffer += diff_buffer;
  3390. }
  3391. if (p_ctx->index != -1) {
  3392. printf("totals: encode %gms, buffer %gms\n", total_encode * 1000.0 / CLOCKS_PER_SEC, total_buffer * 1000.0 / CLOCKS_PER_SEC);
  3393. }
  3394. }
  3395. int main(int argc, char *argv[]) {
  3396. testFunction funcs[] = { /* name, func */
  3397. { "test_eanx_leading_zeroes", test_eanx_leading_zeroes },
  3398. { "test_examples", test_examples },
  3399. { "test_odd_numbered_numeric", test_odd_numbered_numeric },
  3400. { "test_ean128_cc_shift", test_ean128_cc_shift },
  3401. { "test_ean128_cc_width", test_ean128_cc_width },
  3402. { "test_encodation_0", test_encodation_0 },
  3403. { "test_encodation_10", test_encodation_10 },
  3404. { "test_encodation_11", test_encodation_11 },
  3405. { "test_addongap", test_addongap },
  3406. { "test_gs1parens", test_gs1parens },
  3407. { "test_hrt", test_hrt },
  3408. { "test_input", test_input },
  3409. { "test_fuzz", test_fuzz },
  3410. { "test_perf", test_perf },
  3411. };
  3412. testRun(argc, argv, funcs, ARRAY_SIZE(funcs));
  3413. testReport();
  3414. return 0;
  3415. }
  3416. /* vim: set ts=4 sw=4 et : */