Tabs/typo in zint.h; PostNet -> POSTNET; ui: shortcuts, tooltips; tests inkscape -> libreoffice

This commit is contained in:
gitlost 2020-10-03 22:51:08 +01:00
parent 36c19053d7
commit e37a82a8f1
90 changed files with 1048 additions and 840 deletions

View File

@ -4,6 +4,7 @@
# vim: set ts=4 sw=4 et : # vim: set ts=4 sw=4 et :
cmake_minimum_required(VERSION 3.9) cmake_minimum_required(VERSION 3.9)
project(zint_backend_tests)
enable_testing() enable_testing()
@ -30,20 +31,38 @@ if(NOT EXISTS ${BWIPP_PS})
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools)
endif() endif()
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") include(CheckCCompilerFlag)
if(ZINT_DEBUG)
check_c_compiler_flag(-Wall C_COMPILER_FLAG_WALL)
if(C_COMPILER_FLAG_WALL)
add_compile_options("-Wall")
endif()
check_c_compiler_flag(-Wextra C_COMPILER_FLAG_WEXTRA)
if(C_COMPILER_FLAG_WEXTRA)
add_compile_options("-Wextra")
endif()
if(ZINT_DEBUG)
check_c_compiler_flag(-g C_COMPILER_FLAG_G)
if(C_COMPILER_FLAG_G)
add_compile_options("-g") add_compile_options("-g")
endif() endif()
if(ZINT_SANITIZE) endif()
if(ZINT_SANITIZE)
# check_c_compiler_flag fails for -fsanitize
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
add_compile_options("-fsanitize=undefined") add_compile_options("-fsanitize=undefined")
add_compile_options("-fsanitize=address") add_compile_options("-fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address") link_libraries("-fsanitize=undefined -fsanitize=address")
endif()
if(ZINT_TEST)
add_definitions("-DZINT_TEST")
endif() endif()
endif() endif()
if(ZINT_TEST)
add_definitions("-DZINT_TEST")
endif()
add_library(testcommon testcommon.c testcommon.h) add_library(testcommon testcommon.c testcommon.h)
if(PNG_FOUND) if(PNG_FOUND)
target_link_libraries(testcommon ZINT::ZINT ${PNG_LIBRARIES}) target_link_libraries(testcommon ZINT::ZINT ${PNG_LIBRARIES})

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,63 +1,63 @@
<?xml version="1.0" standalone="no"?> <?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="242" height="72" version="1.1" <svg width="242" height="64" version="1.1"
xmlns="http://www.w3.org/2000/svg"> xmlns="http://www.w3.org/2000/svg">
<desc>Zint Generated Symbol <desc>Zint Generated Symbol
</desc> </desc>
<g id="barcode" fill="#000000"> <g id="barcode" fill="#000000">
<rect x="0" y="0" width="242" height="72" fill="#FFFFFF" /> <rect x="0" y="0" width="242" height="64" fill="#FFFFFF" />
<rect x="20.00" y="6.00" width="4.00" height="60.00" /> <rect x="20.00" y="2.00" width="4.00" height="60.00" />
<rect x="26.00" y="6.00" width="2.00" height="60.00" /> <rect x="26.00" y="2.00" width="2.00" height="60.00" />
<rect x="36.00" y="6.00" width="2.00" height="60.00" /> <rect x="36.00" y="2.00" width="2.00" height="60.00" />
<rect x="42.00" y="6.00" width="2.00" height="60.00" /> <rect x="42.00" y="2.00" width="2.00" height="60.00" />
<rect x="46.00" y="6.00" width="8.00" height="60.00" /> <rect x="46.00" y="2.00" width="8.00" height="60.00" />
<rect x="56.00" y="6.00" width="6.00" height="60.00" /> <rect x="56.00" y="2.00" width="6.00" height="60.00" />
<rect x="64.00" y="6.00" width="2.00" height="20.00" /> <rect x="64.00" y="2.00" width="2.00" height="20.00" />
<rect x="70.00" y="6.00" width="2.00" height="20.00" /> <rect x="70.00" y="2.00" width="2.00" height="20.00" />
<rect x="74.00" y="6.00" width="4.00" height="20.00" /> <rect x="74.00" y="2.00" width="4.00" height="20.00" />
<rect x="86.00" y="6.00" width="2.00" height="60.00" /> <rect x="86.00" y="2.00" width="2.00" height="60.00" />
<rect x="90.00" y="6.00" width="2.00" height="60.00" /> <rect x="90.00" y="2.00" width="2.00" height="60.00" />
<rect x="98.00" y="6.00" width="4.00" height="60.00" /> <rect x="98.00" y="2.00" width="4.00" height="60.00" />
<rect x="108.00" y="6.00" width="2.00" height="60.00" /> <rect x="108.00" y="2.00" width="2.00" height="60.00" />
<rect x="112.00" y="6.00" width="2.00" height="40.00" /> <rect x="112.00" y="2.00" width="2.00" height="40.00" />
<rect x="120.00" y="6.00" width="4.00" height="40.00" /> <rect x="120.00" y="2.00" width="4.00" height="40.00" />
<rect x="130.00" y="6.00" width="2.00" height="40.00" /> <rect x="130.00" y="2.00" width="2.00" height="40.00" />
<rect x="134.00" y="6.00" width="2.00" height="40.00" /> <rect x="134.00" y="2.00" width="2.00" height="40.00" />
<rect x="142.00" y="6.00" width="4.00" height="40.00" /> <rect x="142.00" y="2.00" width="4.00" height="40.00" />
<rect x="152.00" y="6.00" width="2.00" height="40.00" /> <rect x="152.00" y="2.00" width="2.00" height="40.00" />
<rect x="156.00" y="6.00" width="2.00" height="40.00" /> <rect x="156.00" y="2.00" width="2.00" height="40.00" />
<rect x="164.00" y="6.00" width="4.00" height="40.00" /> <rect x="164.00" y="2.00" width="4.00" height="40.00" />
<rect x="174.00" y="6.00" width="4.00" height="20.00" /> <rect x="174.00" y="2.00" width="4.00" height="20.00" />
<rect x="180.00" y="6.00" width="4.00" height="20.00" /> <rect x="180.00" y="2.00" width="4.00" height="20.00" />
<rect x="188.00" y="6.00" width="4.00" height="20.00" /> <rect x="188.00" y="2.00" width="4.00" height="20.00" />
<rect x="196.00" y="6.00" width="4.00" height="60.00" /> <rect x="196.00" y="2.00" width="4.00" height="60.00" />
<rect x="206.00" y="6.00" width="6.00" height="60.00" /> <rect x="206.00" y="2.00" width="6.00" height="60.00" />
<rect x="214.00" y="6.00" width="2.00" height="60.00" /> <rect x="214.00" y="2.00" width="2.00" height="60.00" />
<rect x="218.00" y="6.00" width="4.00" height="60.00" /> <rect x="218.00" y="2.00" width="4.00" height="60.00" />
<rect x="64.00" y="26.00" width="4.00" height="20.00" /> <rect x="64.00" y="22.00" width="4.00" height="20.00" />
<rect x="74.00" y="26.00" width="2.00" height="20.00" /> <rect x="74.00" y="22.00" width="2.00" height="20.00" />
<rect x="80.00" y="26.00" width="2.00" height="20.00" /> <rect x="80.00" y="22.00" width="2.00" height="20.00" />
<rect x="174.00" y="26.00" width="8.00" height="20.00" /> <rect x="174.00" y="22.00" width="8.00" height="20.00" />
<rect x="184.00" y="26.00" width="2.00" height="40.00" /> <rect x="184.00" y="22.00" width="2.00" height="40.00" />
<rect x="192.00" y="26.00" width="2.00" height="20.00" /> <rect x="192.00" y="22.00" width="2.00" height="20.00" />
<rect x="64.00" y="46.00" width="2.00" height="20.00" /> <rect x="64.00" y="42.00" width="2.00" height="20.00" />
<rect x="68.00" y="46.00" width="4.00" height="20.00" /> <rect x="68.00" y="42.00" width="4.00" height="20.00" />
<rect x="76.00" y="46.00" width="6.00" height="20.00" /> <rect x="76.00" y="42.00" width="6.00" height="20.00" />
<rect x="112.00" y="46.00" width="6.00" height="20.00" /> <rect x="112.00" y="42.00" width="6.00" height="20.00" />
<rect x="120.00" y="46.00" width="8.00" height="20.00" /> <rect x="120.00" y="42.00" width="8.00" height="20.00" />
<rect x="130.00" y="46.00" width="4.00" height="20.00" /> <rect x="130.00" y="42.00" width="4.00" height="20.00" />
<rect x="138.00" y="46.00" width="4.00" height="20.00" /> <rect x="138.00" y="42.00" width="4.00" height="20.00" />
<rect x="144.00" y="46.00" width="4.00" height="20.00" /> <rect x="144.00" y="42.00" width="4.00" height="20.00" />
<rect x="152.00" y="46.00" width="4.00" height="20.00" /> <rect x="152.00" y="42.00" width="4.00" height="20.00" />
<rect x="160.00" y="46.00" width="6.00" height="20.00" /> <rect x="160.00" y="42.00" width="6.00" height="20.00" />
<rect x="170.00" y="46.00" width="2.00" height="20.00" /> <rect x="170.00" y="42.00" width="2.00" height="20.00" />
<rect x="174.00" y="46.00" width="4.00" height="20.00" /> <rect x="174.00" y="42.00" width="4.00" height="20.00" />
<rect x="190.00" y="46.00" width="2.00" height="20.00" /> <rect x="190.00" y="42.00" width="2.00" height="20.00" />
<rect x="42.00" y="25.00" width="154.00" height="2.00" /> <rect x="42.00" y="21.00" width="154.00" height="2.00" />
<rect x="42.00" y="45.00" width="154.00" height="2.00" /> <rect x="42.00" y="41.00" width="154.00" height="2.00" />
<rect x="20.00" y="0.00" width="202.00" height="6.00" /> <rect x="20.00" y="0.00" width="202.00" height="2.00" />
<rect x="20.00" y="66.00" width="202.00" height="6.00" /> <rect x="20.00" y="62.00" width="202.00" height="2.00" />
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -79,7 +79,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -100,8 +100,8 @@ static void test_hrt(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
unsigned char *expected; char *expected;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -119,8 +119,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -130,10 +128,10 @@ static void test_hrt(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -148,7 +146,7 @@ static void test_input(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -175,7 +173,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -198,7 +196,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -266,7 +264,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -79,7 +79,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -100,9 +100,9 @@ static void test_hrt(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
unsigned char *expected; char *expected;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -110,8 +110,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -121,10 +119,10 @@ static void test_hrt(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -139,7 +137,7 @@ static void test_input(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -176,7 +174,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -201,7 +199,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -266,7 +264,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -309,7 +307,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
}; };
@ -339,7 +337,7 @@ static void test_fuzz(int index, int debug) {
length = strlen(data[i].data); length = strlen(data[i].data);
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -41,7 +41,7 @@ static void test_encode(int index, int generate, int debug) {
int input_mode; int input_mode;
int option_1; int option_1;
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -444,7 +444,7 @@ static void test_encode(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -480,7 +480,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
int input_mode; int input_mode;
int option_1; int option_1;
@ -912,7 +912,7 @@ static void test_fuzz(int index, int debug) {
} }
symbol->debug |= debug; symbol->debug |= debug;
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -47,7 +47,7 @@ static void test_pixel_plot(int index, int debug) {
struct item { struct item {
int width; int width;
int height; int height;
unsigned char *pattern; char *pattern;
int repeat; int repeat;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
@ -66,8 +66,6 @@ static void test_pixel_plot(int index, int debug) {
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *bmp = "out.bmp"; char *bmp = "out.bmp";
char escaped[1024];
int escaped_size = 1024;
char data_buf[8 * 2 + 1]; char data_buf[8 * 2 + 1];
@ -94,7 +92,7 @@ static void test_pixel_plot(int index, int debug) {
} }
assert_equal(size, (int) strlen(data_buf), "i:%d bmp_pixel_plot size %d != strlen(data_buf) %d\n", i, size, (int) strlen(data_buf)); assert_equal(size, (int) strlen(data_buf), "i:%d bmp_pixel_plot size %d != strlen(data_buf) %d\n", i, size, (int) strlen(data_buf));
symbol->bitmap = data_buf; symbol->bitmap = (unsigned char *) data_buf;
ret = bmp_pixel_plot(symbol, data_buf); ret = bmp_pixel_plot(symbol, data_buf);
assert_zero(ret, "i:%d bmp_pixel_plot ret %d != 0 (%s)\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d bmp_pixel_plot ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
@ -126,7 +124,7 @@ static void test_print(int index, int generate, int debug) {
int option_2; int option_2;
char *fgcolour; char *fgcolour;
char *bgcolour; char *bgcolour;
unsigned char* data; char* data;
char* expected_file; char* expected_file;
}; };
struct item data[] = { struct item data[] = {
@ -165,7 +163,7 @@ static void test_print(int index, int generate, int debug) {
strcpy(symbol->bgcolour, data[i].bgcolour); strcpy(symbol->bgcolour, data[i].bgcolour);
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
strcpy(symbol->outfile, bmp); strcpy(symbol->outfile, bmp);

View File

@ -38,7 +38,7 @@ static void test_input(int index, int debug) {
int ret; int ret;
struct item { struct item {
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -104,7 +104,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CHANNEL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_CHANNEL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (ret < 5) { if (ret < 5) {
@ -127,7 +127,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -362,7 +362,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CHANNEL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_CHANNEL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -406,7 +406,7 @@ static void test_generate(int generate) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
}; };
struct item data[] = { { "576688" }, { "7742862" } }; struct item data[] = { { "576688" }, { "7742862" } };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
@ -417,7 +417,7 @@ static void test_generate(int generate) {
int length = testUtilSetSymbol(symbol, BARCODE_CHANNEL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, 0); int length = testUtilSetSymbol(symbol, BARCODE_CHANNEL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, 0);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 (%s)\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -71,7 +71,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODABLOCKF, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODABLOCKF, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -94,7 +94,7 @@ static void test_options(int index, int debug) {
int input_mode; int input_mode;
int option_1; int option_1;
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -138,7 +138,7 @@ static void test_options(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODABLOCKF, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODABLOCKF, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -161,7 +161,7 @@ static void test_reader_init(int index, int generate, int debug) {
int symbology; int symbology;
int input_mode; int input_mode;
int output_options; int output_options;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -187,7 +187,7 @@ static void test_reader_init(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -199,7 +199,7 @@ static void test_reader_init(int index, int generate, int debug) {
if (ret < 5) { if (ret < 5) {
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); 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);
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); 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);
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); assert_zero(strcmp((char *) symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
} }
} }
@ -218,7 +218,7 @@ static void test_input(int index, int generate, int debug) {
int symbology; int symbology;
int input_mode; int input_mode;
int option_2; int option_2;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -294,7 +294,7 @@ static void test_input(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -306,7 +306,7 @@ static void test_input(int index, int generate, int debug) {
if (ret < 5) { if (ret < 5) {
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); 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);
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); 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);
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); assert_zero(strcmp((char *) symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
} }
} }
@ -327,7 +327,7 @@ static void test_encode(int index, int generate, int debug) {
int symbology; int symbology;
int option_1; int option_1;
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -426,7 +426,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, UNICODE_MODE, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, UNICODE_MODE, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -472,7 +472,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
}; };
@ -491,7 +491,7 @@ static void test_fuzz(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODABLOCKF, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODABLOCKF, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -39,7 +39,7 @@ static void test_large(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -87,7 +87,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -109,10 +109,10 @@ static void test_hrt(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
int length; int length;
unsigned char *expected; char *expected;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -146,8 +146,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -157,10 +155,10 @@ static void test_hrt(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -176,7 +174,7 @@ static void test_input(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -224,7 +222,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -248,7 +246,7 @@ static void test_encode(int index, int generate, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
@ -352,7 +350,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
int option_2; int option_2;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -93,7 +93,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODEONE, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODEONE, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -115,7 +115,7 @@ static void test_input(int index, int debug) {
struct item { struct item {
int input_mode; int input_mode;
int option_2; int option_2;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -149,7 +149,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODEONE, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODEONE, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -172,7 +172,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int option_2; int option_2;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
@ -216,7 +216,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODEONE, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODEONE, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -258,7 +258,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
}; };
@ -280,7 +280,7 @@ static void test_fuzz(int index, int debug) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -40,7 +40,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_width; int expected_width;
@ -87,7 +87,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -108,7 +108,7 @@ static void test_hrt_cpy_iso8859_1(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
char *expected; char *expected;
@ -135,7 +135,6 @@ static void test_hrt_cpy_iso8859_1(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
int vals[20];
struct zint_symbol symbol; struct zint_symbol symbol;
symbol.debug |= debug; symbol.debug |= debug;
@ -145,14 +144,14 @@ static void test_hrt_cpy_iso8859_1(int index, int debug) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
ret = hrt_cpy_iso8859_1(&symbol, data[i].data, length); ret = hrt_cpy_iso8859_1(&symbol, (unsigned char *) data[i].data, length);
for (int j = 0; j < ret; j++) { for (int j = 0; j < ret; j++) {
//fprintf(stderr, "symbol.text[%d] %2X\n", j, symbol.text[j]); //fprintf(stderr, "symbol.text[%d] %2X\n", j, symbol.text[j]);
} }
assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret);
assert_equal(ret, (int) strlen(symbol.text), "i:%d ret %d != strlen %d\n", i, ret, (int) strlen(symbol.text)); assert_equal(ret, (int) ustrlen(symbol.text), "i:%d ret %d != strlen %d\n", i, ret, (int) ustrlen(symbol.text));
assert_nonzero(testUtilIsValidUTF8(symbol.text, strlen(symbol.text)), "i:%d testUtilIsValidUTF8(%s) != 1\n", i, symbol.text); assert_nonzero(testUtilIsValidUTF8(symbol.text, ustrlen(symbol.text)), "i:%d testUtilIsValidUTF8(%s) != 1\n", i, symbol.text);
assert_zero(strcmp(symbol.text, data[i].expected), "i:%d symbol.text (%s) != expected (%s)\n", i, symbol.text, data[i].expected); assert_zero(strcmp((char *) symbol.text, data[i].expected), "i:%d symbol.text (%s) != expected (%s)\n", i, symbol.text, data[i].expected);
} }
testFinish(); testFinish();
@ -166,10 +165,10 @@ static void test_hrt(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int input_mode; int input_mode;
unsigned char *data; char *data;
int length; int length;
unsigned char *expected; char *expected;
}; };
// é U+00E9 (\351, 233), UTF-8 C3A9, CodeB-only extended ASCII // é U+00E9 (\351, 233), UTF-8 C3A9, CodeB-only extended ASCII
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
@ -188,8 +187,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -199,10 +196,10 @@ static void test_hrt(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -219,7 +216,7 @@ static void test_reader_init(int index, int generate, int debug) {
int symbology; int symbology;
int input_mode; int input_mode;
int output_options; int output_options;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -250,7 +247,7 @@ static void test_reader_init(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -279,7 +276,7 @@ static void test_input(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
int expected_width; int expected_width;
@ -345,7 +342,7 @@ static void test_input(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE128, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE128, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -371,7 +368,7 @@ static void test_ean128_input(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
int expected_width; int expected_width;
char *expected; char *expected;
@ -415,7 +412,7 @@ static void test_ean128_input(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_GS1_128, GS1_MODE, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_GS1_128, GS1_MODE, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -441,7 +438,7 @@ static void test_hibc_input(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
int expected_width; int expected_width;
char *expected; char *expected;
@ -466,7 +463,7 @@ static void test_hibc_input(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_HIBC_128, UNICODE_MODE, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_HIBC_128, UNICODE_MODE, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -496,7 +493,7 @@ static void test_encode(int index, int generate, int debug) {
struct item { struct item {
int symbology; int symbology;
int input_mode; int input_mode;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -650,7 +647,7 @@ static void test_encode(int index, int generate, int debug) {
int 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); int 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);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -66,7 +66,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE16K, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE16K, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -88,7 +88,7 @@ static void test_reader_init(int index, int generate, int debug) {
struct item { struct item {
int input_mode; int input_mode;
int output_options; int output_options;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -116,7 +116,7 @@ static void test_reader_init(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE16K, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE16K, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -128,7 +128,7 @@ static void test_reader_init(int index, int generate, int debug) {
if (ret < 5) { if (ret < 5) {
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); 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);
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); 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);
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); assert_zero(strcmp((char *) symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
} }
} }
@ -145,7 +145,7 @@ static void test_input(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -195,7 +195,7 @@ static void test_input(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE16K, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE16K, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -206,7 +206,7 @@ static void test_input(int index, int generate, int debug) {
if (ret < 5) { if (ret < 5) {
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); 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);
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); 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);
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); assert_zero(strcmp((char *) symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
} }
} }
@ -225,7 +225,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -260,7 +260,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE16K, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE16K, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -66,7 +66,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE49, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE49, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -87,7 +87,7 @@ static void test_input(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -128,7 +128,7 @@ static void test_input(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE49, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE49, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -139,7 +139,7 @@ static void test_input(int index, int generate, int debug) {
if (ret < 5) { if (ret < 5) {
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); 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);
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); 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);
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); assert_zero(strcmp((char *) symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
} }
} }
@ -158,7 +158,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -194,7 +194,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE49, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE49, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -39,7 +39,7 @@ static void test_input(int index, int generate, int debug) {
struct item { struct item {
int input_mode; int input_mode;
int eci; int eci;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
char *expected; char *expected;
@ -104,7 +104,7 @@ static void test_input(int index, int generate, int debug) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -113,7 +113,7 @@ static void test_input(int index, int generate, int debug) {
data[i].length, testUtilErrorName(data[i].ret), symbol->errtxt, data[i].comment); data[i].length, testUtilErrorName(data[i].ret), symbol->errtxt, data[i].comment);
} else { } else {
if (ret < 5) { if (ret < 5) {
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); assert_zero(strcmp((char *) symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
} }
} }
@ -131,7 +131,7 @@ static void test_encode(int index, int generate, int debug) {
struct item { struct item {
int input_mode; int input_mode;
int option_2; int option_2;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
@ -375,7 +375,7 @@ static void test_encode(int index, int generate, int debug) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -410,7 +410,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int length; int length;
int input_mode; int input_mode;
int ret; int ret;
@ -457,7 +457,7 @@ static void test_fuzz(int index, int debug) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
@ -504,7 +504,7 @@ static void test_large(int index, int debug) {
memset(data_buf, data[i].datum, length); memset(data_buf, data[i].datum, length);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -71,7 +71,7 @@ static void test_bom(int debug) {
"111111100101101000101"; "111111100101101000101";
int ret; int ret;
ret = ZBarcode_Encode(symbol, data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data, length);
assert_equal(ret, ZINT_WARN_USES_ECI, "ZBarcode_Encode ret %d != ZINT_WARN_USES_ECI\n", ret); assert_equal(ret, ZINT_WARN_USES_ECI, "ZBarcode_Encode ret %d != ZINT_WARN_USES_ECI\n", ret);
assert_equal(symbol->eci, 21, "eci %d != 21\n", symbol->eci); // ECI 21 == Windows-1250 assert_equal(symbol->eci, 21, "eci %d != 21\n", symbol->eci); // ECI 21 == Windows-1250
@ -99,7 +99,7 @@ static void test_iso_8859_16(int debug) {
int length = strlen(data); int length = strlen(data);
int ret; int ret;
ret = ZBarcode_Encode(symbol, data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data, length);
assert_equal(ret, ZINT_WARN_USES_ECI, "ZBarcode_Encode ret %d != ZINT_WARN_USES_ECI\n", ret); assert_equal(ret, ZINT_WARN_USES_ECI, "ZBarcode_Encode ret %d != ZINT_WARN_USES_ECI\n", ret);
assert_equal(symbol->eci, 18, "eci %d != 18\n", symbol->eci); // ECI 18 == ISO 8859-16 assert_equal(symbol->eci, 18, "eci %d != 18\n", symbol->eci); // ECI 18 == ISO 8859-16
@ -118,7 +118,7 @@ static void test_reduced_charset_input(int index, int debug) {
int symbology; int symbology;
int input_mode; int input_mode;
int eci; int eci;
unsigned char *data; char *data;
int ret; int ret;
int expected_eci; int expected_eci;
char *comment; char *comment;
@ -228,7 +228,7 @@ static void test_reduced_charset_input(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (data[i].expected_eci != -1) { if (data[i].expected_eci != -1) {

View File

@ -36,8 +36,8 @@ static void test_emf(int index, int debug) {
testStart(""); testStart("");
if (!testUtilHaveInkscape()) { if (!testUtilHaveLibreOffice()) {
testSkip("Inkscape not available"); testSkip("LibreOffice not available");
return; return;
} }
@ -49,7 +49,7 @@ static void test_emf(int index, int debug) {
char *fgcolour; char *fgcolour;
char *bgcolour; char *bgcolour;
float scale; float scale;
unsigned char *data; char *data;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -76,7 +76,7 @@ static void test_emf(int index, int debug) {
symbol->scale = data[i].scale; symbol->scale = data[i].scale;
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
char *filename = "out.emf"; char *filename = "out.emf";
@ -84,8 +84,8 @@ static void test_emf(int index, int debug) {
ret = ZBarcode_Print(symbol, 0); ret = ZBarcode_Print(symbol, 0);
assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret); assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret);
ret = testUtilVerifyInkscape(symbol->outfile, debug); // Slow ret = testUtilVerifyLibreOffice(symbol->outfile, debug); // Slow
assert_zero(ret, "i:%d %s inkscape %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret); assert_zero(ret, "i:%d %s libreoffice %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret);
assert_zero(remove(symbol->outfile), "i:%d remove(%s) != 0\n", i, symbol->outfile); assert_zero(remove(symbol->outfile), "i:%d remove(%s) != 0\n", i, symbol->outfile);
@ -99,7 +99,10 @@ static void test_print(int index, int generate, int debug) {
testStart(""); testStart("");
int have_inkscape = testUtilHaveInkscape(); int have_libreoffice = 0;
if (generate) {
have_libreoffice = testUtilHaveLibreOffice();
}
int ret; int ret;
struct item { struct item {
@ -111,18 +114,22 @@ static void test_print(int index, int generate, int debug) {
int option_2; int option_2;
char *fgcolour; char *fgcolour;
char *bgcolour; char *bgcolour;
unsigned char* data; int rotate_angle;
char* data;
char* expected_file; char* expected_file;
}; };
struct item data[] = { struct item data[] = {
/* 0*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT, -1, -1, -1, "", "", "Égjpqy", "../data/emf/code128_egrave_bold.emf" }, /* 0*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT, -1, -1, -1, "", "", 0, "Égjpqy", "../data/emf/code128_egrave_bold.emf" },
/* 1*/ { BARCODE_TELEPEN, -1, -1, -1, -1, -1, "147AD0", "FC9630", "123", "../data/emf/telenum_fg_bg.emf" }, /* 1*/ { BARCODE_TELEPEN, -1, -1, -1, -1, -1, "147AD0", "FC9630", 0, "123", "../data/emf/telenum_fg_bg.emf" },
/* 2*/ { BARCODE_ULTRA, -1, -1, 5, -1, -1, "147AD0", "FC9630", "123", "../data/emf/ultracode_fg_bg.emf" }, /* 2*/ { BARCODE_ULTRA, -1, -1, 5, -1, -1, "147AD0", "FC9630", 0, "123", "../data/emf/ultracode_fg_bg.emf" },
/* 3*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "", "", "9780877799306+54321", "../data/emf/ean13_5addon_ggs_5.2.2.5.2-2.emf" }, /* 3*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "", "", 0, "9780877799306+54321", "../data/emf/ean13_5addon_ggs_5.2.2.5.2-2.emf" },
/* 4*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "", "", "012345678905+24", "../data/emf/upca_2addon_ggs_5.2.6.6-5.emf" }, /* 4*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "", "", 0, "012345678905+24", "../data/emf/upca_2addon_ggs_5.2.6.6-5.emf" },
/* 5*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, "", "", "0123456+12", "../data/emf/upce_2addon.emf" }, /* 5*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, "", "", 0, "0123456+12", "../data/emf/upce_2addon.emf" },
/* 6*/ { BARCODE_UPCE, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, "", "", "0123456+12", "../data/emf/upce_2addon_small_bold.emf" }, /* 6*/ { BARCODE_UPCE, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, "", "", 0, "0123456+12", "../data/emf/upce_2addon_small_bold.emf" },
/* 7*/ { BARCODE_ITF14, -1, BOLD_TEXT, -1, -1, -1, "", "", "123", "../data/emf/itf14_bold.emf" }, /* 7*/ { BARCODE_ITF14, -1, BOLD_TEXT, -1, -1, -1, "", "", 0, "123", "../data/emf/itf14_bold.emf" },
/* 8*/ { BARCODE_CODE39, -1, -1, -1, -1, -1, "", "", 90, "123", "../data/emf/code39_rotate_90.emf" },
/* 9*/ { BARCODE_CODE39, -1, -1, -1, -1, -1, "", "", 180, "123", "../data/emf/code39_rotate_180.emf" },
/* 10*/ { BARCODE_CODE39, -1, -1, -1, -1, -1, "", "", 270, "123", "../data/emf/code39_rotate_270.emf" },
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
@ -156,22 +163,22 @@ static void test_print(int index, int generate, int debug) {
strcpy(symbol->bgcolour, data[i].bgcolour); strcpy(symbol->bgcolour, data[i].bgcolour);
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
strcpy(symbol->outfile, emf); strcpy(symbol->outfile, emf);
ret = ZBarcode_Print(symbol, 0); ret = ZBarcode_Print(symbol, data[i].rotate_angle);
assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret); assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret);
if (generate) { if (generate) {
printf(" /*%3d*/ { %s, %s, %s, %d, %d, %d, \"%s\", \"%s\", \"%s\", \"%s\"},\n", printf(" /*%3d*/ { %s, %s, %s, %d, %d, %d, \"%s\", \"%s\", %d, \"%s\", \"%s\"},\n",
i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), testUtilOutputOptionsName(data[i].output_options), data[i].whitespace_width, i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), testUtilOutputOptionsName(data[i].output_options), data[i].whitespace_width,
data[i].option_1, data[i].option_2, data[i].fgcolour, data[i].bgcolour, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); data[i].option_1, data[i].option_2, data[i].fgcolour, data[i].bgcolour, data[i].rotate_angle, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file);
ret = rename(symbol->outfile, data[i].expected_file); ret = rename(symbol->outfile, data[i].expected_file);
assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret); assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret);
if (have_inkscape) { if (have_libreoffice) {
ret = testUtilVerifyInkscape(data[i].expected_file, debug); ret = testUtilVerifyLibreOffice(data[i].expected_file, debug);
assert_zero(ret, "i:%d %s inkscape %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret); assert_zero(ret, "i:%d %s libreoffice %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret);
} }
} else { } else {
assert_nonzero(testUtilExists(symbol->outfile), "i:%d testUtilExists(%s) == 0\n", i, symbol->outfile); assert_nonzero(testUtilExists(symbol->outfile), "i:%d testUtilExists(%s) == 0\n", i, symbol->outfile);

View File

@ -152,7 +152,7 @@ static void test_gb18030_utf8tomb(int index) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -192,7 +192,7 @@ static void test_gb18030_utf8tomb(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
ret = gb18030_utf8tomb(&symbol, data[i].data, &ret_length, gbdata); ret = gb18030_utf8tomb(&symbol, (unsigned char *) data[i].data, &ret_length, gbdata);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol.errtxt); assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol.errtxt);
if (ret == 0) { if (ret == 0) {
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
@ -213,7 +213,7 @@ static void test_gb18030_utf8tosb(int index) {
struct item { struct item {
int eci; int eci;
int full_multibyte; int full_multibyte;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -267,7 +267,7 @@ static void test_gb18030_utf8tosb(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
ret = gb18030_utf8tosb(data[i].eci, data[i].data, &ret_length, gbdata, data[i].full_multibyte); ret = gb18030_utf8tosb(data[i].eci, (unsigned char *) data[i].data, &ret_length, gbdata, data[i].full_multibyte);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret);
if (ret == 0) { if (ret == 0) {
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
@ -284,10 +284,9 @@ static void test_gb18030_cpy(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
int full_multibyte; int full_multibyte;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -319,7 +318,7 @@ static void test_gb18030_cpy(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
gb18030_cpy(data[i].data, &ret_length, gbdata, data[i].full_multibyte); gb18030_cpy((unsigned char *) data[i].data, &ret_length, gbdata, data[i].full_multibyte);
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
for (int j = 0; j < (int) ret_length; j++) { for (int j = 0; j < (int) ret_length; j++) {
assert_equal(gbdata[j], data[i].expected_gbdata[j], "i:%d gbdata[%d] %04X != %04X\n", i, j, gbdata[j], data[i].expected_gbdata[j]); assert_equal(gbdata[j], data[i].expected_gbdata[j], "i:%d gbdata[%d] %04X != %04X\n", i, j, gbdata[j], data[i].expected_gbdata[j]);

View File

@ -55,7 +55,6 @@ static void test_gb2312_wctomb_zint(void) {
testStart(""); testStart("");
int ret, ret2; int ret, ret2;
unsigned char buf[2], buf2[2];
unsigned int val, val2; unsigned int val, val2;
for (unsigned int i = 0; i < 0xFFFE; i++) { for (unsigned int i = 0; i < 0xFFFE; i++) {
@ -93,7 +92,7 @@ static void test_gb2312_utf8tomb(int index) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -133,7 +132,7 @@ static void test_gb2312_utf8tomb(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
ret = gb2312_utf8tomb(&symbol, data[i].data, &ret_length, gbdata); ret = gb2312_utf8tomb(&symbol, (unsigned char *) data[i].data, &ret_length, gbdata);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol.errtxt); assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol.errtxt);
if (ret == 0) { if (ret == 0) {
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
@ -154,7 +153,7 @@ static void test_gb2312_utf8tosb(int index) {
struct item { struct item {
int eci; int eci;
int full_multibyte; int full_multibyte;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -206,7 +205,7 @@ static void test_gb2312_utf8tosb(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
ret = gb2312_utf8tosb(data[i].eci, data[i].data, &ret_length, gbdata, data[i].full_multibyte); ret = gb2312_utf8tosb(data[i].eci, (unsigned char *) data[i].data, &ret_length, gbdata, data[i].full_multibyte);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret);
if (ret == 0) { if (ret == 0) {
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
@ -223,10 +222,9 @@ static void test_gb2312_cpy(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
int full_multibyte; int full_multibyte;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -258,7 +256,7 @@ static void test_gb2312_cpy(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
gb2312_cpy(data[i].data, &ret_length, gbdata, data[i].full_multibyte); gb2312_cpy((unsigned char *) data[i].data, &ret_length, gbdata, data[i].full_multibyte);
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
for (int j = 0; j < (int) ret_length; j++) { for (int j = 0; j < (int) ret_length; j++) {
assert_equal(gbdata[j], data[i].expected_gbdata[j], "i:%d gbdata[%d] %04X != %04X\n", i, j, gbdata[j], data[i].expected_gbdata[j]); assert_equal(gbdata[j], data[i].expected_gbdata[j], "i:%d gbdata[%d] %04X != %04X\n", i, j, gbdata[j], data[i].expected_gbdata[j]);

View File

@ -46,7 +46,7 @@ static void test_pixel_plot(int index, int debug) {
struct item { struct item {
int width; int width;
int height; int height;
unsigned char *pattern; char *pattern;
int repeat; int repeat;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
@ -65,8 +65,6 @@ static void test_pixel_plot(int index, int debug) {
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *gif = "out.gif"; char *gif = "out.gif";
char escaped[1024];
int escaped_size = 1024;
char data_buf[19 * 32 + 1]; // 19 * 32 == 608 char data_buf[19 * 32 + 1]; // 19 * 32 == 608
@ -93,7 +91,7 @@ static void test_pixel_plot(int index, int debug) {
} }
assert_equal(size, (int) strlen(data_buf), "i:%d gif_pixel_plot size %d != strlen(data_buf) %d\n", i, size, (int) strlen(data_buf)); assert_equal(size, (int) strlen(data_buf), "i:%d gif_pixel_plot size %d != strlen(data_buf) %d\n", i, size, (int) strlen(data_buf));
symbol->bitmap = data_buf; symbol->bitmap = (unsigned char *) data_buf;
ret = gif_pixel_plot(symbol, data_buf); ret = gif_pixel_plot(symbol, data_buf);
assert_zero(ret, "i:%d gif_pixel_plot ret %d != 0 (%s)\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d gif_pixel_plot ret %d != 0 (%s)\n", i, ret, symbol->errtxt);

View File

@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -68,7 +68,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_GRIDMATRIX, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_GRIDMATRIX, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -88,7 +88,7 @@ static void test_options(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret_encode; int ret_encode;
@ -126,7 +126,7 @@ static void test_options(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
if (data[i].ret_vector != -1) { if (data[i].ret_vector != -1) {
@ -151,7 +151,7 @@ static void test_input(int index, int generate, int debug) {
int input_mode; int input_mode;
int eci; int eci;
int option_3; int option_3;
unsigned char *data; char *data;
int ret; int ret;
int expected_eci; int expected_eci;
char *expected; char *expected;
@ -238,7 +238,7 @@ static void test_input(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -249,7 +249,7 @@ static void test_input(int index, int generate, int debug) {
if (ret < 5) { if (ret < 5) {
assert_equal(symbol->eci, data[i].expected_eci, "i:%d eci %d != %d\n", i, symbol->eci, data[i].expected_eci); assert_equal(symbol->eci, data[i].expected_eci, "i:%d eci %d != %d\n", i, symbol->eci, data[i].expected_eci);
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected); assert_zero(strcmp((char *) symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
} }
} }
@ -265,7 +265,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int input_mode; int input_mode;
int option_1; int option_1;
int option_2; int option_2;
@ -395,7 +395,7 @@ static void test_encode(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -44,12 +44,12 @@ static void test_gs1_reduce(int index, int generate, int debug) {
struct item { struct item {
int symbology; int symbology;
int input_mode; int input_mode;
unsigned char *data; char *data;
unsigned char *composite; char *composite;
int ret; int ret;
char *comment; char *comment;
unsigned char *expected; char *expected;
}; };
struct item data[] = { struct item data[] = {
/* 0*/ { BARCODE_GS1_128, -1, "12345678901234", "", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" }, /* 0*/ { BARCODE_GS1_128, -1, "12345678901234", "", ZINT_ERROR_INVALID_DATA, "GS1 data required", "" },
@ -193,7 +193,7 @@ static void test_gs1_reduce(int index, int generate, int debug) {
} }
int length = strlen(text); int length = strlen(text);
ret = ZBarcode_Encode(symbol, text, length); ret = ZBarcode_Encode(symbol, (unsigned char *) text, length);
if (generate) { if (generate) {
if (data[i].ret == 0) { if (data[i].ret == 0) {
@ -237,10 +237,10 @@ static void test_hrt(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
unsigned char *composite; char *composite;
unsigned char *expected; char *expected;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -275,10 +275,10 @@ static void test_hrt(int index, int debug) {
} }
int length = strlen(text); int length = strlen(text);
ret = ZBarcode_Encode(symbol, text, length); ret = ZBarcode_Encode(symbol, (unsigned char *) text, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -294,7 +294,7 @@ static void test_gs1_verify(int index) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
char *expected; char *expected;
}; };
@ -801,7 +801,7 @@ static void test_gs1_verify(int index) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = gs1_verify(symbol, data[i].data, length, reduced); ret = gs1_verify(symbol, (unsigned char *) data[i].data, length, reduced);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (length %d \"%s\") %s\n", i, ret, data[i].ret, length, data[i].data, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ret %d != %d (length %d \"%s\") %s\n", i, ret, data[i].ret, length, data[i].data, symbol->errtxt);
if (ret == 0) { if (ret == 0) {
@ -821,8 +821,8 @@ static void test_input_mode(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
unsigned char *composite; char *composite;
int input_mode; int input_mode;
int output_options; int output_options;
int ret; int ret;
@ -894,7 +894,7 @@ static void test_input_mode(int index, int debug) {
} }
int length = strlen(text); int length = strlen(text);
ret = ZBarcode_Encode(symbol, text, length); ret = ZBarcode_Encode(symbol, (unsigned char *) text, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d %s\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d %s\n", i, ret, data[i].ret, symbol->errtxt);
if (index == -1 && data[i].compare_previous) { if (index == -1 && data[i].compare_previous) {
ret = testUtilSymbolCmp(symbol, &previous_symbol); ret = testUtilSymbolCmp(symbol, &previous_symbol);

View File

@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -68,7 +68,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_HANXIN, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_HANXIN, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -88,7 +88,7 @@ static void test_options(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret_encode; int ret_encode;
@ -130,7 +130,7 @@ static void test_options(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
if (data[i].ret_vector != -1) { if (data[i].ret_vector != -1) {
@ -155,7 +155,7 @@ static void test_input(int index, int generate, int debug) {
int input_mode; int input_mode;
int eci; int eci;
int option_3; int option_3;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
int expected_eci; int expected_eci;
@ -229,7 +229,7 @@ static void test_input(int index, int generate, int debug) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -255,7 +255,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int input_mode; int input_mode;
int option_1; int option_1;
int option_2; int option_2;
@ -439,7 +439,7 @@ static void test_encode(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -53,7 +53,6 @@ static void test_csv(int index, int debug) {
char actual_daft[70]; char actual_daft[70];
int ret; int ret;
int i;
int lc = 0; int lc = 0;
while (fgets(buffer, sizeof(buffer), fd) != NULL) { while (fgets(buffer, sizeof(buffer), fd) != NULL) {
@ -101,7 +100,7 @@ static void test_csv(int index, int debug) {
symbol->symbology = BARCODE_USPS_IMAIL; symbol->symbology = BARCODE_USPS_IMAIL;
symbol->debug |= debug; symbol->debug |= debug;
ret = ZBarcode_Encode(symbol, data, strlen(data)); ret = ZBarcode_Encode(symbol, (unsigned char *) data, strlen(data));
if (strcmp(return_code, "00") == 0) { if (strcmp(return_code, "00") == 0) {
@ -130,8 +129,8 @@ static void test_hrt(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
unsigned char *expected; char *expected;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -139,8 +138,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -150,10 +147,10 @@ static void test_hrt(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_USPS_IMAIL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_USPS_IMAIL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -167,7 +164,7 @@ static void test_input(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -199,7 +196,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_USPS_IMAIL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_USPS_IMAIL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -221,7 +218,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -251,7 +248,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_USPS_IMAIL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_USPS_IMAIL, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -36,7 +36,7 @@
int clz_u64(uint64_t x); int clz_u64(uint64_t x);
static void test_clz_u64(int index, int debug) { static void test_clz_u64(int index) {
testStart(""); testStart("");
@ -187,11 +187,10 @@ static void test_clz_u64(int index, int debug) {
testFinish(); testFinish();
} }
static void test_load(int index, int debug) { static void test_load(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
large_int t; large_int t;
large_int s; large_int s;
@ -224,14 +223,13 @@ static void test_load(int index, int debug) {
testFinish(); testFinish();
} }
static void test_load_str_u64(int index, int debug) { static void test_load_str_u64(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
large_int t; large_int t;
const unsigned char *s; const char *s;
int length; int length;
large_int expected; large_int expected;
}; };
@ -254,7 +252,7 @@ static void test_load_str_u64(int index, int debug) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
large_load_str_u64(&data[i].t, data[i].s, data[i].length == -1 ? (int) strlen(data[i].s) : data[i].length); large_load_str_u64(&data[i].t, (unsigned char *) data[i].s, data[i].length == -1 ? (int) strlen(data[i].s) : data[i].length);
assert_equal(data[i].t.lo, data[i].expected.lo, "i:%d lo 0x%lX (%s) != expected lo 0x%lX (%s)\n", assert_equal(data[i].t.lo, data[i].expected.lo, "i:%d lo 0x%lX (%s) != expected lo 0x%lX (%s)\n",
i, data[i].t.lo, large_dump(&data[i].t, t_dump), data[i].expected.lo, large_dump(&data[i].expected, expected_dump)); i, data[i].t.lo, large_dump(&data[i].t, t_dump), data[i].expected.lo, large_dump(&data[i].expected, expected_dump));
@ -265,11 +263,10 @@ static void test_load_str_u64(int index, int debug) {
testFinish(); testFinish();
} }
static void test_add_u64(int index, int debug) { static void test_add_u64(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
large_int t; large_int t;
uint64_t s; uint64_t s;
@ -309,11 +306,10 @@ static void test_add_u64(int index, int debug) {
testFinish(); testFinish();
} }
static void test_sub_u64(int index, int debug) { static void test_sub_u64(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
large_int t; large_int t;
uint64_t s; uint64_t s;
@ -353,11 +349,10 @@ static void test_sub_u64(int index, int debug) {
testFinish(); testFinish();
} }
static void test_mul_u64(int index, int debug) { static void test_mul_u64(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
large_int t; large_int t;
uint64_t s; uint64_t s;
@ -410,7 +405,7 @@ static void test_mul_u64(int index, int debug) {
testFinish(); testFinish();
} }
static void test_div_u64(int index, int debug) { static void test_div_u64(int index) {
testStart(""); testStart("");
@ -535,11 +530,10 @@ static void test_div_u64(int index, int debug) {
testFinish(); testFinish();
} }
static void test_unset_bit(int index, int debug) { static void test_unset_bit(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
large_int t; large_int t;
int s; int s;
@ -699,11 +693,10 @@ static void test_unset_bit(int index, int debug) {
testFinish(); testFinish();
} }
static void test_uint_array(int index, int debug) { static void test_uint_array(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
large_int t; large_int t;
int size; int size;
@ -784,11 +777,10 @@ static void test_uint_array(int index, int debug) {
testFinish(); testFinish();
} }
static void test_dump(int index, int debug) { static void test_dump(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
large_int t; large_int t;
char *expected; char *expected;
@ -863,16 +855,16 @@ static void test_dump(int index, int debug) {
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */ testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */
{ "test_clz_u64", test_clz_u64, 1, 0, 1 }, { "test_clz_u64", test_clz_u64, 1, 0, 0 },
{ "test_load", test_load, 1, 0, 1 }, { "test_load", test_load, 1, 0, 0 },
{ "test_load_str_u64", test_load_str_u64, 1, 0, 1 }, { "test_load_str_u64", test_load_str_u64, 1, 0, 0 },
{ "test_add_u64", test_add_u64, 1, 0, 1 }, { "test_add_u64", test_add_u64, 1, 0, 0 },
{ "test_sub_u64", test_sub_u64, 1, 0, 1 }, { "test_sub_u64", test_sub_u64, 1, 0, 0 },
{ "test_mul_u64", test_mul_u64, 1, 0, 1 }, { "test_mul_u64", test_mul_u64, 1, 0, 0 },
{ "test_div_u64", test_div_u64, 1, 0, 1 }, { "test_div_u64", test_div_u64, 1, 0, 0 },
{ "test_unset_bit", test_unset_bit, 1, 0, 1 }, { "test_unset_bit", test_unset_bit, 1, 0, 0 },
{ "test_uint_array", test_uint_array, 1, 0, 1 }, { "test_uint_array", test_uint_array, 1, 0, 0 },
{ "test_dump", test_dump, 1, 0, 1 }, { "test_dump", test_dump, 1, 0, 0 },
}; };
testRun(argc, argv, funcs, ARRAY_SIZE(funcs)); testRun(argc, argv, funcs, ARRAY_SIZE(funcs));

View File

@ -41,7 +41,7 @@ static void test_checks(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
int input_mode; int input_mode;
int eci; int eci;
@ -65,10 +65,6 @@ static void test_checks(int index, int debug) {
}; };
int data_size = sizeof(data) / sizeof(struct item); int data_size = sizeof(data) / sizeof(struct item);
char *text;
char *primary;
char escaped_primary[1024];
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -90,7 +86,7 @@ static void test_checks(int index, int debug) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode(%d) ret %d != %d (%s)\n", i, data[i].symbology, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode(%d) ret %d != %d (%s)\n", i, data[i].symbology, ret, data[i].ret, symbol->errtxt);
ret = strcmp(symbol->errtxt, data[i].expected); ret = strcmp(symbol->errtxt, data[i].expected);
@ -108,7 +104,7 @@ static void test_input_mode(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int input_mode; int input_mode;
int ret; int ret;
@ -143,7 +139,7 @@ static void test_input_mode(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
assert_equal(symbol->input_mode, data[i].expected_input_mode, "i:%d symbol->input_mode %d != %d\n", i, symbol->input_mode, data[i].expected_input_mode); assert_equal(symbol->input_mode, data[i].expected_input_mode, "i:%d symbol->input_mode %d != %d\n", i, symbol->input_mode, data[i].expected_input_mode);
@ -160,7 +156,7 @@ static void test_escape_char_process(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int ret; int ret;
int expected_width; int expected_width;
char *expected; char *expected;
@ -199,7 +195,7 @@ static void test_escape_char_process(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE128, data[i].input_mode | ESCAPE_MODE, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE128, data[i].input_mode | ESCAPE_MODE, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -219,7 +215,7 @@ static void test_escape_char_process(int index, int generate, int debug) {
testFinish(); testFinish();
} }
static void test_cap(int index, int debug) { static void test_cap(int index) {
testStart(""); testStart("");
@ -288,7 +284,6 @@ static void test_encode_file_directory(void) {
int ret; int ret;
char dirname[] = "in_dir"; char dirname[] = "in_dir";
int fd;
struct zint_symbol *symbol = ZBarcode_Create(); struct zint_symbol *symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n"); assert_nonnull(symbol, "Symbol not created\n");
@ -331,12 +326,12 @@ static void test_bad_args(void) {
assert_zero(ret, "ZBarcode_Cap(10, ~0) ret 0x%X != 0\n", ret); assert_zero(ret, "ZBarcode_Cap(10, ~0) ret 0x%X != 0\n", ret);
// NULL symbol // NULL symbol
assert_equal(ZBarcode_Encode(NULL, data, 1), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode(NULL, data, 1) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode(NULL, (unsigned char *) data, 1), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode(NULL, data, 1) != ZINT_ERROR_INVALID_DATA\n");
assert_equal(ZBarcode_Print(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Print(NULL, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Print(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Print(NULL, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_equal(ZBarcode_Buffer(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Buffer(NULL, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Buffer(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Buffer(NULL, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_equal(ZBarcode_Buffer_Vector(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Buffer_Vector(NULL, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Buffer_Vector(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Buffer_Vector(NULL, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_equal(ZBarcode_Encode_and_Print(NULL, data, 1, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Print(NULL, data, 1, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode_and_Print(NULL, (unsigned char *) data, 1, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Print(NULL, data, 1, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_equal(ZBarcode_Encode_and_Buffer(NULL, data, 1, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Buffer(NULL, data, 1, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode_and_Buffer(NULL, (unsigned char *) data, 1, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Buffer(NULL, data, 1, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_equal(ZBarcode_Encode_File(NULL, filename), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File(NULL, filename) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode_File(NULL, filename), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File(NULL, filename) != ZINT_ERROR_INVALID_DATA\n");
assert_equal(ZBarcode_Encode_File_and_Print(NULL, filename, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Print(NULL, filename, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode_File_and_Print(NULL, filename, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Print(NULL, filename, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_equal(ZBarcode_Encode_File_and_Buffer(NULL, filename, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Buffer(NULL, filename, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode_File_and_Buffer(NULL, filename, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Buffer(NULL, filename, 0) != ZINT_ERROR_INVALID_DATA\n");
@ -366,13 +361,13 @@ static void test_bad_args(void) {
// Empty data/filename // Empty data/filename
symbol->errtxt[0] = '\0'; symbol->errtxt[0] = '\0';
assert_equal(ZBarcode_Encode(symbol, empty, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode(symbol, empty, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode(symbol, (unsigned char *) empty, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode(symbol, empty, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode(symbol, empty, 0) no errtxt\n"); assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode(symbol, empty, 0) no errtxt\n");
symbol->errtxt[0] = '\0'; symbol->errtxt[0] = '\0';
assert_equal(ZBarcode_Encode_and_Print(symbol, empty, 0, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Print(symbol, empty, 0, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode_and_Print(symbol, (unsigned char *) empty, 0, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Print(symbol, empty, 0, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_and_Print(symbol, empty, 0, 0) no errtxt\n"); assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_and_Print(symbol, empty, 0, 0) no errtxt\n");
symbol->errtxt[0] = '\0'; symbol->errtxt[0] = '\0';
assert_equal(ZBarcode_Encode_and_Buffer(symbol, empty, 0, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Buffer(symbol, empty, 0, 0) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode_and_Buffer(symbol, (unsigned char *) empty, 0, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Buffer(symbol, empty, 0, 0) != ZINT_ERROR_INVALID_DATA\n");
assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_and_Buffer(symbol, empty, 0, 0) no errtxt\n"); assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_and_Buffer(symbol, empty, 0, 0) no errtxt\n");
symbol->errtxt[0] = '\0'; symbol->errtxt[0] = '\0';
assert_equal(ZBarcode_Encode_File(symbol, empty), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File(symbol, empty) != ZINT_ERROR_INVALID_DATA\n"); assert_equal(ZBarcode_Encode_File(symbol, empty), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File(symbol, empty) != ZINT_ERROR_INVALID_DATA\n");
@ -395,7 +390,7 @@ int main(int argc, char *argv[]) {
{ "test_checks", test_checks, 1, 0, 1 }, { "test_checks", test_checks, 1, 0, 1 },
{ "test_input_mode", test_input_mode, 1, 0, 1 }, { "test_input_mode", test_input_mode, 1, 0, 1 },
{ "test_escape_char_process", test_escape_char_process, 1, 1, 1 }, { "test_escape_char_process", test_escape_char_process, 1, 1, 1 },
{ "test_cap", test_cap, 1, 0, 1 }, { "test_cap", test_cap, 1, 0, 0 },
{ "test_encode_file_zero_length", test_encode_file_zero_length, 0, 0, 0 }, { "test_encode_file_zero_length", test_encode_file_zero_length, 0, 0, 0 },
{ "test_encode_file_directory", test_encode_file_directory, 0, 0, 0 }, { "test_encode_file_directory", test_encode_file_directory, 0, 0, 0 },
{ "test_bad_args", test_bad_args, 0, 0, 0 }, { "test_bad_args", test_bad_args, 0, 0, 0 },

View File

@ -36,7 +36,7 @@ static void test_input(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -109,7 +109,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_MAILMARK, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_MAILMARK, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -133,12 +133,12 @@ static void test_encode_vector(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret_encode; int ret_encode;
float w; float w;
float h; float h;
int ret_vector; int ret_vector;
unsigned char *expected_daft; char *expected_daft;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -179,7 +179,7 @@ static void test_encode_vector(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
assert_equal(symbol->rows, 3, "i:%d symbol->rows %d != 3\n", i, symbol->rows); assert_equal(symbol->rows, 3, "i:%d symbol->rows %d != 3\n", i, symbol->rows);
@ -203,7 +203,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -231,7 +231,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_MAILMARK, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_MAILMARK, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
int option_1; int option_1;
unsigned char *pattern; char *pattern;
int length; int length;
char* primary; char* primary;
int ret; int ret;
@ -73,7 +73,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_MAXICODE, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, BARCODE_MAXICODE, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
strcpy(symbol->primary, data[i].primary); strcpy(symbol->primary, data[i].primary);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -95,7 +95,7 @@ static void test_encode(int index, int generate, int debug) {
struct item { struct item {
int input_mode; int input_mode;
int option_1; int option_1;
unsigned char *data; char *data;
char* primary; char* primary;
int ret; int ret;
@ -190,7 +190,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_MAXICODE, data[i].input_mode, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_MAXICODE, data[i].input_mode, -1 /*eci*/, data[i].option_1, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
strcpy(symbol->primary, data[i].primary); strcpy(symbol->primary, data[i].primary);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -224,7 +224,7 @@ static void test_best_supported_set(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
float w; float w;
float h; float h;
@ -233,7 +233,7 @@ static void test_best_supported_set(int index, int generate, int debug) {
int expected_rows; int expected_rows;
int expected_width; int expected_width;
char *comment; char *comment;
unsigned char *expected; char *expected;
}; };
struct item data[] = { struct item data[] = {
/* 0*/ { "am.//ab,\034TA# z\015!", 0, 100, 100, 0, 33, 30, "TODO: Better data and verify expected", /* 0*/ { "am.//ab,\034TA# z\015!", 0, 100, 100, 0, 33, 30, "TODO: Better data and verify expected",
@ -288,7 +288,7 @@ static void test_best_supported_set(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -322,7 +322,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
}; };
@ -351,7 +351,7 @@ static void test_fuzz(int index, int debug) {
length = strlen(data[i].data); length = strlen(data[i].data);
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -39,7 +39,7 @@ static void test_large(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -74,7 +74,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -96,9 +96,9 @@ static void test_hrt(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
unsigned char *expected; char *expected;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -112,8 +112,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -123,10 +121,10 @@ static void test_hrt(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -141,7 +139,7 @@ static void test_input(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -186,7 +184,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -210,7 +208,7 @@ static void test_encode(int index, int generate, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -267,7 +265,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -48,7 +48,7 @@ static void test_pcx(int index, int debug) {
char *fgcolour; char *fgcolour;
char *bgcolour; char *bgcolour;
float scale; float scale;
unsigned char *data; char *data;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -92,7 +92,7 @@ static void test_pcx(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
char *filename = "out.pcx"; char *filename = "out.pcx";

View File

@ -41,7 +41,7 @@ static void test_options(int index, int debug) {
int option_1; int option_1;
int option_2; int option_2;
int option_3; int option_3;
unsigned char *data; char *data;
int ret_encode; int ret_encode;
int ret_vector; int ret_vector;
@ -80,7 +80,7 @@ static void test_options(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
assert_equal(symbol->option_1, data[i].expected_option_1, "i:%d symbol->option_1 %d != %d (%d) (%s)\n", i, symbol->option_1, data[i].expected_option_1, data[i].option_1, symbol->errtxt); assert_equal(symbol->option_1, data[i].expected_option_1, "i:%d symbol->option_1 %d != %d (%d) (%s)\n", i, symbol->option_1, data[i].expected_option_1, data[i].option_1, symbol->errtxt);
@ -120,7 +120,7 @@ static void test_reader_init(int index, int generate, int debug) {
int symbology; int symbology;
int input_mode; int input_mode;
int output_options; int output_options;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -146,7 +146,7 @@ static void test_reader_init(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, -1 /*option_1*/, -1 /*option_2*/, -1, data[i].output_options, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -177,7 +177,7 @@ static void test_input(int index, int generate, int debug) {
int symbology; int symbology;
int input_mode; int input_mode;
int eci; int eci;
unsigned char *data; char *data;
int ret; int ret;
int expected_eci; int expected_eci;
int expected_rows; int expected_rows;
@ -229,7 +229,7 @@ static void test_input(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -264,7 +264,7 @@ static void test_encode(int index, int generate, int debug) {
int input_mode; int input_mode;
int option_1; int option_1;
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -622,7 +622,7 @@ static void test_encode(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -670,7 +670,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
int option_1; int option_1;
int ret; int ret;
@ -951,7 +951,7 @@ static void test_fuzz(int index, int debug) {
length = strlen(data[i].data); length = strlen(data[i].data);
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -39,7 +39,7 @@ static void test_large(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -76,7 +76,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -98,9 +98,9 @@ static void test_hrt(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
unsigned char *expected; char *expected;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -120,8 +120,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -131,10 +129,10 @@ static void test_hrt(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -150,7 +148,7 @@ static void test_input(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -173,7 +171,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -195,7 +193,7 @@ static void test_encode(int index, int generate, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -242,7 +240,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -47,7 +47,7 @@ static void test_pixel_plot(int index, int debug) {
struct item { struct item {
int width; int width;
int height; int height;
unsigned char *pattern; char *pattern;
int repeat; int repeat;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
@ -63,8 +63,6 @@ static void test_pixel_plot(int index, int debug) {
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *png = "out.png"; char *png = "out.png";
char escaped[1024];
int escaped_size = 1024;
char data_buf[8 * 2 + 1]; char data_buf[8 * 2 + 1];
@ -91,7 +89,7 @@ static void test_pixel_plot(int index, int debug) {
} }
assert_equal(size, (int) strlen(data_buf), "i:%d png_pixel_plot size %d != strlen(data_buf) %d\n", i, size, (int) strlen(data_buf)); assert_equal(size, (int) strlen(data_buf), "i:%d png_pixel_plot size %d != strlen(data_buf) %d\n", i, size, (int) strlen(data_buf));
symbol->bitmap = data_buf; symbol->bitmap = (unsigned char *) data_buf;
ret = png_pixel_plot(symbol, data_buf); ret = png_pixel_plot(symbol, data_buf);
assert_zero(ret, "i:%d png_pixel_plot ret %d != 0 (%s)\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d png_pixel_plot ret %d != 0 (%s)\n", i, ret, symbol->errtxt);
@ -125,7 +123,7 @@ static void test_print(int index, int generate, int debug) {
int option_2; int option_2;
int height; int height;
float scale; float scale;
unsigned char *data; char *data;
char *composite; char *composite;
char *expected_file; char *expected_file;
char *comment; char *comment;
@ -205,7 +203,7 @@ static void test_print(int index, int generate, int debug) {
} }
int text_length = strlen(text); int text_length = strlen(text);
ret = ZBarcode_Encode(symbol, text, text_length); ret = ZBarcode_Encode(symbol, (unsigned char *) text, text_length);
assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
strcpy(symbol->outfile, png); strcpy(symbol->outfile, png);

View File

@ -42,7 +42,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -85,7 +85,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -105,7 +105,7 @@ static void test_koreapost(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret_encode; int ret_encode;
int ret_vector; int ret_vector;
@ -130,7 +130,7 @@ static void test_koreapost(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret_encode); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret_encode);
if (data[i].ret_vector != -1) { if (data[i].ret_vector != -1) {
@ -154,7 +154,7 @@ static void test_japanpost(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret_encode; int ret_encode;
int ret_vector; int ret_vector;
@ -182,7 +182,7 @@ static void test_japanpost(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret_encode); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret_encode);
if (data[i].ret_vector != -1) { if (data[i].ret_vector != -1) {
@ -207,7 +207,7 @@ static void test_input(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -261,7 +261,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -284,7 +284,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -388,7 +388,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -38,9 +38,16 @@ static void test_print(int index, int generate, int debug) {
testStart(""); testStart("");
int have_identify = testUtilHaveIdentify(); int have_identify = 0;
int have_inkscape = testUtilHaveInkscape(); int have_libreoffice = 0;
int have_ghostscript = testUtilHaveGhostscript(); int have_ghostscript = 0;
int have_vnu = 0;
if (generate) {
have_identify = testUtilHaveIdentify();
have_libreoffice = testUtilHaveLibreOffice();
have_ghostscript = testUtilHaveGhostscript();
have_vnu = testUtilHaveVnu();
}
int ret; int ret;
struct item { struct item {
@ -48,7 +55,7 @@ static void test_print(int index, int generate, int debug) {
int option_1; int option_1;
int option_2; int option_2;
float scale; float scale;
unsigned char *data; char *data;
char *expected_file; char *expected_file;
}; };
struct item data[] = { struct item data[] = {
@ -104,7 +111,7 @@ static void test_print(int index, int generate, int debug) {
symbol->scale = data[i].scale; symbol->scale = data[i].scale;
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
strcpy(symbol->outfile, "out."); strcpy(symbol->outfile, "out.");
@ -134,9 +141,13 @@ static void test_print(int index, int generate, int debug) {
assert_zero(ret, "i:%d %s ghostscript %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), expected_file, ret); assert_zero(ret, "i:%d %s ghostscript %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), expected_file, ret);
} }
} else if (strcmp(exts[j], "svg") == 0 || strcmp(exts[j], "emf") == 0) { } else if (strcmp(exts[j], "svg") == 0 || strcmp(exts[j], "emf") == 0) {
if (have_inkscape) { if (have_libreoffice) {
ret = testUtilVerifyInkscape(expected_file, debug); ret = testUtilVerifyLibreOffice(expected_file, debug); // Slow
assert_zero(ret, "i:%d %s inkscape %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), expected_file, ret); assert_zero(ret, "i:%d %s libreoffice %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), expected_file, ret);
}
if (have_vnu && strcmp(exts[j], "svg") == 0) {
ret = testUtilVerifyVnu(expected_file, debug); // Very slow
assert_zero(ret, "i:%d %s vnu %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), expected_file, ret);
} }
} else if (strcmp(exts[j], "txt") != 0) { // I.e. rasters } else if (strcmp(exts[j], "txt") != 0) { // I.e. rasters
if (have_identify) { if (have_identify) {

View File

@ -36,7 +36,7 @@ static void test_print(int index, int generate, int debug) {
testStart(""); testStart("");
int have_inkscape = testUtilHaveInkscape(); int have_ghostscript = testUtilHaveGhostscript();
int ret; int ret;
struct item { struct item {
@ -48,7 +48,7 @@ static void test_print(int index, int generate, int debug) {
int option_2; int option_2;
char *fgcolour; char *fgcolour;
char *bgcolour; char *bgcolour;
unsigned char *data; char *data;
char *expected_file; char *expected_file;
}; };
struct item data[] = { struct item data[] = {
@ -94,7 +94,7 @@ static void test_print(int index, int generate, int debug) {
strcpy(symbol->bgcolour, data[i].bgcolour); strcpy(symbol->bgcolour, data[i].bgcolour);
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
strcpy(symbol->outfile, eps); strcpy(symbol->outfile, eps);
@ -107,9 +107,9 @@ static void test_print(int index, int generate, int debug) {
data[i].option_1, data[i].option_2, data[i].fgcolour, data[i].bgcolour, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); data[i].option_1, data[i].option_2, data[i].fgcolour, data[i].bgcolour, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file);
ret = rename(symbol->outfile, data[i].expected_file); ret = rename(symbol->outfile, data[i].expected_file);
assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret); assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret);
if (have_inkscape) { if (have_ghostscript) {
ret = testUtilVerifyInkscape(data[i].expected_file, debug); ret = testUtilVerifyGhostscript(data[i].expected_file, debug);
assert_zero(ret, "i:%d %s inkscape %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret); assert_zero(ret, "i:%d %s ghostscript %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret);
} }
} else { } else {
assert_nonzero(testUtilExists(symbol->outfile), "i:%d testUtilExists(%s) == 0\n", i, symbol->outfile); assert_nonzero(testUtilExists(symbol->outfile), "i:%d testUtilExists(%s) == 0\n", i, symbol->outfile);
@ -128,14 +128,13 @@ static void test_print(int index, int generate, int debug) {
void ps_convert(const unsigned char *string, unsigned char *ps_string); void ps_convert(const unsigned char *string, unsigned char *ps_string);
static void test_ps_convert(int index, int debug) { static void test_ps_convert(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
unsigned char *data; char *data;
unsigned char *expected; char *expected;
}; };
struct item data[] = { struct item data[] = {
/* 0*/ { "1\\(é)2€3", "1\\\\\\(\351\\)23" }, /* 0*/ { "1\\(é)2€3", "1\\\\\\(\351\\)23" },
@ -148,8 +147,8 @@ static void test_ps_convert(int index, int debug) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
ps_convert(data[i].data, converted); ps_convert((unsigned char *) data[i].data, converted);
assert_zero(strcmp(converted, data[i].expected), "i:%d ps_convert(%s) %s != %s\n", i, data[i].data, converted, data[i].expected); assert_zero(strcmp((char *) converted, data[i].expected), "i:%d ps_convert(%s) %s != %s\n", i, data[i].data, converted, data[i].expected);
} }
testFinish(); testFinish();
@ -159,7 +158,7 @@ int main(int argc, char *argv[]) {
testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */ testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */
{ "test_print", test_print, 1, 1, 1 }, { "test_print", test_print, 1, 1, 1 },
{ "test_ps_convert", test_ps_convert, 1, 0, 1 }, { "test_ps_convert", test_ps_convert, 1, 0, 0 },
}; };
testRun(argc, argv, funcs, ARRAY_SIZE(funcs)); testRun(argc, argv, funcs, ARRAY_SIZE(funcs));

View File

@ -37,7 +37,7 @@ static void test_qr_options(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret_encode; int ret_encode;
@ -102,7 +102,7 @@ static void test_qr_options(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
if (index == -1 && data[i].compare_previous != -1) { if (index == -1 && data[i].compare_previous != -1) {
ret = testUtilSymbolCmp(symbol, &previous_symbol); ret = testUtilSymbolCmp(symbol, &previous_symbol);
@ -132,7 +132,7 @@ static void test_qr_input(int index, int generate, int debug) {
int input_mode; int input_mode;
int eci; int eci;
int option_3; int option_3;
unsigned char *data; char *data;
int ret; int ret;
int expected_eci; int expected_eci;
char *expected; char *expected;
@ -265,7 +265,7 @@ static void test_qr_input(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -292,7 +292,7 @@ static void test_qr_gs1(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
char *expected; char *expected;
char *comment; char *comment;
@ -327,7 +327,7 @@ static void test_qr_gs1(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -352,7 +352,7 @@ static void test_qr_optimize(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int option_1; int option_1;
int ret; int ret;
char *expected; char *expected;
@ -412,7 +412,7 @@ static void test_qr_optimize(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -436,7 +436,7 @@ static void test_qr_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret; int ret;
@ -935,7 +935,7 @@ static void test_qr_encode(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -969,7 +969,7 @@ static void test_microqr_options(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret_encode; int ret_encode;
@ -1051,7 +1051,7 @@ static void test_microqr_options(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
if (index == -1 && data[i].compare_previous != -1) { if (index == -1 && data[i].compare_previous != -1) {
ret = testUtilSymbolCmp(symbol, &previous_symbol); ret = testUtilSymbolCmp(symbol, &previous_symbol);
@ -1080,7 +1080,7 @@ static void test_microqr_input(int index, int generate, int debug) {
struct item { struct item {
int input_mode; int input_mode;
int option_3; int option_3;
unsigned char *data; char *data;
int ret; int ret;
char *expected; char *expected;
char *comment; char *comment;
@ -1162,7 +1162,7 @@ static void test_microqr_input(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -1188,7 +1188,7 @@ static void test_microqr_padding(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int option_1; int option_1;
int ret; int ret;
char *expected; char *expected;
@ -1242,7 +1242,7 @@ static void test_microqr_padding(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -1268,7 +1268,7 @@ static void test_microqr_optimize(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret; int ret;
@ -1312,7 +1312,7 @@ static void test_microqr_optimize(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -1336,7 +1336,7 @@ static void test_microqr_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret; int ret;
@ -1522,7 +1522,7 @@ static void test_microqr_encode(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -1557,7 +1557,7 @@ static void test_upnqr_input(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int ret; int ret;
char *expected; char *expected;
char *comment; char *comment;
@ -1589,7 +1589,7 @@ static void test_upnqr_input(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
assert_equal(symbol->eci, 4, "i:%d ZBarcode_Encode symbol->eci %d != 4\n", i, symbol->eci); assert_equal(symbol->eci, 4, "i:%d ZBarcode_Encode symbol->eci %d != 4\n", i, symbol->eci);
@ -1616,7 +1616,7 @@ static void test_upnqr_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret; int ret;
@ -1729,7 +1729,7 @@ static void test_upnqr_encode(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -1763,7 +1763,7 @@ static void test_rmqr_options(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret_encode; int ret_encode;
@ -1861,7 +1861,7 @@ static void test_rmqr_options(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
if (data[i].ret_vector != -1) { if (data[i].ret_vector != -1) {
@ -1885,7 +1885,7 @@ static void test_rmqr_input(int index, int generate, int debug) {
struct item { struct item {
int input_mode; int input_mode;
int option_3; int option_3;
unsigned char *data; char *data;
int ret; int ret;
char *expected; char *expected;
char *comment; char *comment;
@ -1933,7 +1933,7 @@ static void test_rmqr_input(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -1958,7 +1958,7 @@ static void test_rmqr_gs1(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret; int ret;
char *expected; char *expected;
char *comment; char *comment;
@ -1994,7 +1994,7 @@ static void test_rmqr_gs1(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -2019,7 +2019,7 @@ static void test_rmqr_optimize(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int option_1; int option_1;
int ret; int ret;
char *expected; char *expected;
@ -2071,7 +2071,7 @@ static void test_rmqr_optimize(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -2095,7 +2095,7 @@ static void test_rmqr_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int input_mode; int input_mode;
unsigned char *data; char *data;
int option_1; int option_1;
int option_2; int option_2;
int ret; int ret;
@ -2156,7 +2156,7 @@ static void test_rmqr_encode(int index, int generate, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -51,7 +51,7 @@ static void test_options(int index, int debug) {
char *fgcolour; char *fgcolour;
char *bgcolour; char *bgcolour;
int rotate_angle; int rotate_angle;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -88,7 +88,7 @@ static void test_options(int index, int debug) {
strcpy(symbol->bgcolour, data[i].bgcolour); strcpy(symbol->bgcolour, data[i].bgcolour);
} }
ret = ZBarcode_Encode_and_Buffer(symbol, data[i].data, length, data[i].rotate_angle); ret = ZBarcode_Encode_and_Buffer(symbol, (unsigned char *) data[i].data, length, data[i].rotate_angle);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -111,7 +111,7 @@ static void test_buffer(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
char *composite; char *composite;
int expected_height; int expected_height;
@ -274,7 +274,7 @@ static void test_buffer(int index, int generate, int debug) {
} }
int length = strlen(text); int length = strlen(text);
ret = ZBarcode_Encode(symbol, text, length); ret = ZBarcode_Encode(symbol, (unsigned char *) text, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%s) ret %d != 0 (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%s) ret %d != 0 (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
ret = ZBarcode_Buffer(symbol, 0); ret = ZBarcode_Buffer(symbol, 0);
@ -311,7 +311,7 @@ static void test_upcean_hrt(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int show_hrt; int show_hrt;
unsigned char *data; char *data;
int ret; int ret;
int expected_height; int expected_height;
@ -379,7 +379,7 @@ static void test_upcean_hrt(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode_and_Buffer(symbol, data[i].data, length, 0); ret = ZBarcode_Encode_and_Buffer(symbol, (unsigned char *) data[i].data, length, 0);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret);
assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology); assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology);
@ -448,7 +448,7 @@ static void test_row_separator(int index, int debug) {
int border_width; int border_width;
int option_1; int option_1;
int option_3; int option_3;
unsigned char *data; char *data;
int ret; int ret;
int expected_height; int expected_height;
@ -486,7 +486,7 @@ static void test_row_separator(int index, int debug) {
symbol->border_width = data[i].border_width; symbol->border_width = data[i].border_width;
} }
ret = ZBarcode_Encode_and_Buffer(symbol, data[i].data, length, 0); ret = ZBarcode_Encode_and_Buffer(symbol, (unsigned char *) data[i].data, length, 0);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
assert_nonnull(symbol->bitmap, "i:%d (%s) symbol->bitmap NULL\n", i, testUtilBarcodeName(data[i].symbology)); assert_nonnull(symbol->bitmap, "i:%d (%s) symbol->bitmap NULL\n", i, testUtilBarcodeName(data[i].symbology));
@ -533,8 +533,8 @@ static void test_stacking(int index, int debug) {
int output_options; int output_options;
int option_1; int option_1;
int option_3; int option_3;
unsigned char *data; char *data;
unsigned char *data2; char *data2;
int expected_height; int expected_height;
int expected_rows; int expected_rows;
@ -561,11 +561,11 @@ static void test_stacking(int index, int debug) {
assert_nonnull(symbol, "Symbol not created\n"); assert_nonnull(symbol, "Symbol not created\n");
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, data[i].option_3, data[i].output_options, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, data[i].option_3, data[i].output_options, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ret %d != zero\n", i, ret); assert_zero(ret, "i:%d ret %d != zero\n", i, ret);
int length2 = strlen(data[i].data2); int length2 = strlen(data[i].data2);
ret = ZBarcode_Encode(symbol, data[i].data2, length2); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data2, length2);
assert_zero(ret, "i:%d ret %d != zero\n", i, ret); assert_zero(ret, "i:%d ret %d != zero\n", i, ret);
ret = ZBarcode_Buffer(symbol, 0); ret = ZBarcode_Buffer(symbol, 0);
@ -616,7 +616,7 @@ static void test_output_options(int index, int debug) {
int border_width; int border_width;
int output_options; int output_options;
int rotate_angle; int rotate_angle;
unsigned char *data; char *data;
int ret; int ret;
int expected_height; int expected_height;
@ -692,8 +692,6 @@ static void test_output_options(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
struct zint_vector_rect *rect;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -709,7 +707,7 @@ static void test_output_options(int index, int debug) {
symbol->border_width = data[i].border_width; symbol->border_width = data[i].border_width;
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%s) ret %d != 0 (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%s) ret %d != 0 (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
ret = ZBarcode_Buffer(symbol, data[i].rotate_angle); ret = ZBarcode_Buffer(symbol, data[i].rotate_angle);
@ -754,8 +752,8 @@ static void test_draw_string_wrap(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int output_options; int output_options;
unsigned char *data; char *data;
unsigned char* text; char* text;
int expected_height; int expected_height;
int expected_rows; int expected_rows;
@ -782,11 +780,11 @@ static void test_draw_string_wrap(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, data[i].output_options, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, data[i].output_options, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 (%s)\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 (%s)\n", i, data[i].symbology, ret, symbol->errtxt);
// Cheat by overwriting text // Cheat by overwriting text
strcpy(symbol->text, data[i].text); strcpy((char *) symbol->text, data[i].text);
ret = ZBarcode_Buffer(symbol, 0); ret = ZBarcode_Buffer(symbol, 0);
assert_zero(ret, "i:%d ZBarcode_Buffer(%d) ret %d != 0 (%s)\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Buffer(%d) ret %d != 0 (%s)\n", i, data[i].symbology, ret, symbol->errtxt);
@ -825,7 +823,7 @@ static void test_code128_utf8(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int expected_height; int expected_height;
int expected_rows; int expected_rows;
@ -851,7 +849,7 @@ static void test_code128_utf8(int index, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_CODE128, UNICODE_MODE, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_CODE128, UNICODE_MODE, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, BARCODE_CODE128, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, BARCODE_CODE128, ret, symbol->errtxt);
ret = ZBarcode_Buffer(symbol, 0); ret = ZBarcode_Buffer(symbol, 0);
@ -895,7 +893,7 @@ static void test_scale(int index, int debug) {
int border_width; int border_width;
int output_options; int output_options;
float scale; float scale;
unsigned char *data; char *data;
char *composite; char *composite;
int expected_height; int expected_height;
@ -961,7 +959,7 @@ static void test_scale(int index, int debug) {
} }
int length = strlen(text); int length = strlen(text);
ret = ZBarcode_Encode(symbol, text, length); ret = ZBarcode_Encode(symbol, (unsigned char *) text, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt);
ret = ZBarcode_Buffer(symbol, 0); ret = ZBarcode_Buffer(symbol, 0);

View File

@ -1059,8 +1059,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;

View File

@ -112,7 +112,7 @@ static void test_sjis_utf8tomb(int index) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -151,7 +151,7 @@ static void test_sjis_utf8tomb(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
ret = sjis_utf8tomb(&symbol, data[i].data, &ret_length, jisdata); ret = sjis_utf8tomb(&symbol, (unsigned char *) data[i].data, &ret_length, jisdata);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol.errtxt); assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol.errtxt);
if (ret == 0) { if (ret == 0) {
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
@ -172,7 +172,7 @@ static void test_sjis_utf8tosb(int index) {
struct item { struct item {
int eci; int eci;
int full_multibyte; int full_multibyte;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -217,7 +217,7 @@ static void test_sjis_utf8tosb(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
ret = sjis_utf8tosb(data[i].eci, data[i].data, &ret_length, jisdata, data[i].full_multibyte); ret = sjis_utf8tosb(data[i].eci, (unsigned char *) data[i].data, &ret_length, jisdata, data[i].full_multibyte);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret);
if (ret == 0) { if (ret == 0) {
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
@ -234,10 +234,9 @@ static void test_sjis_cpy(int index) {
testStart(""); testStart("");
int ret;
struct item { struct item {
int full_multibyte; int full_multibyte;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
size_t ret_length; size_t ret_length;
@ -268,7 +267,7 @@ static void test_sjis_cpy(int index) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
size_t ret_length = length; size_t ret_length = length;
sjis_cpy(data[i].data, &ret_length, jisdata, data[i].full_multibyte); sjis_cpy((unsigned char *) data[i].data, &ret_length, jisdata, data[i].full_multibyte);
assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length); assert_equal(ret_length, data[i].ret_length, "i:%d ret_length %zu != %zu\n", i, ret_length, data[i].ret_length);
for (int j = 0; j < (int) ret_length; j++) { for (int j = 0; j < (int) ret_length; j++) {
assert_equal(jisdata[j], data[i].expected_jisdata[j], "i:%d jisdata[%d] %04X != %04X\n", i, j, jisdata[j], data[i].expected_jisdata[j]); assert_equal(jisdata[j], data[i].expected_jisdata[j], "i:%d jisdata[%d] %04X != %04X\n", i, j, jisdata[j], data[i].expected_jisdata[j]);

View File

@ -36,53 +36,59 @@ static void test_print(int index, int generate, int debug) {
testStart(""); testStart("");
int have_inkscape = testUtilHaveInkscape(); int have_libreoffice = 0;
int have_vnu = 0;
if (generate) {
have_libreoffice = testUtilHaveLibreOffice();
have_vnu = testUtilHaveVnu();
}
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
int input_mode; int input_mode;
int border_width;
int output_options; int output_options;
int show_hrt; int show_hrt;
int option_1; int option_1;
int option_2; int option_2;
unsigned char *data; char *data;
char *composite; char *composite;
char *expected_file; char *expected_file;
}; };
struct item data[] = { struct item data[] = {
/* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, -1, "<>\"&'", "", "../data/svg/code128_amperands.svg" }, /* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, -1, -1, "<>\"&'", "", "../data/svg/code128_amperands.svg" },
/* 1*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT, -1, -1, -1, "Égjpqy", "", "../data/svg/code128_egrave_bold.svg" }, /* 1*/ { BARCODE_CODE128, UNICODE_MODE, -1, BOLD_TEXT, -1, -1, -1, "Égjpqy", "", "../data/svg/code128_egrave_bold.svg" },
/* 2*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT | BARCODE_BOX, -1, -1, -1, "Égjpqy", "", "../data/svg/code128_egrave_bold_box3.svg" }, /* 2*/ { BARCODE_CODE128, UNICODE_MODE, 3, BOLD_TEXT | BARCODE_BOX, -1, -1, -1, "Égjpqy", "", "../data/svg/code128_egrave_bold_box3.svg" },
/* 3*/ { BARCODE_GS1_128_CC, -1, -1, -1, 3, -1, "[00]030123456789012340", "[02]13012345678909[37]24[10]1234567ABCDEFG", "../data/svg/gs1_128_cc_fig12.svg" }, /* 3*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, 3, -1, "[00]030123456789012340", "[02]13012345678909[37]24[10]1234567ABCDEFG", "../data/svg/gs1_128_cc_fig12.svg" },
/* 4*/ { BARCODE_CODABLOCKF, -1, -1, -1, 3, -1, "AAAAAAAAA", "", "../data/svg/codablockf_3rows.svg" }, /* 4*/ { BARCODE_CODABLOCKF, -1, -1, -1, -1, 3, -1, "AAAAAAAAA", "", "../data/svg/codablockf_3rows.svg" },
/* 5*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "9771384524017+12", "", "../data/svg/ean13_2addon_ggs_5.2.2.5.1-2.svg" }, /* 5*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, "9771384524017+12", "", "../data/svg/ean13_2addon_ggs_5.2.2.5.1-2.svg" },
/* 6*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "9780877799306+54321", "", "../data/svg/ean13_5addon_ggs_5.2.2.5.2-2.svg" }, /* 6*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, "9780877799306+54321", "", "../data/svg/ean13_5addon_ggs_5.2.2.5.2-2.svg" },
/* 7*/ { BARCODE_EANX_CC, -1, -1, -1, 1, -1, "123456789012+12", "[91]123456789012345678901", "../data/svg/ean13_cc_2addon_cca_4x4.svg" }, /* 7*/ { BARCODE_EANX_CC, -1, -1, -1, -1, 1, -1, "123456789012+12", "[91]123456789012345678901", "../data/svg/ean13_cc_2addon_cca_4x4.svg" },
/* 8*/ { BARCODE_EANX_CC, -1, -1, -1, 2, -1, "123456789012+54321", "[91]1234567890", "../data/svg/ean13_cc_5addon_ccb_3x4.svg" }, /* 8*/ { BARCODE_EANX_CC, -1, -1, -1, -1, 2, -1, "123456789012+54321", "[91]1234567890", "../data/svg/ean13_cc_5addon_ccb_3x4.svg" },
/* 9*/ { BARCODE_EANX_CC, -1, -1, 0, 2, -1, "123456789012+54321", "[91]1234567890", "../data/svg/ean13_cc_5addon_ccb_3x4_notext.svg" }, /* 9*/ { BARCODE_EANX_CC, -1, -1, -1, 0, 2, -1, "123456789012+54321", "[91]1234567890", "../data/svg/ean13_cc_5addon_ccb_3x4_notext.svg" },
/* 10*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "012345678905+24", "", "../data/svg/upca_2addon_ggs_5.2.6.6-5.svg" }, /* 10*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, -1, "012345678905+24", "", "../data/svg/upca_2addon_ggs_5.2.6.6-5.svg" },
/* 11*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon.svg" }, /* 11*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon.svg" },
/* 12*/ { BARCODE_UPCA, -1, BARCODE_BIND, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon_bind3.svg" }, /* 12*/ { BARCODE_UPCA, -1, 3, BARCODE_BIND, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon_bind3.svg" },
/* 13*/ { BARCODE_UPCA, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon_small_bold.svg" }, /* 13*/ { BARCODE_UPCA, -1, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon_small_bold.svg" },
/* 14*/ { BARCODE_UPCA_CC, -1, -1, -1, 1, -1, "12345678901+12", "[91]123456789", "../data/svg/upca_cc_2addon_cca_3x4.svg" }, /* 14*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, 1, -1, "12345678901+12", "[91]123456789", "../data/svg/upca_cc_2addon_cca_3x4.svg" },
/* 15*/ { BARCODE_UPCA_CC, -1, -1, -1, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4.svg" }, /* 15*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4.svg" },
/* 16*/ { BARCODE_UPCA_CC, -1, -1, 0, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4_notext.svg" }, /* 16*/ { BARCODE_UPCA_CC, -1, -1, -1, 0, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4_notext.svg" },
/* 17*/ { BARCODE_UPCA_CC, -1, BARCODE_BIND, -1, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4_bind3.svg" }, /* 17*/ { BARCODE_UPCA_CC, -1, 3, BARCODE_BIND, -1, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4_bind3.svg" },
/* 18*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, "1234567+12", "", "../data/svg/upce_2addon.svg" }, /* 18*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, -1, "1234567+12", "", "../data/svg/upce_2addon.svg" },
/* 19*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, "1234567+12345", "", "../data/svg/upce_5addon.svg" }, /* 19*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, -1, "1234567+12345", "", "../data/svg/upce_5addon.svg" },
/* 20*/ { BARCODE_UPCE, -1, -1, 0, -1, -1, "1234567+12345", "", "../data/svg/upce_5addon_notext.svg" }, /* 20*/ { BARCODE_UPCE, -1, -1, -1, 0, -1, -1, "1234567+12345", "", "../data/svg/upce_5addon_notext.svg" },
/* 21*/ { BARCODE_UPCE_CC, -1, -1, -1, 1, -1, "0654321+89", "[91]1", "../data/svg/upce_cc_2addon_cca_5x2.svg" }, /* 21*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, 1, -1, "0654321+89", "[91]1", "../data/svg/upce_cc_2addon_cca_5x2.svg" },
/* 22*/ { BARCODE_UPCE_CC, -1, -1, -1, 2, -1, "1876543+56789", "[91]12345", "../data/svg/upce_cc_5addon_ccb_8x2.svg" }, /* 22*/ { BARCODE_UPCE_CC, -1, -1, -1, -1, 2, -1, "1876543+56789", "[91]12345", "../data/svg/upce_cc_5addon_ccb_8x2.svg" },
/* 23*/ { BARCODE_UPCE_CC, -1, -1, 0, 2, -1, "1876543+56789", "[91]12345", "../data/svg/upce_cc_5addon_ccb_8x2_notext.svg" }, /* 23*/ { BARCODE_UPCE_CC, -1, -1, -1, 0, 2, -1, "1876543+56789", "[91]12345", "../data/svg/upce_cc_5addon_ccb_8x2_notext.svg" },
/* 24*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "1234567+12", "", "../data/svg/ean8_2addon.svg" }, /* 24*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, "1234567+12", "", "../data/svg/ean8_2addon.svg" },
/* 25*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "1234567+12345", "", "../data/svg/ean8_5addon.svg" }, /* 25*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, "1234567+12345", "", "../data/svg/ean8_5addon.svg" },
/* 26*/ { BARCODE_EANX_CC, -1, -1, -1, 1, -1, "9876543+65", "[91]1234567", "../data/svg/ean8_cc_2addon_cca_4x3.svg" }, /* 26*/ { BARCODE_EANX_CC, -1, -1, -1, -1, 1, -1, "9876543+65", "[91]1234567", "../data/svg/ean8_cc_2addon_cca_4x3.svg" },
/* 27*/ { BARCODE_EANX_CC, -1, -1, -1, 2, -1, "9876543+74083", "[91]123456789012345678", "../data/svg/ean8_cc_5addon_ccb_8x3.svg" }, /* 27*/ { BARCODE_EANX_CC, -1, -1, -1, -1, 2, -1, "9876543+74083", "[91]123456789012345678", "../data/svg/ean8_cc_5addon_ccb_8x3.svg" },
/* 28*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "12345", "", "../data/svg/ean5.svg" }, /* 28*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, "12345", "", "../data/svg/ean5.svg" },
/* 29*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "12", "", "../data/svg/ean2.svg" }, /* 29*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, "12", "", "../data/svg/ean2.svg" },
/* 30*/ { BARCODE_CODE39, -1, SMALL_TEXT, -1, -1, -1, "123", "", "../data/svg/code39_small.svg" }, /* 30*/ { BARCODE_CODE39, -1, -1, SMALL_TEXT, -1, -1, -1, "123", "", "../data/svg/code39_small.svg" },
/* 31*/ { BARCODE_POSTNET, -1, -1, -1, -1, -1, "12345", "", "../data/svg/postnet_zip.svg" }, /* 31*/ { BARCODE_POSTNET, -1, -1, -1, -1, -1, -1, "12345", "", "../data/svg/postnet_zip.svg" },
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
@ -110,8 +116,8 @@ static void test_print(int index, int generate, int debug) {
if (data[i].show_hrt != -1) { if (data[i].show_hrt != -1) {
symbol->show_hrt = data[i].show_hrt; symbol->show_hrt = data[i].show_hrt;
} }
if (data[i].output_options & (BARCODE_BOX | BARCODE_BIND)) { if (data[i].border_width != -1) {
symbol->border_width = 3; symbol->border_width = data[i].border_width;
} }
if (strlen(data[i].composite)) { if (strlen(data[i].composite)) {
text = data[i].composite; text = data[i].composite;
@ -121,7 +127,7 @@ static void test_print(int index, int generate, int debug) {
} }
int text_length = strlen(text); int text_length = strlen(text);
ret = ZBarcode_Encode(symbol, text, text_length); ret = ZBarcode_Encode(symbol, (unsigned char *) text, text_length);
assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt);
strcpy(symbol->outfile, svg); strcpy(symbol->outfile, svg);
@ -129,14 +135,18 @@ static void test_print(int index, int generate, int debug) {
assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret); assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret);
if (generate) { if (generate) {
printf(" /*%3d*/ { %s, %s, %s, %d, %d, %d, \"%s\", \"%s\", \"%s\" },\n", printf(" /*%3d*/ { %s, %s, %d, %s, %d, %d, %d, \"%s\", \"%s\", \"%s\" },\n",
i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), testUtilOutputOptionsName(data[i].output_options), i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), data[i].border_width, testUtilOutputOptionsName(data[i].output_options),
data[i].show_hrt, data[i].option_1, data[i].option_2, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].composite, data[i].expected_file); data[i].show_hrt, data[i].option_1, data[i].option_2, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].composite, data[i].expected_file);
ret = rename(symbol->outfile, data[i].expected_file); ret = rename(symbol->outfile, data[i].expected_file);
assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret); assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret);
if (have_inkscape) { if (have_libreoffice) {
ret = testUtilVerifyInkscape(data[i].expected_file, debug); ret = testUtilVerifyLibreOffice(data[i].expected_file, debug);
assert_zero(ret, "i:%d %s inkscape %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret); assert_zero(ret, "i:%d %s libreoffice %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret);
}
if (have_vnu) {
ret = testUtilVerifyVnu(data[i].expected_file, debug); // Very slow
assert_zero(ret, "i:%d %s vnu libreoffice %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret);
} }
} else { } else {
assert_nonzero(testUtilExists(symbol->outfile), "i:%d testUtilExists(%s) == 0\n", i, symbol->outfile); assert_nonzero(testUtilExists(symbol->outfile), "i:%d testUtilExists(%s) == 0\n", i, symbol->outfile);

View File

@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *pattern; char *pattern;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -67,7 +67,7 @@ static void test_large(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data_buf, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data_buf, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data_buf, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -88,10 +88,10 @@ static void test_hrt(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
unsigned char *expected; char *expected;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = { struct item data[] = {
@ -106,8 +106,6 @@ static void test_hrt(int index, int debug) {
}; };
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *text;
for (int i = 0; i < data_size; i++) { for (int i = 0; i < data_size; i++) {
if (index != -1 && i != index) continue; if (index != -1 && i != index) continue;
@ -117,10 +115,10 @@ static void test_hrt(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt);
assert_zero(strcmp(symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected); assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->text, data[i].expected);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
} }
@ -135,7 +133,7 @@ static void test_input(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
int expected_rows; int expected_rows;
@ -164,7 +162,7 @@ static void test_input(int index, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -189,7 +187,7 @@ static void test_encode(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
@ -242,7 +240,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, data[i].length, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -285,7 +283,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
}; };
@ -314,7 +312,7 @@ static void test_fuzz(int index, int debug) {
int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; int length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length;
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -47,7 +47,7 @@ static void test_pixel_plot(int index, int debug) {
struct item { struct item {
int width; int width;
int height; int height;
unsigned char *pattern; char *pattern;
int repeat; int repeat;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
@ -84,8 +84,6 @@ static void test_pixel_plot(int index, int debug) {
int data_size = ARRAY_SIZE(data); int data_size = ARRAY_SIZE(data);
char *tif = "out.tif"; char *tif = "out.tif";
char escaped[1024];
int escaped_size = 1024;
char data_buf[2731 * 4 + 1]; char data_buf[2731 * 4 + 1];
@ -112,7 +110,7 @@ static void test_pixel_plot(int index, int debug) {
} }
assert_equal(size, (int) strlen(data_buf), "i:%d tif_pixel_plot size %d != strlen(data_buf) %d\n", i, size, (int) strlen(data_buf)); assert_equal(size, (int) strlen(data_buf), "i:%d tif_pixel_plot size %d != strlen(data_buf) %d\n", i, size, (int) strlen(data_buf));
symbol->bitmap = data_buf; symbol->bitmap = (unsigned char *) data_buf;
ret = tif_pixel_plot(symbol, data_buf); ret = tif_pixel_plot(symbol, data_buf);
assert_zero(ret, "i:%d tif_pixel_plot ret %d != 0 (%s)\n", i, ret, symbol->errtxt); assert_zero(ret, "i:%d tif_pixel_plot ret %d != 0 (%s)\n", i, ret, symbol->errtxt);

View File

@ -41,7 +41,7 @@ static void test_input(int index, int generate, int debug) {
int eci; int eci;
int option_1; int option_1;
int option_3; int option_3;
unsigned char *data; char *data;
int ret; int ret;
char *expected; char *expected;
char *comment; char *comment;
@ -108,7 +108,7 @@ static void test_input(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_ULTRA, data[i].input_mode, data[i].eci, data[i].option_1, -1, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_ULTRA, data[i].input_mode, data[i].eci, data[i].option_1, -1, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret);
if (generate) { if (generate) {
@ -137,7 +137,7 @@ static void test_encode(int index, int generate, int debug) {
int eci; int eci;
int option_1; int option_1;
int option_3; int option_3;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -433,7 +433,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, BARCODE_ULTRA, data[i].input_mode, data[i].eci, data[i].option_1, -1, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, BARCODE_ULTRA, data[i].input_mode, data[i].eci, data[i].option_1, -1, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {

View File

@ -38,7 +38,7 @@ static void test_upce_length(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%2d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%2d*\/", line(".") - line("'<"))
@ -73,7 +73,7 @@ static void test_upce_length(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);
@ -90,7 +90,7 @@ static void test_upca_print(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret; int ret;
}; };
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
@ -111,7 +111,7 @@ static void test_upca_print(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
strcpy(symbol->outfile, "out.gif"); strcpy(symbol->outfile, "out.gif");
@ -132,7 +132,7 @@ static void test_isbn(int index, int debug) {
int ret; int ret;
struct item { struct item {
unsigned char *data; char *data;
int ret_encode; int ret_encode;
int ret_vector; int ret_vector;
}; };
@ -196,7 +196,7 @@ static void test_isbn(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
if (data[i].ret_vector != -1) { if (data[i].ret_vector != -1) {
@ -217,7 +217,7 @@ static void test_vector_same(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int ret_encode; int ret_encode;
int ret_vector; int ret_vector;
}; };
@ -244,7 +244,7 @@ static void test_vector_same(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt); assert_equal(ret, data[i].ret_encode, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret_encode, symbol->errtxt);
ret = ZBarcode_Buffer_Vector(symbol, 0); ret = ZBarcode_Buffer_Vector(symbol, 0);
@ -283,7 +283,7 @@ static void test_encode(int index, int generate, int debug) {
struct item { struct item {
int symbology; int symbology;
int option_2; int option_2;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
@ -415,7 +415,7 @@ static void test_encode(int index, int generate, int debug) {
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) { if (generate) {
@ -457,7 +457,7 @@ static void test_fuzz(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int length; int length;
int ret; int ret;
}; };
@ -491,7 +491,7 @@ static void test_fuzz(int index, int debug) {
length = strlen(data[i].data); length = strlen(data[i].data);
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
ZBarcode_Delete(symbol); ZBarcode_Delete(symbol);

View File

@ -70,7 +70,7 @@ static void test_options(int index, int debug) {
char *fgcolour; char *fgcolour;
char *bgcolour; char *bgcolour;
int rotate_angle; int rotate_angle;
unsigned char *data; char *data;
int ret; int ret;
int expected_rows; int expected_rows;
int expected_width; int expected_width;
@ -103,7 +103,7 @@ static void test_options(int index, int debug) {
strcpy(symbol->bgcolour, data[i].bgcolour); strcpy(symbol->bgcolour, data[i].bgcolour);
} }
ret = ZBarcode_Encode_and_Buffer_Vector(symbol, data[i].data, length, data[i].rotate_angle); ret = ZBarcode_Encode_and_Buffer_Vector(symbol, (unsigned char *) data[i].data, length, data[i].rotate_angle);
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (ret < 5) { if (ret < 5) {
@ -128,7 +128,7 @@ static void test_buffer_vector(int index, int generate, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
char *composite; char *composite;
int expected_height; int expected_height;
@ -289,7 +289,7 @@ static void test_buffer_vector(int index, int generate, int debug) {
} }
int length = strlen(text); int length = strlen(text);
ret = ZBarcode_Encode(symbol, text, length); ret = ZBarcode_Encode(symbol, (unsigned char *) text, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt);
ret = ZBarcode_Buffer_Vector(symbol, 0); ret = ZBarcode_Buffer_Vector(symbol, 0);
@ -324,7 +324,7 @@ static void test_upcean_hrt(int index, int debug) {
struct item { struct item {
int symbology; int symbology;
int show_hrt; int show_hrt;
unsigned char *data; char *data;
int ret; int ret;
int expected_height; int expected_height;
@ -395,7 +395,7 @@ static void test_upcean_hrt(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt);
ret = ZBarcode_Buffer_Vector(symbol, 0); ret = ZBarcode_Buffer_Vector(symbol, 0);
@ -446,7 +446,7 @@ static void test_row_separator(int index, int debug) {
int border_width; int border_width;
int option_1; int option_1;
int option_3; int option_3;
unsigned char *data; char *data;
int ret; int ret;
int expected_height; int expected_height;
@ -484,7 +484,7 @@ static void test_row_separator(int index, int debug) {
symbol->border_width = data[i].border_width; symbol->border_width = data[i].border_width;
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt);
ret = ZBarcode_Buffer_Vector(symbol, 0); ret = ZBarcode_Buffer_Vector(symbol, 0);
@ -514,8 +514,8 @@ static void test_stacking(int index, int debug) {
int output_options; int output_options;
int option_1; int option_1;
int option_3; int option_3;
unsigned char *data; char *data;
unsigned char *data2; char *data2;
int expected_height; int expected_height;
int expected_rows; int expected_rows;
@ -544,11 +544,11 @@ static void test_stacking(int index, int debug) {
assert_nonnull(symbol, "Symbol not created\n"); assert_nonnull(symbol, "Symbol not created\n");
int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, data[i].option_3, data[i].output_options, data[i].data, -1, debug); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, -1, data[i].option_3, data[i].output_options, data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ret %d != zero\n", i, ret); assert_zero(ret, "i:%d ret %d != zero\n", i, ret);
int length2 = strlen(data[i].data2); int length2 = strlen(data[i].data2);
ret = ZBarcode_Encode(symbol, data[i].data2, length2); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data2, length2);
assert_zero(ret, "i:%d ret %d != zero\n", i, ret); assert_zero(ret, "i:%d ret %d != zero\n", i, ret);
ret = ZBarcode_Buffer(symbol, 0); ret = ZBarcode_Buffer(symbol, 0);
@ -593,7 +593,7 @@ static void test_output_options(int index, int debug) {
int whitespace_width; int whitespace_width;
int border_width; int border_width;
int output_options; int output_options;
unsigned char *data; char *data;
int ret; int ret;
int expected_height; int expected_height;
@ -666,7 +666,7 @@ static void test_output_options(int index, int debug) {
symbol->border_width = data[i].border_width; symbol->border_width = data[i].border_width;
} }
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt);
ret = ZBarcode_Buffer_Vector(symbol, 0); ret = ZBarcode_Buffer_Vector(symbol, 0);
@ -713,7 +713,7 @@ static void test_noncomposite_string_x(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int expected_width; int expected_width;
float expected_string_x; float expected_string_x;
@ -739,7 +739,7 @@ static void test_noncomposite_string_x(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt);
ret = ZBarcode_Buffer_Vector(symbol, 0); ret = ZBarcode_Buffer_Vector(symbol, 0);
@ -765,7 +765,7 @@ static void test_upcean_whitespace_width(int index, int debug) {
int ret; int ret;
struct item { struct item {
int symbology; int symbology;
unsigned char *data; char *data;
int whitespace_width; int whitespace_width;
int expected_width; int expected_width;
@ -799,7 +799,7 @@ static void test_upcean_whitespace_width(int index, int debug) {
int length = strlen(data[i].data); int length = strlen(data[i].data);
ret = ZBarcode_Encode(symbol, data[i].data, length); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt);
ret = ZBarcode_Buffer_Vector(symbol, 0); ret = ZBarcode_Buffer_Vector(symbol, 0);

View File

@ -1397,8 +1397,7 @@ int testUtilHaveIdentify() {
} }
int testUtilVerifyIdentify(char *filename, int debug) { int testUtilVerifyIdentify(char *filename, int debug) {
int ret; char cmd[512 + 128];
char buf[512 + 128];
if (strlen(filename) > 512) { if (strlen(filename) > 512) {
return -1; return -1;
@ -1407,36 +1406,90 @@ int testUtilVerifyIdentify(char *filename, int debug) {
if (debug & ZINT_DEBUG_TEST_PRINT) { if (debug & ZINT_DEBUG_TEST_PRINT) {
// Verbose very noisy though so for quick check just return default output // Verbose very noisy though so for quick check just return default output
if (debug & ZINT_DEBUG_TEST_LESS_NOISY) { if (debug & ZINT_DEBUG_TEST_LESS_NOISY) {
sprintf(buf, "identify %s", filename); sprintf(cmd, "identify %s", filename);
} else { } else {
sprintf(buf, "identify -verbose %s", filename); sprintf(cmd, "identify -verbose %s", filename);
} }
} else { } else {
sprintf(buf, "identify -verbose %s > /dev/null", filename); sprintf(cmd, "identify -verbose %s > /dev/null", filename);
} }
return system(buf); return system(cmd);
} }
int testUtilHaveInkscape() { int testUtilHaveLibreOffice() {
return system("inkscape -z -V > /dev/null") == 0; return system("libreoffice --version > /dev/null") == 0;
} }
int testUtilVerifyInkscape(char *filename, int debug) { int testUtilVerifyLibreOffice(char *filename, int debug) {
int ret; char cmd[512 + 128];
char buf[512 + 128]; char svg[512];
char *slash, *dot;
char buf[32768];
char *b = buf, *be = buf + sizeof(buf) - 1;
FILE *fp;
int len;
/* Hack to read SVG produced by LibreOffice and search for 'x="-32767"' which indicates it didn't load barcode file */
if (strlen(filename) > 512) { if (strlen(filename) > 512) {
return -1; return -1;
} }
if (debug & ZINT_DEBUG_TEST_PRINT) { slash = strrchr(filename, '/');
sprintf(buf, "inkscape -z -f %s", filename); // Prints nothing unless bad if (slash) {
printf("%s\n", buf); strcpy(svg, slash + 1);
} else { } else {
sprintf(buf, "inkscape -z -f %s > /dev/null", filename); strcpy(svg, filename);
}
dot = strrchr(svg, '.');
if (dot) {
strcpy(dot, ".svg");
} else {
strcat(svg, ".svg");
}
if (strcmp(svg, filename) == 0) {
fprintf(stderr, "testUtilVerifyLibreOffice: input '%s' same as svg '%s'\n", filename, svg);
return -1;
} }
return system(buf); sprintf(cmd, "libreoffice --convert-to svg %s > /dev/null 2>&1", filename);
if (debug & ZINT_DEBUG_TEST_PRINT) {
printf("%s\n", cmd);
}
if (system(cmd) != 0) {
fprintf(stderr, "testUtilVerifyLibreOffice: failed to run '%s'\n", cmd);
return -1;
}
fp = fopen(svg, "r");
if (!fp) {
fprintf(stderr, "testUtilVerifyLibreOffice: failed to open '%s' (%s)\n", svg, cmd);
return -1;
}
while (!feof(fp) && b < be) {
if (fgets(b, be - b, fp) == NULL) {
fprintf(stderr, "testUtilVerifyLibreOffice: failed to get line from '%s' (%s)\n", svg, cmd);
fclose(fp);
return -1;
}
len = (int) strlen(b);
if (len == 0) {
break;
}
b += len;
}
*b = '\0';
fclose(fp);
if (strlen(buf) < 1024) {
fprintf(stderr, "testUtilVerifyLibreOffice: failed to get much input from '%s' (%s)\n", svg, cmd);
return -1;
}
if (strstr(buf, "x=\"-32767\"") != NULL) {
return -1;
}
remove(svg);
return 0;
} }
int testUtilHaveGhostscript() { int testUtilHaveGhostscript() {
@ -1444,17 +1497,38 @@ int testUtilHaveGhostscript() {
} }
int testUtilVerifyGhostscript(char *filename, int debug) { int testUtilVerifyGhostscript(char *filename, int debug) {
int ret; char cmd[512 + 128];
if (strlen(filename) > 512) {
return -1;
}
if (debug & ZINT_DEBUG_TEST_PRINT) {
sprintf(cmd, "gs -dNOPAUSE -dBATCH -dNODISPLAY -q %s", filename); // Prints nothing of interest with or without -q unless bad
printf("%s\n", cmd);
} else {
sprintf(cmd, "gs -dNOPAUSE -dBATCH -dNODISPLAY -q %s", filename);
}
return system(cmd);
}
/* v.Nu https://github.com/validator/validator
* Needs "$INSTALL_DIR/vnu-runtime-image/bin" in PATH */
int testUtilHaveVnu() {
return system("vnu --version > /dev/null") == 0;
}
int testUtilVerifyVnu(char *filename, int debug) {
char buf[512 + 128]; char buf[512 + 128];
if (strlen(filename) > 512) { if (strlen(filename) > 512) {
return -1; return -1;
} }
if (debug & ZINT_DEBUG_TEST_PRINT) { if (debug & ZINT_DEBUG_TEST_PRINT) {
sprintf(buf, "gs -dNOPAUSE -dBATCH -dNODISPLAY -q %s", filename); // Prints nothing of interest with or without -q unless bad sprintf(buf, "vnu --svg --verbose %s", filename);
printf("%s\n", buf); printf("%s\n", buf);
} else { } else {
sprintf(buf, "gs -dNOPAUSE -dBATCH -dNODISPLAY -q %s", filename); sprintf(buf, "vnu --svg %s", filename);
} }
return system(buf); return system(buf);
@ -1764,7 +1838,6 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
int r, h; int r, h;
int parse; int parse;
int composite = is_composite(symbology);
int upcean = is_extendable(symbology); int upcean = is_extendable(symbology);
int upca = symbology == BARCODE_UPCA || symbology == BARCODE_UPCA_CHK || symbology == BARCODE_UPCA_CC; int upca = symbology == BARCODE_UPCA || symbology == BARCODE_UPCA_CHK || symbology == BARCODE_UPCA_CC;
int addon_posn; int addon_posn;
@ -1902,7 +1975,7 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|| symbology == BARCODE_DAFT || symbology == BARCODE_USPS_IMAIL || symbology == BARCODE_AUSPOST || symbology == BARCODE_PHARMA_TWO) { || symbology == BARCODE_DAFT || symbology == BARCODE_USPS_IMAIL || symbology == BARCODE_AUSPOST || symbology == BARCODE_PHARMA_TWO) {
for (r = 0; r < symbol->rows; r++) bwipp_row_height[r] = 1; /* Zap */ for (r = 0; r < symbol->rows; r++) bwipp_row_height[r] = 1; /* Zap */
if (symbology == BARCODE_KIX) { if (symbology == BARCODE_KIX) {
to_upper(bwipp_data); to_upper((unsigned char *) bwipp_data);
} else if (symbology == BARCODE_USPS_IMAIL) { } else if (symbology == BARCODE_USPS_IMAIL) {
char *dash = strchr(bwipp_data, '-'); char *dash = strchr(bwipp_data, '-');
if (dash) { if (dash) {

View File

@ -106,10 +106,12 @@ int testUtilCmpSvgs(char *svg1, char *svg2);
int testUtilCmpEpss(char *eps1, char *eps2); int testUtilCmpEpss(char *eps1, char *eps2);
int testUtilHaveIdentify(); int testUtilHaveIdentify();
int testUtilVerifyIdentify(char *filename, int debug); int testUtilVerifyIdentify(char *filename, int debug);
int testUtilHaveInkscape(); int testUtilHaveLibreOffice();
int testUtilVerifyInkscape(char *filename, int debug); int testUtilVerifyLibreOffice(char *filename, int debug);
int testUtilHaveGhostscript(); int testUtilHaveGhostscript();
int testUtilVerifyGhostscript(char *filename, int debug); int testUtilVerifyGhostscript(char *filename, int debug);
int testUtilHaveVnu();
int testUtilVerifyVnu(char *filename, int debug);
int testUtilCanBwipp(int symbology, int option_1, int option_2, int option_3, int debug); int testUtilCanBwipp(int symbology, int option_1, int option_2, int option_3, int debug);
int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int option_2, int option_3, const char *data, int length, const char *primary, char *buffer, int buffer_size); int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int option_2, int option_3, const char *data, int length, const char *primary, char *buffer, int buffer_size);
int testUtilBwippCmp(const struct zint_symbol *symbol, char *msg, const char *bwipp_buf, const char *expected); int testUtilBwippCmp(const struct zint_symbol *symbol, char *msg, const char *bwipp_buf, const char *expected);

View File

@ -1,5 +1,5 @@
--- ../../../../postscriptbarcode/build/monolithic/barcode.ps 2020-09-18 02:41:06.166708679 +0100 --- ../../../../postscriptbarcode/build/monolithic/barcode.ps 2020-10-02 20:03:59.411955883 +0100
+++ ../tools/bwipp_dump.ps 2020-09-18 03:56:06.144846176 +0100 +++ ../tools/bwipp_dump.ps 2020-10-03 01:47:30.454223200 +0100
@@ -29,6 +29,8 @@ @@ -29,6 +29,8 @@
% CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
% IN THE SOFTWARE. % IN THE SOFTWARE.
@ -9,7 +9,7 @@
% --BEGIN TEMPLATE-- % --BEGIN TEMPLATE--
% --BEGIN RESOURCE preamble-- % --BEGIN RESOURCE preamble--
@@ -25403,34 +25405,80 @@ @@ -25404,34 +25406,80 @@
pop pop
} ifelse } ifelse
@ -109,7 +109,7 @@
end end
@@ -25489,7 +25537,7 @@ @@ -25490,7 +25538,7 @@
pop pop
} ifelse } ifelse
@ -118,7 +118,7 @@
% Get the result of encoding with ean8 and gs1-cc % Get the result of encoding with ean8 and gs1-cc
options (lintype) (ean8) put options (lintype) (ean8) put
@@ -25497,29 +25545,75 @@ @@ -25498,29 +25546,75 @@
options (dontdraw) true put options (dontdraw) true put
% Plot the linear part % Plot the linear part
@ -214,7 +214,7 @@
end end
@@ -25578,34 +25672,80 @@ @@ -25579,34 +25673,80 @@
pop pop
} ifelse } ifelse
@ -314,7 +314,7 @@
end end
@@ -25679,34 +25819,80 @@ @@ -25680,34 +25820,80 @@
/opt options /opt options
>> def >> def
@ -414,7 +414,7 @@
end end
@@ -25765,7 +25951,7 @@ @@ -25766,7 +25952,7 @@
pop pop
} ifelse } ifelse
@ -423,7 +423,7 @@
options (lintype) (databaromni) put options (lintype) (databaromni) put
options (linkage) true put options (linkage) true put
@@ -25776,7 +25962,7 @@ @@ -25777,7 +25963,7 @@
linear options //databaromni exec linear options //databaromni exec
dup (sbs) get /linsbs exch def dup (sbs) get /linsbs exch def
dup (bhs) get 0 get 72 mul /linheight exch def dup (bhs) get 0 get 72 mul /linheight exch def
@ -432,7 +432,7 @@
% Plot the separator % Plot the separator
/sepfinder { /sepfinder {
@@ -25807,20 +25993,66 @@ @@ -25808,20 +25994,66 @@
sep 0 [0 0 0] putinterval sep 0 [0 0 0] putinterval
sep sep length 4 sub [0 0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval
18 sepfinder 64 sepfinder 18 sepfinder 64 sepfinder
@ -511,7 +511,7 @@
end end
@@ -25878,7 +26110,7 @@ @@ -25879,7 +26111,7 @@
pop pop
} ifelse } ifelse
@ -520,7 +520,7 @@
options (lintype) (databarstacked) put options (lintype) (databarstacked) put
options (linkage) true put options (linkage) true put
@@ -25889,7 +26121,7 @@ @@ -25890,7 +26122,7 @@
linear options //databarstacked exec linear options //databarstacked exec
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
dup (pixy) get /linheight exch def dup (pixy) get /linheight exch def
@ -529,7 +529,7 @@
% Plot the separator % Plot the separator
/sepfinder { /sepfinder {
@@ -25917,20 +26149,52 @@ @@ -25918,20 +26150,52 @@
sep 0 [ 0 0 0 0 ] putinterval sep 0 [ 0 0 0 0 ] putinterval
sep sep length 4 sub [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval
18 sepfinder 18 sepfinder
@ -594,7 +594,7 @@
end end
@@ -25988,7 +26252,7 @@ @@ -25989,7 +26253,7 @@
pop pop
} ifelse } ifelse
@ -603,7 +603,7 @@
options (lintype) (databarstackedomni) put options (lintype) (databarstackedomni) put
options (linkage) true put options (linkage) true put
@@ -25999,7 +26263,7 @@ @@ -26000,7 +26264,7 @@
linear options //databarstackedomni exec linear options //databarstackedomni exec
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
dup (pixy) get /linheight exch def dup (pixy) get /linheight exch def
@ -612,7 +612,7 @@
% Plot the separator % Plot the separator
/sepfinder { /sepfinder {
@@ -26027,20 +26291,52 @@ @@ -26028,20 +26292,52 @@
sep 0 [ 0 0 0 0 ] putinterval sep 0 [ 0 0 0 0 ] putinterval
sep sep length 4 sub [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval
18 sepfinder 18 sepfinder
@ -677,7 +677,7 @@
end end
@@ -26213,7 +26509,7 @@ @@ -26214,7 +26510,7 @@
pop pop
} ifelse } ifelse
@ -686,7 +686,7 @@
options (lintype) (databarlimited) put options (lintype) (databarlimited) put
options (linkage) true put options (linkage) true put
@@ -26224,7 +26520,7 @@ @@ -26225,7 +26521,7 @@
linear options //databarlimited exec linear options //databarlimited exec
dup (sbs) get /linsbs exch def dup (sbs) get /linsbs exch def
dup (bhs) get 0 get 72 mul /linheight exch def dup (bhs) get 0 get 72 mul /linheight exch def
@ -695,7 +695,7 @@
% Plot the separator % Plot the separator
mark mark
@@ -26232,22 +26528,68 @@ @@ -26233,22 +26529,68 @@
counttomark 1 sub array astore /sep exch def pop pop counttomark 1 sub array astore /sep exch def pop pop
sep 0 [0 0 0] putinterval sep 0 [0 0 0] putinterval
sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces
@ -778,7 +778,7 @@
end end
@@ -26306,7 +26648,7 @@ @@ -26307,7 +26649,7 @@
pop pop
} ifelse } ifelse
@ -787,7 +787,7 @@
options (lintype) (databarexpanded) put options (lintype) (databarexpanded) put
options (linkage) true put options (linkage) true put
@@ -26317,7 +26659,7 @@ @@ -26318,7 +26660,7 @@
linear options //databarexpanded exec linear options //databarexpanded exec
dup (sbs) get /linsbs exch def dup (sbs) get /linsbs exch def
dup (bhs) get 0 get 72 mul /linheight exch def dup (bhs) get 0 get 72 mul /linheight exch def
@ -796,7 +796,7 @@
% Plot the separator % Plot the separator
/sepfinder { /sepfinder {
@@ -26346,20 +26688,60 @@ @@ -26347,20 +26689,60 @@
18 98 bot length 13 sub {} for 18 98 bot length 13 sub {} for
69 98 bot length 13 sub {} for 69 98 bot length 13 sub {} for
] {sepfinder} forall ] {sepfinder} forall
@ -869,7 +869,7 @@
end end
@@ -26417,7 +26799,7 @@ @@ -26418,7 +26800,7 @@
pop pop
} ifelse } ifelse
@ -878,7 +878,7 @@
options (lintype) (databarexpandedstacked) put options (lintype) (databarexpandedstacked) put
options (linkage) true put options (linkage) true put
@@ -26428,7 +26810,7 @@ @@ -26429,7 +26811,7 @@
linear options //databarexpandedstacked exec linear options //databarexpandedstacked exec
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
dup (pixy) get /linheight exch def dup (pixy) get /linheight exch def
@ -887,7 +887,7 @@
% Plot the separator % Plot the separator
/sepfinder { /sepfinder {
@@ -26448,27 +26830,55 @@ @@ -26449,27 +26831,55 @@
} for } for
} bind def } bind def
/sep [ bot {1 exch sub} forall ] def /sep [ bot {1 exch sub} forall ] def
@ -957,7 +957,7 @@
end end
@@ -26527,7 +26937,7 @@ @@ -26528,7 +26938,7 @@
pop pop
} ifelse } ifelse
@ -966,7 +966,7 @@
options (inkspread) (0) put options (inkspread) (0) put
options (dontdraw) true put options (dontdraw) true put
@@ -26554,35 +26964,87 @@ @@ -26555,35 +26965,87 @@
linear << options {} forall >> //gs1-128 exec linear << options {} forall >> //gs1-128 exec
dup (sbs) get /linsbs exch def dup (sbs) get /linsbs exch def
dup (bhs) get 0 get 72 mul /linheight exch def dup (bhs) get 0 get 72 mul /linheight exch def
@ -1068,7 +1068,7 @@
end end
@@ -27880,3 +28342,176 @@ @@ -27881,3 +28343,176 @@
% --END ENCODER hibcazteccode-- % --END ENCODER hibcazteccode--
% --END TEMPLATE-- % --END TEMPLATE--

View File

@ -48,7 +48,7 @@ extern "C" {
float width; /* Suggested string width, may be 0 if none recommended */ float width; /* Suggested string width, may be 0 if none recommended */
int length; int length;
int rotation; int rotation;
int halign; /* Horizontal alignment: 0 for centre (middle, 1 for left (start), 2 for right (end) */ int halign; /* Horizontal alignment: 0 for centre (middle), 1 for left (start), 2 for right (end) */
unsigned char *text; unsigned char *text;
struct zint_vector_string *next; /* Pointer to next character */ struct zint_vector_string *next; /* Pointer to next character */
}; };
@ -274,7 +274,7 @@ extern "C" {
#define ZINT_WARN_NONCOMPLIANT 4 #define ZINT_WARN_NONCOMPLIANT 4
#define ZINT_ERROR 5 /* Warn/error marker, not returned */ #define ZINT_ERROR 5 /* Warn/error marker, not returned */
#define ZINT_ERROR_TOO_LONG 5 #define ZINT_ERROR_TOO_LONG 5
#define ZINT_ERROR_INVALID_DATA 6 #define ZINT_ERROR_INVALID_DATA 6
#define ZINT_ERROR_INVALID_CHECK 7 #define ZINT_ERROR_INVALID_CHECK 7
#define ZINT_ERROR_INVALID_OPTION 8 #define ZINT_ERROR_INVALID_OPTION 8
#define ZINT_ERROR_ENCODING_PROBLEM 9 #define ZINT_ERROR_ENCODING_PROBLEM 9

View File

@ -189,7 +189,7 @@ static char *s_code_list[] = {
"UPC-A+Check", "UPC-A+Check",
"UPC-E", "UPC-E",
"UPC-E+Check", "UPC-E+Check",
"Postnet", "POSTNET",
"MSIPlessey", "MSIPlessey",
"FIM", "FIM",
"Logmars", "Logmars",
@ -217,7 +217,7 @@ static char *s_code_list[] = {
"GS1DataBarStacked", "GS1DataBarStacked",
"GS1DataBarSstackedOmni", "GS1DataBarSstackedOmni",
"GS1DataBarExpandedStacked", "GS1DataBarExpandedStacked",
"Planet", "PLANET",
"DPDCode", "DPDCode",
"MicroPDF417", "MicroPDF417",
"USPSIntelligentMail", "USPSIntelligentMail",

View File

@ -284,7 +284,7 @@ Numeric Value | Barcode Name
35 | UPC-A + Check Digit 35 | UPC-A + Check Digit
37 | UPC-E 37 | UPC-E
38 | UPC-E + Check Digit 38 | UPC-E + Check Digit
40 | PostNet 40 | POSTNET
47 | MSI Plessey 47 | MSI Plessey
49 | FIM 49 | FIM
50 | LOGMARS 50 | LOGMARS
@ -946,7 +946,7 @@ plotted in green.
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
struct zint_symbol *my_symbol; struct zint_symbol *my_symbol;
my_symbol = ZBarcode_Create(); my_symbol = ZBarcode_Create();
strcpy(my_symbol->fgcolour, "00ff00"); strcpy(my_symbol->fgcolour, "00ff00");
my_symbol->height = 400; my_symbol->height = 400;
ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0); ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
@ -982,7 +982,7 @@ ZINT_WARN_NONCOMPLIANT | The symbol was created but is not compliant with
| (e.g. height, GS1 AI data lengths). | (e.g. height, GS1 AI data lengths).
ZINT_ERROR | Marks the divide between warnings and errors. ZINT_ERROR | Marks the divide between warnings and errors.
| For return values greater than or equal to | For return values greater than or equal to
| this no symbol is generated. | this no symbol is generated.
ZINT_ERROR_TOO_LONG | The input data is too long or too short for the ZINT_ERROR_TOO_LONG | The input data is too long or too short for the
| selected symbology. No symbol has been | selected symbology. No symbol has been
| generated. | generated.
@ -1081,7 +1081,7 @@ Value |
35 | BARCODE_UPCA_CHK | UPC-A + Check Digit 35 | BARCODE_UPCA_CHK | UPC-A + Check Digit
37 | BARCODE_UPCE | UPC-E 37 | BARCODE_UPCE | UPC-E
38 | BARCODE_UPCE_CHK | UPC-E + Check Digit 38 | BARCODE_UPCE_CHK | UPC-E + Check Digit
40 | BARCODE_POSTNET | PostNet 40 | BARCODE_POSTNET | POSTNET
47 | BARCODE_MSI_PLESSEY | MSI Plessey 47 | BARCODE_MSI_PLESSEY | MSI Plessey
49 | BARCODE_FIM | FIM 49 | BARCODE_FIM | FIM
50 | BARCODE_LOGMARS | LOGMARS 50 | BARCODE_LOGMARS | LOGMARS
@ -1284,7 +1284,7 @@ int ZBarcode_Version();
The version parts are separated by hundreds. For instance, version "2.9.1" is The version parts are separated by hundreds. For instance, version "2.9.1" is
returned as "20901". returned as "20901".
[1] This value is ignored for Australia Post 4-State Barcodes, PostNet, PLANET, [1] This value is ignored for Australia Post 4-State Barcodes, POSTNET, PLANET,
USPS Intelligent Mail, RM4SCC, PDF417, Data Matrix, Maxicode, QR Code, GS1 USPS Intelligent Mail, RM4SCC, PDF417, Data Matrix, Maxicode, QR Code, GS1
DataBar Stacked, PDF417 and MicroPDF417 - all of which have a fixed height. DataBar Stacked, PDF417 and MicroPDF417 - all of which have a fixed height.
@ -1587,8 +1587,8 @@ Latin-1 character set is shown in Appendix A.
6.1.11.2 Code 128 Subset B 6.1.11.2 Code 128 Subset B
-------------------------- --------------------------
It is sometimes advantageous to stop Code 128 from using subset mode C which It is sometimes advantageous to stop Code 128 from using subset mode C which
compresses numerical data. The BARCODE_CODE128B option (symbology 60) compresses numerical data. The BARCODE_CODE128B option (symbology 60) suppresses
suppresses mode C in favour of mode B. mode C in favour of mode B.
6.1.11.3 GS1-128 6.1.11.3 GS1-128
---------------- ----------------
@ -1903,11 +1903,11 @@ Developed by Laetus, Pharmacode Two-Track is an alternative system to
Pharmacode One-Track used for the identification of pharmaceuticals. The Pharmacode One-Track used for the identification of pharmaceuticals. The
symbology is able to encode whole numbers between 4 and 64570080. symbology is able to encode whole numbers between 4 and 64570080.
6.4.2 PostNet 6.4.2 POSTNET
------------- -------------
Used by the United States Postal Service until 2009, the PostNet barcode was Used by the United States Postal Service until 2009, the POSTNET barcode was
used for encoding zip-codes on mail items. PostNet uses numerical input data used for encoding zip-codes on mail items. POSTNET uses numerical input data
and includes a modulo-10 check digit. While Zint will encode PostNet symbols of and includes a modulo-10 check digit. While Zint will encode POSTNET symbols of
any length, standard lengths as used by USPS were PostNet6 (5 digits ZIP any length, standard lengths as used by USPS were PostNet6 (5 digits ZIP
input), PostNet10 (5 digit ZIP + 4 digit user data) and PostNet12 (5 digit ZIP input), PostNet10 (5 digit ZIP + 4 digit user data) and PostNet12 (5 digit ZIP
+ 6 digit user data). + 6 digit user data).
@ -1987,7 +1987,7 @@ the input data.
6.5.5 USPS Intelligent Mail 6.5.5 USPS Intelligent Mail
--------------------------- ---------------------------
Also known as the OneCode barcode and used in the US by the United States Postal Also known as the OneCode barcode and used in the US by the United States Postal
Service (USPS), the Intelligent Mail system replaced the PostNet and PLANET Service (USPS), the Intelligent Mail system replaced the POSTNET and PLANET
symbologies in 2009. Intelligent Mail is a fixed length (65-bar) symbol which symbologies in 2009. Intelligent Mail is a fixed length (65-bar) symbol which
combines routing and customer information in a single symbol. Input data combines routing and customer information in a single symbol. Input data
consists of a 20 digit tracking code, followed by a dash (-), followed by a consists of a 20 digit tracking code, followed by a dash (-), followed by a
@ -2661,7 +2661,7 @@ generated using the characters A-D as shown in the table below.
Code Letter | Usage Code Letter | Usage
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
A | Used for courtesy reply mail and metered reply mail with a A | Used for courtesy reply mail and metered reply mail with a
| pre-printed PostNet symbol. | pre-printed POSTNET symbol.
B | Used for business reply mail without a pre-printed zip code. B | Used for business reply mail without a pre-printed zip code.
C | Used for business reply mail with a pre-printed zip code. C | Used for business reply mail with a pre-printed zip code.
D | Used for Information Based Indicia (IBI) postage. D | Used for Information Based Indicia (IBI) postage.
@ -2817,7 +2817,7 @@ Code. Rearranged symbology numbers to match Tbarcode v8. Corrected a never
ending loop bug in EAN-128. 29/9/2008 ending loop bug in EAN-128. 29/9/2008
v2.0 beta r2 - Many corrections and bugfixes. (Code 11, Code 128, EAN-128, v2.0 beta r2 - Many corrections and bugfixes. (Code 11, Code 128, EAN-128,
Aztec Code, Codablock-F, Code 16k, Postnet, PLANET, NVE-18, PZN, Data Matrix Aztec Code, Codablock-F, Code 16k, POSTNET, PLANET, NVE-18, PZN, Data Matrix
ECC200, Maxicode and QR Code) ECC200, Maxicode and QR Code)
v2.0 - Made corrections to Aztec Code and tested output with bcTester. Added v2.0 - Made corrections to Aztec Code and tested output with bcTester. Added

View File

@ -63,11 +63,11 @@ static void types(void) {
"30: GS1 DataBar Ltd 79: GS1 DataBar Stack 135: Comp UPC-A\n" "30: GS1 DataBar Ltd 79: GS1 DataBar Stack 135: Comp UPC-A\n"
"31: GS1 DataBar Exp 80: GS1 DataBar Stack Omni 136: Comp UPC-E\n" "31: GS1 DataBar Exp 80: GS1 DataBar Stack Omni 136: Comp UPC-E\n"
"32: Telepen Alpha 81: GS1 DataBar Exp Stack 137: Comp DataBar Stack\n" "32: Telepen Alpha 81: GS1 DataBar Exp Stack 137: Comp DataBar Stack\n"
"34: UPC-A 82: Planet 138: Comp DataBar Stack Omni\n" "34: UPC-A 82: PLANET 138: Comp DataBar Stack Omni\n"
"35: UPC-A + Check 84: MicroPDF 139: Comp DataBar Exp Stack\n" "35: UPC-A + Check 84: MicroPDF 139: Comp DataBar Exp Stack\n"
"37: UPC-E 85: USPS Intelligent Mail 140: Channel Code\n" "37: UPC-E 85: USPS Intelligent Mail 140: Channel Code\n"
"38: UPC-E + Check 86: UK Plessey 141: Code One\n" "38: UPC-E + Check 86: UK Plessey 141: Code One\n"
"40: Postnet 87: Telepen Numeric 142: Grid Matrix\n" "40: POSTNET 87: Telepen Numeric 142: Grid Matrix\n"
"47: MSI Plessey 89: ITF-14 143: UPNQR\n" "47: MSI Plessey 89: ITF-14 143: UPNQR\n"
"49: FIM 90: KIX Code 144: Ultracode\n" "49: FIM 90: KIX Code 144: Ultracode\n"
"50: Logmars 92: Aztec Code 145: rMQR\n" "50: Logmars 92: Aztec Code 145: rMQR\n"

View File

@ -4,6 +4,7 @@
# vim: set ts=4 sw=4 et : # vim: set ts=4 sw=4 et :
cmake_minimum_required(VERSION 3.9) cmake_minimum_required(VERSION 3.9)
project(zint_frontend_tests)
enable_testing() enable_testing()
@ -15,14 +16,31 @@ set(ZINT_SANITIZE FALSE CACHE BOOL "Set sanitize compile/link flags")
find_package(LibZint REQUIRED) find_package(LibZint REQUIRED)
find_package(PNG REQUIRED) find_package(PNG REQUIRED)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") include(CheckCCompilerFlag)
if(ZINT_DEBUG)
check_c_compiler_flag(-Wall C_COMPILER_FLAG_WALL)
if(C_COMPILER_FLAG_WALL)
add_compile_options("-Wall")
endif()
check_c_compiler_flag(-Wextra C_COMPILER_FLAG_WEXTRA)
if(C_COMPILER_FLAG_WEXTRA)
add_compile_options("-Wextra")
endif()
if(ZINT_DEBUG)
check_c_compiler_flag(-g C_COMPILER_FLAG_G)
if(C_COMPILER_FLAG_G)
add_compile_options("-g") add_compile_options("-g")
endif() endif()
if(ZINT_SANITIZE) endif()
if(ZINT_SANITIZE)
# check_c_compiler_flag fails for -fsanitize
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
add_compile_options("-fsanitize=undefined") add_compile_options("-fsanitize=undefined")
add_compile_options("-fsanitize=address") add_compile_options("-fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address") link_libraries("-fsanitize=undefined -fsanitize=address")
endif() endif()
endif() endif()

View File

@ -161,7 +161,6 @@ static void test_dump_args(int index, int debug) {
testStart(""); testStart("");
int ret;
struct item { struct item {
int b; int b;
char *data; char *data;
@ -280,7 +279,6 @@ static void test_input(int index, int debug) {
testStart(""); testStart("");
int ret;
struct item { struct item {
int b; int b;
int batch; int batch;
@ -351,7 +349,6 @@ static void test_batch_input(int index, int debug) {
testStart(""); testStart("");
int ret;
struct item { struct item {
int b; int b;
char *data; char *data;
@ -410,7 +407,6 @@ static void test_batch_large(int index, int debug) {
testStart(""); testStart("");
int ret;
struct item { struct item {
int b; int b;
int mirror; int mirror;
@ -469,7 +465,6 @@ static void test_checks(int index, int debug) {
testStart(""); testStart("");
int ret;
struct item { struct item {
int addongap; int addongap;
int border; int border;

View File

@ -8,11 +8,11 @@ set(zint-qt_SRCS barcodeitem.cpp main.cpp mainwindow.cpp datawindow.cpp sequen
QT5_WRAP_CPP(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h) QT5_WRAP_CPP(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h)
QT5_WRAP_UI(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui) QT5_WRAP_UI(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui)
# grpAztec.ui grpC49.ui grpDBExtend.ui grpLOGMARS.ui grpPDF417.ui grpUPCA.ui # grpAztec.ui grpC49.ui grpDBExtend.ui grpLOGMARS.ui grpPDF417.ui grpUPCEAN.ui
# grpC11.ui grpChannel.ui grpDM.ui grpMaxicode.ui grpPZN.ui grpUPCEAN.ui # grpC11.ui grpChannel.ui grpDM.ui grpMaxicode.ui grpQR.ui grpVIN.ui
# grpC128.ui grpCodabar.ui grpDotCode.ui grpMicroPDF.ui grpQR.ui grpVIN.ui # grpC128.ui grpCodabar.ui grpDotCode.ui grpMicroPDF.ui grpRMQR.ui
# grpC16k.ui grpCodablockF.ui grpGrid.ui grpMQR.ui grpRMQR.ui # grpC16k.ui grpCodablockF.ui grpGrid.ui grpMQR.ui grpUltra.ui
# grpC39.ui grpCodeOne.ui grpHX.ui grpMSICheck.ui grpUltra.ui # grpC39.ui grpCodeOne.ui grpHX.ui grpMSICheck.ui grpUPCA.ui
QT5_ADD_RESOURCES(zint-qt_SRCS resources.qrc) QT5_ADD_RESOURCES(zint-qt_SRCS resources.qrc)

View File

@ -24,7 +24,14 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Data</string> <string>&amp;Data</string>
</property>
<property name="toolTip">
<string>Input data. Newlines (Line Feeds (0xA0))
will be converted to spaces</string>
</property>
<property name="buddy">
<cstring>txtDataInput</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -46,14 +53,34 @@
<item> <item>
<widget class="QPushButton" name="btnFromFile"> <widget class="QPushButton" name="btnFromFile">
<property name="text"> <property name="text">
<string>From File...</string> <string>&amp;From File...</string>
</property>
<property name="toolTip">
<string>Get input data from a file. Certain characters &lt;br/&gt;will be converted to escape sequences
&lt;table cellpadding=&quot;3&quot;&gt;
&lt;tr&gt;&lt;td&gt;End of Transmission (0x04)&lt;/td&gt;&lt;td&gt;\E&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bell (0x07)&lt;/td&gt;&lt;td&gt;\a&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Backspace (0x08)&lt;/td&gt;&lt;td&gt;\b&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Horizontal Tab (0x09)&lt;/td&gt;&lt;td&gt;\t&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Vertical Tab (0x0B)&lt;/td&gt;&lt;td&gt;\v&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Form Feed (0x0C)&lt;/td&gt;&lt;td&gt;\f&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Carriage Return (0x0D)&lt;/td&gt;&lt;td&gt;\r&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Escape (0x1B)&lt;/td&gt;&lt;td&gt;\e&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Group Selector (0x1D)&lt;/td&gt;&lt;td&gt;\G&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Record Selector (0x1E)&lt;/td&gt;&lt;td&gt;\R&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Backslash (0x5C)&lt;/td&gt;&lt;td&gt;\\&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
Note that newlines (Line Feed (0x0A)) are &lt;br/&gt;not included</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btnReset"> <widget class="QPushButton" name="btnReset">
<property name="text"> <property name="text">
<string>Reset</string> <string>&amp;Reset</string>
</property>
<property name="toolTip">
<string>Clear data window</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -73,14 +100,20 @@
<item> <item>
<widget class="QPushButton" name="btnOK"> <widget class="QPushButton" name="btnOK">
<property name="text"> <property name="text">
<string>OK</string> <string>&amp;OK</string>
</property>
<property name="toolTip">
<string>Close window and update input data</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btnCancel"> <widget class="QPushButton" name="btnCancel">
<property name="text"> <property name="text">
<string>Cancel</string> <string>&amp;Cancel</string>
</property>
<property name="toolTip">
<string>Close window without updating input data</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -74,7 +74,7 @@
</rect> </rect>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Sat the naming convention used by the files</string> <string>Set the naming convention used by the files</string>
</property> </property>
<item> <item>
<property name="text"> <property name="text">
@ -153,7 +153,7 @@
<string>Find a destination for your files</string> <string>Find a destination for your files</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>&amp;...</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
@ -166,7 +166,13 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Destination Path:</string> <string>&amp;Destination Path:</string>
</property>
<property name="toolTip">
<string>Destination folder</string>
</property>
<property name="buddy">
<cstring>linDestPath</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
@ -179,7 +185,13 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>File Name Prefix:</string> <string>File Name &amp;Prefix:</string>
</property>
<property name="toolTip">
<string>The first part of the filenames</string>
</property>
<property name="buddy">
<cstring>linPrefix</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
@ -192,7 +204,13 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>File Name:</string> <string>File &amp;Name:</string>
</property>
<property name="toolTip">
<string>Set the naming convention used by the files</string>
</property>
<property name="buddy">
<cstring>cmbFileName</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
@ -205,7 +223,13 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>File Format:</string> <string>File &amp;Format:</string>
</property>
<property name="toolTip">
<string>The type of file which you want to create</string>
</property>
<property name="buddy">
<cstring>cmbFileFormat</cstring>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="btnCancel"> <widget class="QPushButton" name="btnCancel">
@ -218,7 +242,10 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Close</string> <string>&amp;Close</string>
</property>
<property name="toolTip">
<string>Close window</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="btnOK"> <widget class="QPushButton" name="btnOK">
@ -231,23 +258,26 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Export</string> <string>&amp;Export</string>
</property>
<property name="toolTip">
<string>Create files</string>
</property> </property>
</widget> </widget>
<widget class="QPlainTextEdit" name="txtFeedback"> <widget class="QPlainTextEdit" name="txtFeedback">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>10</x>
<y>180</y> <y>180</y>
<width>441</width> <width>430</width>
<height>321</height> <height>315</height>
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="lblFeedback"> <widget class="QLabel" name="lblFeedback">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>10</x>
<y>160</y> <y>160</y>
<width>101</width> <width>101</width>
<height>17</height> <height>17</height>

View File

@ -42,28 +42,57 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Start Value:</string> <string>&amp;Start Value:</string>
</property>
<property name="buddy">
<cstring>linStartVal</cstring>
</property>
<property name="toolTip">
<string>Start sequence at this value</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>End Value:</string> <string>End &amp;Value:</string>
</property>
<property name="buddy">
<cstring>linEndVal</cstring>
</property>
<property name="toolTip">
<string>End sequence at this value</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="lblIncrement"> <widget class="QLabel" name="lblIncrement">
<property name="text"> <property name="text">
<string>Increment By:</string> <string>Increment &amp;By:</string>
</property>
<property name="buddy">
<cstring>linIncVal</cstring>
</property>
<property name="toolTip">
<string>Go from start to end in steps of this amount</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Format:</string> <string>&amp;Format:</string>
</property>
<property name="buddy">
<cstring>linFormat</cstring>
</property>
<property name="toolTip">
<string>Format sequence using special characters&lt;table cellpadding=&quot;3&quot;&gt;
&lt;tr&gt;&lt;td&gt;#&lt;/td&gt;&lt;td&gt;Number or space&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;$&lt;/td&gt;&lt;td&gt;Number or &apos;0&apos;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;*&lt;/td&gt;&lt;td&gt;Number or &apos;*&apos;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Other&lt;/td&gt;&lt;td&gt;Insert literally&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -72,6 +101,9 @@
<property name="text"> <property name="text">
<string>Sequence:</string> <string>Sequence:</string>
</property> </property>
<property name="toolTip">
<string>Create a data sequence</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -79,13 +111,22 @@
<property name="text"> <property name="text">
<string>Sequence File:</string> <string>Sequence File:</string>
</property> </property>
<property name="toolTip">
<string>Get a data sequence from a file</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="lblExport">
<property name="text"> <property name="text">
<string>Generate Bar Codes:</string> <string>Generate Bar Codes:</string>
</property> </property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Save the symbols to files</string>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -100,6 +141,9 @@
<property name="frame"> <property name="frame">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="toolTip">
<string>Start sequence at this value</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -107,6 +151,9 @@
<property name="text"> <property name="text">
<string>10</string> <string>10</string>
</property> </property>
<property name="toolTip">
<string>End sequence at this value</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -114,6 +161,9 @@
<property name="text"> <property name="text">
<string>1</string> <string>1</string>
</property> </property>
<property name="toolTip">
<string>Go from start to end in steps of this amount</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -121,6 +171,14 @@
<property name="text"> <property name="text">
<string>$$$$$$</string> <string>$$$$$$</string>
</property> </property>
<property name="toolTip">
<string>Format sequence using special characters&lt;table cellpadding=&quot;3&quot;&gt;
&lt;tr&gt;&lt;td&gt;#&lt;/td&gt;&lt;td&gt;Number or space&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;$&lt;/td&gt;&lt;td&gt;Number or &apos;0&apos;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;*&lt;/td&gt;&lt;td&gt;Number or &apos;*&apos;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Other&lt;/td&gt;&lt;td&gt;Insert literally&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -129,17 +187,17 @@
<string>Create a data sequence</string> <string>Create a data sequence</string>
</property> </property>
<property name="text"> <property name="text">
<string>Create</string> <string>Crea&amp;te</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btnImport"> <widget class="QPushButton" name="btnImport">
<property name="toolTip"> <property name="toolTip">
<string>Get a data sequence from file</string> <string>Get a data sequence from a file</string>
</property> </property>
<property name="text"> <property name="text">
<string>Import...</string> <string>&amp;Import...</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -149,10 +207,10 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Save the symbols to file</string> <string>Save the symbols to files</string>
</property> </property>
<property name="text"> <property name="text">
<string>Export...</string> <string>&amp;Export...</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -172,7 +230,10 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title"> <property name="title">
<string>Sequence Preview</string> <string>Sequence &amp;Data</string>
</property>
<property name="toolTip">
<string>The data to be encoded, one line per symbol</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -212,14 +273,20 @@
<item> <item>
<widget class="QPushButton" name="btnReset"> <widget class="QPushButton" name="btnReset">
<property name="text"> <property name="text">
<string>Reset</string> <string>&amp;Reset</string>
</property>
<property name="toolTip">
<string>Clear the sequence data</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="btnClose"> <widget class="QPushButton" name="btnClose">
<property name="text"> <property name="text">
<string>Close</string> <string>&amp;Close</string>
</property>
<property name="toolTip">
<string>Close window</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radAztecAuto"> <widget class="QRadioButton" name="radAztecAuto">
<property name="text"> <property name="text">
<string>Automatic Resizing</string> <string>Auto&amp;matic Resizing</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -35,7 +35,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QRadioButton" name="radAztecSize"> <widget class="QRadioButton" name="radAztecSize">
<property name="text"> <property name="text">
<string>Adjust Size To:</string> <string>Adjust Si&amp;ze To:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -229,7 +229,7 @@
<item row="2" column="0"> <item row="2" column="0">
<widget class="QRadioButton" name="radAztecECC"> <widget class="QRadioButton" name="radAztecECC">
<property name="text"> <property name="text">
<string>Add Minimum Error Correction:</string> <string>Add Minimum E&amp;rror Correction:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -274,7 +274,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radAztecStand"> <widget class="QRadioButton" name="radAztecStand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -284,14 +284,14 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radAztecGS1"> <widget class="QRadioButton" name="radAztecGS1">
<property name="text"> <property name="text">
<string>GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QRadioButton" name="radAztecHIBC"> <widget class="QRadioButton" name="radAztecHIBC">
<property name="text"> <property name="text">
<string>HIBC Aztec Code</string> <string>H&amp;IBC Aztec Code</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -29,7 +29,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radC11TwoCheckDigits"> <widget class="QRadioButton" name="radC11TwoCheckDigits">
<property name="text"> <property name="text">
<string>Two (Mod-11)</string> <string>&amp;Two (Mod-11)</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -39,14 +39,14 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radC11OneCheckDigit"> <widget class="QRadioButton" name="radC11OneCheckDigit">
<property name="text"> <property name="text">
<string>One (Mod-11)</string> <string>&amp;One (Mod-11)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QRadioButton" name="radC11NoCheckDigits"> <widget class="QRadioButton" name="radC11NoCheckDigits">
<property name="text"> <property name="text">
<string>No Check Digit</string> <string>&amp;No Check Digit</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -32,7 +32,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radC128Stand"> <widget class="QRadioButton" name="radC128Stand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -42,21 +42,21 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radC128CSup"> <widget class="QRadioButton" name="radC128CSup">
<property name="text"> <property name="text">
<string>Subset C Supression</string> <string>Subset &amp;C Suppression</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QRadioButton" name="radC128EAN"> <widget class="QRadioButton" name="radC128EAN">
<property name="text"> <property name="text">
<string>GS1-128</string> <string>GS&amp;1-128</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QRadioButton" name="radC128HIBC"> <widget class="QRadioButton" name="radC128HIBC">
<property name="text"> <property name="text">
<string>HIBC 128</string> <string>H&amp;IBC 128</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelRowSeparatorHeight"> <widget class="QLabel" name="labelRowSeparatorHeight">
<property name="text"> <property name="text">
<string>Row Separator Height:</string> <string>&amp;Row Separator Height:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbC16kRowSepHeight</cstring> <cstring>cmbC16kRowSepHeight</cstring>
@ -70,7 +70,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radC16kStand"> <widget class="QRadioButton" name="radC16kStand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -80,7 +80,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radC16kGS1"> <widget class="QRadioButton" name="radC16kGS1">
<property name="text"> <property name="text">
<string>GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radC39Stand"> <widget class="QRadioButton" name="radC39Stand">
<property name="text"> <property name="text">
<string>No Check Digit</string> <string>&amp;No Check Digit</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -35,14 +35,14 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QRadioButton" name="radC39HIBC"> <widget class="QRadioButton" name="radC39HIBC">
<property name="text"> <property name="text">
<string>HIBC 39</string> <string>H&amp;IBC 39</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radC39Check"> <widget class="QRadioButton" name="radC39Check">
<property name="text"> <property name="text">
<string>Mod-43 Check Digit</string> <string>&amp;Mod-43 Check Digit</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelRowSeparatorHeight"> <widget class="QLabel" name="labelRowSeparatorHeight">
<property name="text"> <property name="text">
<string>Row Separator Height:</string> <string>&amp;Row Separator Height:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbC49RowSepHeight</cstring> <cstring>cmbC49RowSepHeight</cstring>
@ -70,7 +70,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radC49Stand"> <widget class="QRadioButton" name="radC49Stand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -80,7 +80,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radC49GS1"> <widget class="QRadioButton" name="radC49GS1">
<property name="text"> <property name="text">
<string>GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -17,7 +17,7 @@
<item> <item>
<widget class="QCheckBox" name="chkCodabarCheck"> <widget class="QCheckBox" name="chkCodabarCheck">
<property name="text"> <property name="text">
<string>Add Check Character (Mod-16)</string> <string>Add &amp;Check Character (Mod-16)</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelWidth"> <widget class="QLabel" name="labelWidth">
<property name="text"> <property name="text">
<string>Symbol Width (Columns):</string> <string>Symbol &amp;Width (Columns):</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbCbfWidth</cstring> <cstring>cmbCbfWidth</cstring>
@ -342,7 +342,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelHeight"> <widget class="QLabel" name="labelHeight">
<property name="text"> <property name="text">
<string>Symbol Height (Rows):</string> <string>Symbol &amp;Height (Rows):</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbCbfHeight</cstring> <cstring>cmbCbfHeight</cstring>
@ -584,7 +584,7 @@
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelRowSeparatorHeight"> <widget class="QLabel" name="labelRowSeparatorHeight">
<property name="text"> <property name="text">
<string>Row Separator Height:</string> <string>&amp;Row Separator Height:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbCbfRowSepHeight</cstring> <cstring>cmbCbfRowSepHeight</cstring>
@ -629,7 +629,7 @@
<item> <item>
<widget class="QRadioButton" name="radCbfStand"> <widget class="QRadioButton" name="radCbfStand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -639,7 +639,7 @@
<item> <item>
<widget class="QRadioButton" name="radCbfHIBC"> <widget class="QRadioButton" name="radCbfHIBC">
<property name="text"> <property name="text">
<string>HIBC Codablock-F</string> <string>H&amp;IBC Codablock-F</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblChannel"> <widget class="QLabel" name="lblChannel">
<property name="text"> <property name="text">
<string>Symbol Size:</string> <string>Symbol Si&amp;ze:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -108,7 +108,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radC1Stand"> <widget class="QRadioButton" name="radC1Stand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -118,7 +118,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radC1GS1"> <widget class="QRadioButton" name="radC1GS1">
<property name="text"> <property name="text">
<string>GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblDM200Size"> <widget class="QLabel" name="lblDM200Size">
<property name="text"> <property name="text">
<string>Size:</string> <string>Si&amp;ze:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbDM200Size</cstring> <cstring>cmbDM200Size</cstring>
@ -298,7 +298,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radDM200Stand"> <widget class="QRadioButton" name="radDM200Stand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -308,14 +308,14 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radDM200GS1"> <widget class="QRadioButton" name="radDM200GS1">
<property name="text"> <property name="text">
<string>GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QRadioButton" name="radDM200HIBC"> <widget class="QRadioButton" name="radDM200HIBC">
<property name="text"> <property name="text">
<string>HIBC Data Matrix</string> <string>H&amp;IBC Data Matrix</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -325,7 +325,7 @@
<item> <item>
<widget class="QCheckBox" name="chkDMRectangle"> <widget class="QCheckBox" name="chkDMRectangle">
<property name="text"> <property name="text">
<string>Suppress Rectangular Symbols in Automatic Mode</string> <string>Suppress &amp;Rectangular Symbols in Automatic Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -335,7 +335,7 @@
<item> <item>
<widget class="QCheckBox" name="chkDMRE"> <widget class="QCheckBox" name="chkDMRE">
<property name="text"> <property name="text">
<string>Allow DMRE in Automatic Mode</string> <string>Allo&amp;w DMRE in Automatic Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
@ -345,7 +345,7 @@
<item> <item>
<widget class="QCheckBox" name="chkDMGSSep"> <widget class="QCheckBox" name="chkDMGSSep">
<property name="text"> <property name="text">
<string>Use separator GS for GS1</string> <string>&amp;Use separator GS for GS1</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View File

@ -321,7 +321,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radDotGS1"> <widget class="QRadioButton" name="radDotGS1">
<property name="text"> <property name="text">
<string>&amp;GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelGridSize"> <widget class="QLabel" name="labelGridSize">
<property name="text"> <property name="text">
<string>Size:</string> <string>Si&amp;ze:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbGridSize</cstring> <cstring>cmbGridSize</cstring>
@ -109,7 +109,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelGridECC"> <widget class="QLabel" name="labelGridECC">
<property name="text"> <property name="text">
<string>Error Correction:</string> <string>E&amp;rror Correction:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbGridECC</cstring> <cstring>cmbGridECC</cstring>
@ -182,7 +182,7 @@
<item> <item>
<widget class="QCheckBox" name="chkGridFullMultibyte"> <widget class="QCheckBox" name="chkGridFullMultibyte">
<property name="text"> <property name="text">
<string>Full Multibyte</string> <string>&amp;Full Multibyte</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelHXSize"> <widget class="QLabel" name="labelHXSize">
<property name="text"> <property name="text">
<string>Size:</string> <string>Si&amp;ze:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbHXSize</cstring> <cstring>cmbHXSize</cstring>
@ -467,7 +467,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelHXECC"> <widget class="QLabel" name="labelHXECC">
<property name="text"> <property name="text">
<string>Error Correction:</string> <string>E&amp;rror Correction:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbHXECC</cstring> <cstring>cmbHXECC</cstring>
@ -508,7 +508,7 @@
<item> <item>
<widget class="QCheckBox" name="chkHXFullMultibyte"> <widget class="QCheckBox" name="chkHXFullMultibyte">
<property name="text"> <property name="text">
<string>Full Multibyte</string> <string>&amp;Full Multibyte</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View File

@ -29,7 +29,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radLOGMARSStand"> <widget class="QRadioButton" name="radLOGMARSStand">
<property name="text"> <property name="text">
<string>No Check Digit</string> <string>&amp;No Check Digit</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -39,7 +39,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radLOGMARSCheck"> <widget class="QRadioButton" name="radLOGMARSCheck">
<property name="text"> <property name="text">
<string>One (Mod-43)</string> <string>&amp;One (Mod-43)</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -24,7 +24,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="lavelMQRSize" > <widget class="QLabel" name="lavelMQRSize" >
<property name="text" > <property name="text" >
<string>Size:</string> <string>Si&amp;ze:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbMQRSize</cstring> <cstring>cmbMQRSize</cstring>
@ -63,7 +63,7 @@
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="labelMQRECC" > <widget class="QLabel" name="labelMQRECC" >
<property name="text" > <property name="text" >
<string>Error Correction:</string> <string>E&amp;rror Correction:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbMQRECC</cstring> <cstring>cmbMQRECC</cstring>
@ -99,7 +99,7 @@
<item> <item>
<widget class="QCheckBox" name="chkMQRFullMultibyte"> <widget class="QCheckBox" name="chkMQRFullMultibyte">
<property name="text"> <property name="text">
<string>Full Multibyte</string> <string>&amp;Full Multibyte</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View File

@ -41,7 +41,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Primary Message:</string> <string>P&amp;rimary Message:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>

View File

@ -78,7 +78,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radMPDFStand"> <widget class="QRadioButton" name="radMPDFStand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -88,7 +88,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radMPDFHIBC"> <widget class="QRadioButton" name="radMPDFHIBC">
<property name="text"> <property name="text">
<string>HIBC MicroPDF417</string> <string>H&amp;IBC MicroPDF417</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -146,7 +146,7 @@
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="lblPDFECC" > <widget class="QLabel" name="lblPDFECC" >
<property name="text" > <property name="text" >
<string>&amp;Error Correction Capacity:</string> <string>E&amp;rror Correction Capacity:</string>
</property> </property>
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -224,7 +224,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radPDFStand"> <widget class="QRadioButton" name="radPDFStand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -234,7 +234,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radPDFHIBC"> <widget class="QRadioButton" name="radPDFHIBC">
<property name="text"> <property name="text">
<string>HIBC PDF417</string> <string>H&amp;IBC PDF417</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelQRSize"> <widget class="QLabel" name="labelQRSize">
<property name="text"> <property name="text">
<string>Size:</string> <string>Si&amp;ze:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbQRSize</cstring> <cstring>cmbQRSize</cstring>
@ -247,7 +247,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelQRECC"> <widget class="QLabel" name="labelQRECC">
<property name="text"> <property name="text">
<string>Error Correction:</string> <string>E&amp;rror Correction:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbQRECC</cstring> <cstring>cmbQRECC</cstring>
@ -297,7 +297,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radQRStand"> <widget class="QRadioButton" name="radQRStand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -307,14 +307,14 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radQRGS1"> <widget class="QRadioButton" name="radQRGS1">
<property name="text"> <property name="text">
<string>GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QRadioButton" name="radQRHIBC"> <widget class="QRadioButton" name="radQRHIBC">
<property name="text"> <property name="text">
<string>HIBC QR Code</string> <string>H&amp;IBC QR Code</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -324,7 +324,7 @@
<item> <item>
<widget class="QCheckBox" name="chkQRFullMultibyte"> <widget class="QCheckBox" name="chkQRFullMultibyte">
<property name="text"> <property name="text">
<string>Full Multibyte</string> <string>&amp;Full Multibyte</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelRMQRSize"> <widget class="QLabel" name="labelRMQRSize">
<property name="text"> <property name="text">
<string>Size:</string> <string>Si&amp;ze:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbRMQRSize</cstring> <cstring>cmbRMQRSize</cstring>
@ -237,7 +237,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelRMQRECC"> <widget class="QLabel" name="labelRMQRECC">
<property name="text"> <property name="text">
<string>Error Correction:</string> <string>E&amp;rror Correction:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>cmbRMQRECC</cstring> <cstring>cmbRMQRECC</cstring>
@ -277,7 +277,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radRMQRStand"> <widget class="QRadioButton" name="radRMQRStand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -287,7 +287,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radRMQRGS1"> <widget class="QRadioButton" name="radRMQRGS1">
<property name="text"> <property name="text">
<string>GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -297,7 +297,7 @@
<item> <item>
<widget class="QCheckBox" name="chkRMQRFullMultibyte"> <widget class="QCheckBox" name="chkRMQRFullMultibyte">
<property name="text"> <property name="text">
<string>Full Multibyte</string> <string>&amp;Full Multibyte</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View File

@ -25,7 +25,7 @@
<item> <item>
<widget class="QLabel" name="lblUPCAAddonGap"> <widget class="QLabel" name="lblUPCAAddonGap">
<property name="text"> <property name="text">
<string>&amp;Add-on Gap:</string> <string>A&amp;dd-on Gap:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>

View File

@ -25,7 +25,7 @@
<item> <item>
<widget class="QLabel" name="lblUPCEANAddonGap"> <widget class="QLabel" name="lblUPCEANAddonGap">
<property name="text"> <property name="text">
<string>&amp;Add-on Gap:</string> <string>A&amp;dd-on Gap:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>

View File

@ -25,13 +25,20 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radUltraAuto"> <widget class="QRadioButton" name="radUltraAuto">
<property name="text"> <property name="text">
<string>A&amp;utomatic Resizing</string> <string>Auto&amp;matic Resizing</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QRadioButton" name="radUltraEcc">
<property name="text">
<string>E&amp;rror Correction Level:</string>
</property>
</widget>
</item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QComboBox" name="cmbUltraEcc"> <widget class="QComboBox" name="cmbUltraEcc">
<property name="enabled"> <property name="enabled">
@ -72,13 +79,6 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QRadioButton" name="radUltraEcc">
<property name="text">
<string>Error Correction Level:</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -93,7 +93,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="radUltraStand"> <widget class="QRadioButton" name="radUltraStand">
<property name="text"> <property name="text">
<string>Standard Mode</string> <string>S&amp;tandard Mode</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -103,7 +103,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QRadioButton" name="radUltraGS1"> <widget class="QRadioButton" name="radUltraGS1">
<property name="text"> <property name="text">
<string>GS1 Data Mode</string> <string>GS&amp;1 Data Mode</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="chkVINImportChar"> <widget class="QCheckBox" name="chkVINImportChar">
<property name="text"> <property name="text">
<string>Import Character Prefix</string> <string>&amp;Import Character Prefix</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View File

@ -129,7 +129,7 @@
</property> </property>
<widget class="QWidget" name="tabGeneral"> <widget class="QWidget" name="tabGeneral">
<attribute name="title"> <attribute name="title">
<string>General</string> <string>&amp;General</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
@ -167,7 +167,7 @@
or import from file</string> or import from file</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>&amp;...</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -301,7 +301,7 @@ or import from file</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;2D Component Data:</string> <string>2D &amp;Component Data:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>txtComposite</cstring> <cstring>txtComposite</cstring>
@ -540,22 +540,23 @@ p, li { white-space: pre-wrap; }
<item> <item>
<widget class="QCheckBox" name="chkEscape"> <widget class="QCheckBox" name="chkEscape">
<property name="toolTip"> <property name="toolTip">
<string>Process escape sequences in input data <string>Process escape sequences in input data&lt;table cellpadding=&quot;3&quot;&gt;
\0 - NUL character (0x00) &lt;tr&gt;&lt;td&gt;\0&lt;/td&gt;&lt;td&gt;NUL character (0x00)&lt;/td&gt;&lt;/tr&gt;
\E - End of Transmission (0x04) &lt;tr&gt;&lt;td&gt;\E&lt;/td&gt;&lt;td&gt;End of Transmission (0x04)&lt;/td&gt;&lt;/tr&gt;
\a - Bell (0x07) &lt;tr&gt;&lt;td&gt;\a&lt;/td&gt;&lt;td&gt;Bell (0x07)&lt;/td&gt;&lt;/tr&gt;
\b - Backspace (0x08) &lt;tr&gt;&lt;td&gt;\b&lt;/td&gt;&lt;td&gt;Backspace (0x08)&lt;/td&gt;&lt;/tr&gt;
\t - Horizontal Tab (0x09) &lt;tr&gt;&lt;td&gt;\t&lt;/td&gt;&lt;td&gt;Horizontal Tab (0x09)&lt;/td&gt;&lt;/tr&gt;
\n - Line Feed (0x0A) &lt;tr&gt;&lt;td&gt;\n&lt;/td&gt;&lt;td&gt;Line Feed (0x0A)&lt;/td&gt;&lt;/tr&gt;
\v - Vertical Tab (0x0B) &lt;tr&gt;&lt;td&gt;\v&lt;/td&gt;&lt;td&gt;Vertical Tab (0x0B)&lt;/td&gt;&lt;/tr&gt;
\f - Form Feed (0x0C) &lt;tr&gt;&lt;td&gt;\f&lt;/td&gt;&lt;td&gt;Form Feed (0x0C)&lt;/td&gt;&lt;/tr&gt;
\r - Carriage Return (0x0D) &lt;tr&gt;&lt;td&gt;\r&lt;/td&gt;&lt;td&gt;Carriage Return (0x0D)&lt;/td&gt;&lt;/tr&gt;
\e - Escape (0x1B) &lt;tr&gt;&lt;td&gt;\e&lt;/td&gt;&lt;td&gt;Escape (0x1B)&lt;/td&gt;&lt;/tr&gt;
\G - Group Selector (0x1D) &lt;tr&gt;&lt;td&gt;\G&lt;/td&gt;&lt;td&gt;Group Selector (0x1D)&lt;/td&gt;&lt;/tr&gt;
\R - Record Selector (0x1E) &lt;tr&gt;&lt;td&gt;\R&lt;/td&gt;&lt;td&gt;Record Selector (0x1E)&lt;/td&gt;&lt;/tr&gt;
\\ - Backslash (0x5C) &lt;tr&gt;&lt;td&gt;\\&lt;/td&gt;&lt;td&gt;Backslash (0x5C)&lt;/td&gt;&lt;/tr&gt;
\xNN - 8-bit character (N hex) &lt;tr&gt;&lt;td&gt;\xNN&lt;/td&gt;&lt;td&gt;8-bit character (N hex)&lt;/td&gt;&lt;/tr&gt;
\uNNNN - 16-bit Unicode (N hex)</string> &lt;tr&gt;&lt;td&gt;\uNNNN&lt;/td&gt;&lt;td&gt;16-bit Unicode (N hex)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Parse Escapes</string> <string>&amp;Parse Escapes</string>
@ -605,7 +606,7 @@ p, li { white-space: pre-wrap; }
</size> </size>
</property> </property>
<attribute name="title"> <attribute name="title">
<string>Appearance</string> <string>A&amp;ppearance</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
@ -773,7 +774,7 @@ p, li { white-space: pre-wrap; }
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="lblScale"> <widget class="QLabel" name="lblScale">
<property name="text"> <property name="text">
<string>&amp;Printing Scale:</string> <string>Printing Sca&amp;le:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -874,7 +875,7 @@ p, li { white-space: pre-wrap; }
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Colour: </string> <string>Colour:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -1003,7 +1004,7 @@ p, li { white-space: pre-wrap; }
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Dot Size:</string> <string>Dot S&amp;ize:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -1123,13 +1124,6 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>tabMain</tabstop>
<tabstop>txtData</tabstop>
<tabstop>chkComposite</tabstop>
<tabstop>cmbCompType</tabstop>
<tabstop>txtComposite</tabstop>
</tabstops>
<resources> <resources>
<include location="resources.qrc"/> <include location="resources.qrc"/>
</resources> </resources>

View File

@ -52,27 +52,27 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
"Australia Post Reply-Paid", "Australia Post Reply-Paid",
"Australia Post Routing Code", "Australia Post Routing Code",
"Australia Post Standard Customer", "Australia Post Standard Customer",
"Aztec Code (ISO 24778)", "Aztec Code (ISO 24778) (and HIBC)",
"Aztec Runes", "Aztec Runes",
"Channel Code", "Channel Code",
"Codabar", "Codabar",
"Codablock-F", "Codablock-F (and HIBC)",
"Code 11", "Code 11",
"Code 128 (ISO 15417)", "Code 128 (ISO 15417) (and GS1-128 and HIBC)",
"Code 16k", "Code 16k",
"Code 2 of 5 Data Logic", "Code 2 of 5 Data Logic",
"Code 2 of 5 IATA", "Code 2 of 5 IATA",
"Code 2 of 5 Industrial", "Code 2 of 5 Industrial",
"Code 2 of 5 Interleaved", "Code 2 of 5 Interleaved",
"Code 2 of 5 Standard", "Code 2 of 5 Standard (Matrix)",
"Code 32 (Italian Pharmacode)", "Code 32 (Italian Pharmacode)",
"Code 39 (ISO 16388)", "Code 39 (ISO 16388) (and HIBC)",
"Code 39 Extended", "Code 39 Extended",
"Code 49", "Code 49",
"Code 93", "Code 93",
"Code One", "Code One",
"DAFT Code", "DAFT Code",
"Data Matrix (ISO 16022)", "Data Matrix (ISO 16022) (and HIBC)",
"Deutsche Post Identcode", "Deutsche Post Identcode",
"Deutsche Post Leitcode", "Deutsche Post Leitcode",
"DotCode", "DotCode",
@ -96,17 +96,17 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
"Korean Postal Barcode", "Korean Postal Barcode",
"LOGMARS", "LOGMARS",
"Maxicode (ISO 16023)", "Maxicode (ISO 16023)",
"MicroPDF417 (ISO 24728)", "MicroPDF417 (ISO 24728) (and HIBC)",
"Micro QR Code", "Micro QR Code",
"MSI Plessey", "MSI Plessey",
"NVE-18 (SSCC-18)", "NVE-18 (SSCC-18)",
"PDF417 (ISO 15438)", "PDF417 (ISO 15438) (and Compact and HIBC)",
"Pharmacode", "Pharmacode",
"Pharmacode 2-track", "Pharmacode 2-track",
"Pharma Zentralnummer (PZN)", "Pharma Zentralnummer (PZN)",
"PLANET", "PLANET",
"Postnet", "POSTNET",
"QR Code (ISO 18004)", "QR Code (ISO 18004) (and HIBC)",
"Rectangular Micro QR (rMQR)", "Rectangular Micro QR (rMQR)",
"Royal Mail 4-state Barcode", "Royal Mail 4-state Barcode",
"Royal Mail 4-state Mailmark", "Royal Mail 4-state Mailmark",
@ -217,7 +217,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
connect(&m_bc.bc, SIGNAL(encoded()), SLOT(on_encoded())); connect(&m_bc.bc, SIGNAL(encoded()), SLOT(on_encoded()));
QShortcut *ctrl_q = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this); QShortcut *ctrl_q = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(ctrl_q, SIGNAL(activated()), SLOT(quit_now())); connect(ctrl_q, SIGNAL(activated()), SLOT(quit_now()));
} }
@ -582,7 +582,7 @@ void MainWindow::change_options()
if (tabMain->count()==3) if (tabMain->count()==3)
tabMain->removeTab(1); tabMain->removeTab(1);
chkComposite->setText(tr("Add 2D Component")); chkComposite->setText(tr("Add &2D Component"));
btype->setItemText(0, tr("No border")); btype->setItemText(0, tr("No border"));
combobox_item_enabled(cmbFontSetting, 1, true); combobox_item_enabled(cmbFontSetting, 1, true);
cmbFontSetting->setItemText(2, tr("Small")); cmbFontSetting->setItemText(2, tr("Small"));
@ -594,8 +594,8 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Code 128")); tabMain->insertTab(1,m_optionWidget,tr("Cod&e 128"));
chkComposite->setText(tr("Add 2D Component (GS1-128 only)")); chkComposite->setText(tr("Add &2D Component (GS1-128 only)"));
connect(m_optionWidget->findChild<QObject*>("radC128EAN"), SIGNAL(toggled( bool )), SLOT(composite_ean_check())); connect(m_optionWidget->findChild<QObject*>("radC128EAN"), SIGNAL(toggled( bool )), SLOT(composite_ean_check()));
connect(m_optionWidget->findChild<QObject*>("radC128Stand"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC128Stand"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radC128CSup"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC128CSup"), SIGNAL(clicked( bool )), SLOT(update_preview()));
@ -610,7 +610,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("PDF417")); tabMain->insertTab(1,m_optionWidget,tr("PDF41&7"));
connect(m_optionWidget->findChild<QObject*>("cmbPDFECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbPDFECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbPDFCols"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbPDFCols"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radPDFTruncated"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radPDFTruncated"), SIGNAL(clicked( bool )), SLOT(update_preview()));
@ -626,7 +626,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Micro PDF417")); tabMain->insertTab(1,m_optionWidget,tr("Micro PDF41&7"));
connect(m_optionWidget->findChild<QObject*>("cmbMPDFCols"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbMPDFCols"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radMPDFStand"), SIGNAL(toggled( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radMPDFStand"), SIGNAL(toggled( bool )), SLOT(update_preview()));
} }
@ -638,7 +638,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("DotCode")); tabMain->insertTab(1,m_optionWidget,tr("DotCod&e"));
connect(m_optionWidget->findChild<QObject*>("cmbDotCols"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbDotCols"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radDotStand"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radDotStand"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radDotGS1"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radDotGS1"), SIGNAL(clicked( bool )), SLOT(update_preview()));
@ -651,7 +651,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Aztec Code")); tabMain->insertTab(1,m_optionWidget,tr("Aztec Cod&e"));
connect(m_optionWidget->findChild<QObject*>("radAztecAuto"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radAztecAuto"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radAztecSize"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radAztecSize"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radAztecECC"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radAztecECC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
@ -669,7 +669,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("MSI Plessey")); tabMain->insertTab(1,m_optionWidget,tr("MSI Pless&ey"));
connect(m_optionWidget->findChild<QObject*>("cmbMSICheck"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbMSICheck"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
} }
@ -680,7 +680,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Code 11")); tabMain->insertTab(1,m_optionWidget,tr("Cod&e 11"));
connect(m_optionWidget->findChild<QObject*>("radC11TwoCheckDigits"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC11TwoCheckDigits"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radC11OneCheckDigit"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC11OneCheckDigit"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radC11NoCheckDigits"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC11NoCheckDigits"), SIGNAL(clicked( bool )), SLOT(update_preview()));
@ -698,7 +698,7 @@ void MainWindow::change_options()
connect(m_optionWidget->findChild<QObject*>("radC39HIBC"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC39HIBC"), SIGNAL(clicked( bool )), SLOT(update_preview()));
if (symbology == BARCODE_EXCODE39) if (symbology == BARCODE_EXCODE39)
{ {
tabMain->insertTab(1,m_optionWidget,tr("Code 39 Extended")); tabMain->insertTab(1,m_optionWidget,tr("Cod&e 39 Extended"));
if(m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->isChecked() == true) if(m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->isChecked() == true)
{ {
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setChecked(false); m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setChecked(false);
@ -707,7 +707,7 @@ void MainWindow::change_options()
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(false); m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(false);
} }
else { else {
tabMain->insertTab(1,m_optionWidget,tr("Code 39")); tabMain->insertTab(1,m_optionWidget,tr("Cod&e 39"));
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(true); m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(true);
} }
} }
@ -731,7 +731,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Code 16K")); tabMain->insertTab(1,m_optionWidget,tr("Cod&e 16K"));
btype->setItemText(0, tr("Default (bind)")); btype->setItemText(0, tr("Default (bind)"));
connect(m_optionWidget->findChild<QObject*>("cmbC16kRowSepHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbC16kRowSepHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radC16kStand"), SIGNAL(toggled( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC16kStand"), SIGNAL(toggled( bool )), SLOT(update_preview()));
@ -755,7 +755,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Codablock-F")); tabMain->insertTab(1,m_optionWidget,tr("Codablock&-F"));
btype->setItemText(0, tr("Default (bind)")); btype->setItemText(0, tr("Default (bind)"));
connect(m_optionWidget->findChild<QObject*>("cmbCbfWidth"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbCbfWidth"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbCbfHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbCbfHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
@ -793,7 +793,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("QR Code")); tabMain->insertTab(1,m_optionWidget,tr("QR Cod&e"));
connect(m_optionWidget->findChild<QObject*>("cmbQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radQRStand"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radQRStand"), SIGNAL(clicked( bool )), SLOT(update_preview()));
@ -809,7 +809,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("rMQR Code")); tabMain->insertTab(1,m_optionWidget,tr("rMQR Cod&e"));
connect(m_optionWidget->findChild<QObject*>("cmbRMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbRMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbRMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbRMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radRMQRStand"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radRMQRStand"), SIGNAL(clicked( bool )), SLOT(update_preview()));
@ -824,7 +824,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Han Xin Code")); tabMain->insertTab(1,m_optionWidget,tr("Han Xin Cod&e"));
connect(m_optionWidget->findChild<QObject*>("cmbHXSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbHXSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbHXECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbHXECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("chkHXFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("chkHXFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview()));
@ -837,7 +837,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Micro QR Code")); tabMain->insertTab(1,m_optionWidget,tr("Micro QR Cod&e"));
connect(m_optionWidget->findChild<QObject*>("cmbMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("chkMQRFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("chkMQRFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview()));
@ -863,7 +863,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Maxicode")); tabMain->insertTab(1,m_optionWidget,tr("Maxicod&e"));
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary())); connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary()));
connect(m_optionWidget->findChild<QObject*>("txtMaxiPrimary"), SIGNAL(textChanged( const QString& )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("txtMaxiPrimary"), SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
@ -876,7 +876,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Channel Code")); tabMain->insertTab(1,m_optionWidget,tr("Channel Cod&e"));
connect(m_optionWidget->findChild<QObject*>("cmbChannel"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbChannel"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
} }
@ -887,7 +887,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Code One")); tabMain->insertTab(1,m_optionWidget,tr("Code On&e"));
connect(m_optionWidget->findChild<QObject*>("cmbC1Size"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbC1Size"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radC1GS1"), SIGNAL(toggled( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC1GS1"), SIGNAL(toggled( bool )), SLOT(update_preview()));
} }
@ -899,7 +899,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Code 49")); tabMain->insertTab(1,m_optionWidget,tr("Cod&e 49"));
connect(m_optionWidget->findChild<QObject*>("cmbC49RowSepHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbC49RowSepHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radC49GS1"), SIGNAL(toggled( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radC49GS1"), SIGNAL(toggled( bool )), SLOT(update_preview()));
} }
@ -911,7 +911,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("GS1 DataBar Stacked")); tabMain->insertTab(1,m_optionWidget,tr("GS1 DataBar Stack&ed"));
connect(m_optionWidget->findChild<QObject*>("cmbCols"), SIGNAL(currentIndexChanged ( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbCols"), SIGNAL(currentIndexChanged ( int )), SLOT(update_preview()));
} }
@ -922,7 +922,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Ultracode")); tabMain->insertTab(1,m_optionWidget,tr("Ultracod&e"));
connect(m_optionWidget->findChild<QObject*>("radUltraAuto"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radUltraAuto"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("radUltraEcc"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("radUltraEcc"), SIGNAL(clicked( bool )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbUltraEcc"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("cmbUltraEcc"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
@ -956,11 +956,11 @@ void MainWindow::change_options()
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
if (symbology == BARCODE_UPCE || symbology == BARCODE_UPCE_CHK || symbology == BARCODE_UPCE_CC) { if (symbology == BARCODE_UPCE || symbology == BARCODE_UPCE_CHK || symbology == BARCODE_UPCE_CC) {
tabMain->insertTab(1, m_optionWidget, tr("UPC-E")); tabMain->insertTab(1, m_optionWidget, tr("UPC-&E"));
} else if (symbology == BARCODE_ISBNX) { } else if (symbology == BARCODE_ISBNX) {
tabMain->insertTab(1, m_optionWidget, tr("ISBN")); tabMain->insertTab(1, m_optionWidget, tr("ISBN"));
} else { } else {
tabMain->insertTab(1, m_optionWidget, tr("EAN")); tabMain->insertTab(1, m_optionWidget, tr("&EAN"));
} }
combobox_item_enabled(cmbFontSetting, 1, false); combobox_item_enabled(cmbFontSetting, 1, false);
if (cmbFontSetting->currentIndex() == 1) { if (cmbFontSetting->currentIndex() == 1) {
@ -977,7 +977,7 @@ void MainWindow::change_options()
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("VIN")); tabMain->insertTab(1,m_optionWidget,tr("&VIN"));
connect(m_optionWidget->findChild<QObject*>("chkVINImportChar"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild<QObject*>("chkVINImportChar"), SIGNAL(clicked( bool )), SLOT(update_preview()));
} }

View File

@ -25,10 +25,7 @@
#include "ui_mainWindow.h" #include "ui_mainWindow.h"
#include "barcodeitem.h" #include "barcodeitem.h"
class QAction;
class QActionGroup;
class QLabel; class QLabel;
class QMenu;
class MainWindow : public QWidget, private Ui::mainWindow class MainWindow : public QWidget, private Ui::mainWindow
{ {
@ -138,8 +135,6 @@ protected:
void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled); void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled);
void upcean_addon_gap(QComboBox *comboBox, QLabel *label, int base); void upcean_addon_gap(QComboBox *comboBox, QLabel *label, int base);
void set_gs1_mode(bool gs1_mode); void set_gs1_mode(bool gs1_mode);
bool fixed_height();
bool no_hrt();
const char *get_setting_name(int symbology); const char *get_setting_name(int symbology);
int get_button_group_index(const QStringList &children); int get_button_group_index(const QStringList &children);
void set_radiobutton_from_setting(QSettings &settings, const QString &setting, const QStringList &children, int default_val = 0); void set_radiobutton_from_setting(QSettings &settings, const QString &setting, const QStringList &children, int default_val = 0);

View File

@ -158,8 +158,10 @@ void SequenceWindow::check_generate()
preview_copy = txtPreview->toPlainText(); preview_copy = txtPreview->toPlainText();
if(preview_copy.isEmpty()) { if(preview_copy.isEmpty()) {
btnExport->setEnabled(false); btnExport->setEnabled(false);
lblExport->setEnabled(false);
} else { } else {
btnExport->setEnabled(true); btnExport->setEnabled(true);
lblExport->setEnabled(true);
} }
} }