From d513a682229236cbfced74ce34288d68e618d18d Mon Sep 17 00:00:00 2001 From: gitlost Date: Tue, 7 Jan 2020 18:23:26 +0000 Subject: [PATCH] #147 Datamatrix buffer test from Opaki; encode examples from ISO 16022 --- backend/tests/test_dmatrix.c | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/backend/tests/test_dmatrix.c b/backend/tests/test_dmatrix.c index 83591b57..e4491bd7 100644 --- a/backend/tests/test_dmatrix.c +++ b/backend/tests/test_dmatrix.c @@ -33,6 +33,7 @@ //#define TEST_ENCODE_GENERATE_EXPECTED 1 +// Note need ZINT_SANITIZE set for these static void test_buffer(void) { testStart(""); @@ -49,6 +50,7 @@ static void test_buffer(void) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { /* 0*/ { "1", 16383, UNICODE_MODE, READER_INIT, 0, "" }, + /* 1*/ { "000106j 05 Galeria A Nação0000000000", 3, UNICODE_MODE, 0, 0, "From Okapi, consecutive use of upper shift; ticket #176" }, }; int data_size = sizeof(data) / sizeof(struct item); @@ -104,6 +106,44 @@ static void test_encode(void) "10011111000100" "11111111111111" }, + /* 1*/ { "A1B2C3D4E5F6G7H8I9J0K1L2", 0, 18, 18, "ISO 16022:2006 Figure 1", + "101010101010101010" + "101000101010001111" + "101100000111000010" + "100000101110100111" + "100100000100011100" + "101011111010101111" + "100110011111110110" + "110011101111111101" + "111111111101111100" + "101110110100101101" + "100010110101001110" + "101101111001100001" + "110001101010011110" + "110110100000100011" + "101101001101011010" + "100010011001011011" + "100011000000100100" + "111111111111111111" + }, + /* 2*/ { "30Q324343430794