zint/backend/tests
2020-03-28 10:13:06 +00:00
..
cmake/Modules New files 2019-09-01 21:09:47 +01:00
data KOREAPOST missing from is_linear; tests update 2019-10-14 09:49:15 +01:00
tools HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
CMakeLists.txt #181 OSS-Fuzz CODEONE fix, double indexing typo 2020-03-28 10:13:06 +00:00
README libzint.so: suppress exporting INTERNAL functions to the shared library; ZINT_TEST 2019-12-19 00:37:55 +00:00
test_auspost.c #181 OSS-Fuzz TELEPEN fix, allow for 16 char nul encodings in buffer 2020-03-26 14:22:27 +00:00
test_channel.c KOREAPOST missing from is_linear; tests update 2019-10-14 09:49:15 +01:00
test_codablock.c Add missing test file 2020-03-25 19:33:20 +00:00
test_code1.c #181 OSS-Fuzz CODEONE fix, double indexing typo 2020-03-28 10:13:06 +00:00
test_common.c HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_composite.c #181 OSS-Fuzz UPC/EAN fix, allow max 6 chars add-on in ean_leading_zeroes() 2020-03-26 09:35:04 +00:00
test_dmatrix.c #147 Datamatrix buffer test from Opaki; encode examples from ISO 16022 2020-01-07 18:23:26 +00:00
test_dotcode.c #181 OSS-Fuzz DOTCODE fix, check length before accessing in binary() 2020-03-25 22:31:59 +00:00
test_eci.c Handle UNICODE_MODE ECI conversion for reduced charset barcodes and QRCODE/MICROQR 2019-11-27 16:16:14 +00:00
test_gb2312_tab.h HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_gb2312.c HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_gb18030_tab.h HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_gb18030.c HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_gridmtx.c QR optimize encoding modes 2019-12-16 17:31:52 +00:00
test_gs1.c Handle UNICODE_MODE ECI conversion for reduced charset barcodes and QRCODE/MICROQR 2019-11-27 16:16:14 +00:00
test_hanxin.c PDF417 no longer uses option_3 for no. codewords so set default 0 & remove from Studio 2019-12-19 20:29:11 +00:00
test_imail.c QR optimize encoding modes 2019-12-16 17:31:52 +00:00
test_library.c #181 OSS-Fuzz ZBarcode_Encode_File fix, allow for zero-length file, free buffer on error 2020-03-26 22:17:37 +00:00
test_mailmark.c KOREAPOST missing from is_linear; tests update 2019-10-14 09:49:15 +01:00
test_maxicode.c #181 OSS-Fuzz MAXICODE fix, prevent index overrun on numeric compaction 2020-03-28 02:50:15 +00:00
test_pdf417.c PDF417 no longer uses option_3 for no. codewords so set default 0 & remove from Studio 2019-12-19 20:29:11 +00:00
test_postal.c Handle UNICODE_MODE ECI conversion for reduced charset barcodes and QRCODE/MICROQR 2019-11-27 16:16:14 +00:00
test_qr.c QR optimize encoding modes 2019-12-16 17:31:52 +00:00
test_raster.c EANX/UPCA/UPCE_CHK handling + various raster/vector fixes; ISBNX add-ons 2019-11-11 21:38:21 +00:00
test_rss.c EAN128_CC ecc, cc_width, rows and alignment adjustments 2019-11-05 14:16:48 +00:00
test_sjis_tab.h HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_sjis.c HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_telepen.c #181 OSS-Fuzz TELEPEN fix, allow for 16 char nul encodings in buffer 2020-03-26 14:22:27 +00:00
test_upcean.c #181 OSS-Fuzz UPC/EAN fix, allow max 6 chars add-on in ean_leading_zeroes() 2020-03-26 09:35:04 +00:00
test_vector.c EANX/UPCA/UPCE_CHK handling + various raster/vector fixes; ISBNX add-ons 2019-11-11 21:38:21 +00:00
testcommon.c HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
testcommon.h libzint.so: suppress exporting INTERNAL functions to the shared library; ZINT_TEST 2019-12-19 00:37:55 +00:00

Zint backend test suite
-----------------------

To make, first make libzint with ZINT_TEST defined:

  cd <project-dir>
  mkdir build
  cd build
  cmake -DZINT_TEST:BOOL:1 ..
  make

Then make the tests:

  cd <project-dir>
  cd backend/tests
  mkdir build
  cd build
  cmake -DZINT_TEST:BOOL:1 ..
  make

(ZINT_TEST is needed to export INTERNAL functions for use and testing.)

To run all tests:

  make test

To run individual tests, eg:

  ./test_common
  ./test_vector

To make with gcc sanitize, first set for libzint and make:

  cd <project-dir>
  cd build
  cmake -DZINT_SANITIZE:BOOL=1 ..
  make && sudo make install

Then set for tests and make:

  cd <project-dir>
  cd backend/tests/build
  cmake -DZINT_SANITIZE:BOOL=1 ..
  make

Similarly to make with gcc debug:

  cd <project-dir>
  cd build
  cmake -DZINT_DEBUG:BOOL=1 ..
  make && sudo make install

  cd <project-dir>
  cd backend/tests/build
  cmake -DZINT_DEBUG:BOOL=1 ..
  make

To undo sanitize/debug, remake each after setting:

  cmake -DZINT_SANITIZE:BOOL=0 ..
  cmake -DZINT_DEBUG:BOOL=0 ..

To get a clean libzint, set the above and also:

  cmake -DZINT_TEST:BOOL=0 ..

(The tests will now fail to link.)