mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Tabs/typo in zint.h; PostNet -> POSTNET; ui: shortcuts, tooltips; tests inkscape -> libreoffice
This commit is contained in:
parent
36c19053d7
commit
e37a82a8f1
@ -4,6 +4,7 @@
|
||||
# vim: set ts=4 sw=4 et :
|
||||
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
project(zint_backend_tests)
|
||||
|
||||
enable_testing()
|
||||
|
||||
@ -30,18 +31,36 @@ if(NOT EXISTS ${BWIPP_PS})
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
if(ZINT_DEBUG)
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
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")
|
||||
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=address")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address")
|
||||
link_libraries("-fsanitize=undefined -fsanitize=address")
|
||||
endif()
|
||||
if(ZINT_TEST)
|
||||
endif()
|
||||
|
||||
if(ZINT_TEST)
|
||||
add_definitions("-DZINT_TEST")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(testcommon testcommon.c testcommon.h)
|
||||
|
BIN
backend/tests/data/emf/code39_rotate_180.emf
Normal file
BIN
backend/tests/data/emf/code39_rotate_180.emf
Normal file
Binary file not shown.
BIN
backend/tests/data/emf/code39_rotate_270.emf
Normal file
BIN
backend/tests/data/emf/code39_rotate_270.emf
Normal file
Binary file not shown.
BIN
backend/tests/data/emf/code39_rotate_90.emf
Normal file
BIN
backend/tests/data/emf/code39_rotate_90.emf
Normal file
Binary file not shown.
@ -1,63 +1,63 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"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">
|
||||
<desc>Zint Generated Symbol
|
||||
</desc>
|
||||
|
||||
<g id="barcode" fill="#000000">
|
||||
<rect x="0" y="0" width="242" height="72" fill="#FFFFFF" />
|
||||
<rect x="20.00" y="6.00" width="4.00" height="60.00" />
|
||||
<rect x="26.00" y="6.00" width="2.00" height="60.00" />
|
||||
<rect x="36.00" y="6.00" width="2.00" height="60.00" />
|
||||
<rect x="42.00" y="6.00" width="2.00" height="60.00" />
|
||||
<rect x="46.00" y="6.00" width="8.00" height="60.00" />
|
||||
<rect x="56.00" y="6.00" width="6.00" height="60.00" />
|
||||
<rect x="64.00" y="6.00" width="2.00" height="20.00" />
|
||||
<rect x="70.00" y="6.00" width="2.00" height="20.00" />
|
||||
<rect x="74.00" y="6.00" width="4.00" height="20.00" />
|
||||
<rect x="86.00" y="6.00" width="2.00" height="60.00" />
|
||||
<rect x="90.00" y="6.00" width="2.00" height="60.00" />
|
||||
<rect x="98.00" y="6.00" width="4.00" height="60.00" />
|
||||
<rect x="108.00" y="6.00" width="2.00" height="60.00" />
|
||||
<rect x="112.00" y="6.00" width="2.00" height="40.00" />
|
||||
<rect x="120.00" y="6.00" width="4.00" height="40.00" />
|
||||
<rect x="130.00" y="6.00" width="2.00" height="40.00" />
|
||||
<rect x="134.00" y="6.00" width="2.00" height="40.00" />
|
||||
<rect x="142.00" y="6.00" width="4.00" height="40.00" />
|
||||
<rect x="152.00" y="6.00" width="2.00" height="40.00" />
|
||||
<rect x="156.00" y="6.00" width="2.00" height="40.00" />
|
||||
<rect x="164.00" y="6.00" width="4.00" height="40.00" />
|
||||
<rect x="174.00" y="6.00" width="4.00" height="20.00" />
|
||||
<rect x="180.00" y="6.00" width="4.00" height="20.00" />
|
||||
<rect x="188.00" y="6.00" width="4.00" height="20.00" />
|
||||
<rect x="196.00" y="6.00" width="4.00" height="60.00" />
|
||||
<rect x="206.00" y="6.00" width="6.00" height="60.00" />
|
||||
<rect x="214.00" y="6.00" width="2.00" height="60.00" />
|
||||
<rect x="218.00" y="6.00" width="4.00" height="60.00" />
|
||||
<rect x="64.00" y="26.00" width="4.00" height="20.00" />
|
||||
<rect x="74.00" y="26.00" width="2.00" height="20.00" />
|
||||
<rect x="80.00" y="26.00" width="2.00" height="20.00" />
|
||||
<rect x="174.00" y="26.00" width="8.00" height="20.00" />
|
||||
<rect x="184.00" y="26.00" width="2.00" height="40.00" />
|
||||
<rect x="192.00" y="26.00" width="2.00" height="20.00" />
|
||||
<rect x="64.00" y="46.00" width="2.00" height="20.00" />
|
||||
<rect x="68.00" y="46.00" width="4.00" height="20.00" />
|
||||
<rect x="76.00" y="46.00" width="6.00" height="20.00" />
|
||||
<rect x="112.00" y="46.00" width="6.00" height="20.00" />
|
||||
<rect x="120.00" y="46.00" width="8.00" height="20.00" />
|
||||
<rect x="130.00" y="46.00" width="4.00" height="20.00" />
|
||||
<rect x="138.00" y="46.00" width="4.00" height="20.00" />
|
||||
<rect x="144.00" y="46.00" width="4.00" height="20.00" />
|
||||
<rect x="152.00" y="46.00" width="4.00" height="20.00" />
|
||||
<rect x="160.00" y="46.00" width="6.00" height="20.00" />
|
||||
<rect x="170.00" y="46.00" width="2.00" height="20.00" />
|
||||
<rect x="174.00" y="46.00" width="4.00" height="20.00" />
|
||||
<rect x="190.00" y="46.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="45.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="66.00" width="202.00" height="6.00" />
|
||||
<rect x="0" y="0" width="242" height="64" fill="#FFFFFF" />
|
||||
<rect x="20.00" y="2.00" width="4.00" height="60.00" />
|
||||
<rect x="26.00" y="2.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="2.00" width="2.00" height="60.00" />
|
||||
<rect x="46.00" y="2.00" width="8.00" height="60.00" />
|
||||
<rect x="56.00" y="2.00" width="6.00" height="60.00" />
|
||||
<rect x="64.00" y="2.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="2.00" width="4.00" height="20.00" />
|
||||
<rect x="86.00" y="2.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="2.00" width="4.00" height="60.00" />
|
||||
<rect x="108.00" y="2.00" width="2.00" height="60.00" />
|
||||
<rect x="112.00" y="2.00" width="2.00" height="40.00" />
|
||||
<rect x="120.00" y="2.00" width="4.00" height="40.00" />
|
||||
<rect x="130.00" y="2.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="2.00" width="4.00" height="40.00" />
|
||||
<rect x="152.00" y="2.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="2.00" width="4.00" height="40.00" />
|
||||
<rect x="174.00" y="2.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="2.00" width="4.00" height="20.00" />
|
||||
<rect x="196.00" y="2.00" width="4.00" height="60.00" />
|
||||
<rect x="206.00" y="2.00" width="6.00" height="60.00" />
|
||||
<rect x="214.00" y="2.00" width="2.00" height="60.00" />
|
||||
<rect x="218.00" y="2.00" width="4.00" height="60.00" />
|
||||
<rect x="64.00" y="22.00" width="4.00" height="20.00" />
|
||||
<rect x="74.00" y="22.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="22.00" width="8.00" height="20.00" />
|
||||
<rect x="184.00" y="22.00" width="2.00" height="40.00" />
|
||||
<rect x="192.00" y="22.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="42.00" width="4.00" height="20.00" />
|
||||
<rect x="76.00" y="42.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="42.00" width="8.00" height="20.00" />
|
||||
<rect x="130.00" y="42.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="42.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="42.00" width="6.00" height="20.00" />
|
||||
<rect x="170.00" y="42.00" width="2.00" height="20.00" />
|
||||
<rect x="174.00" y="42.00" width="4.00" height="20.00" />
|
||||
<rect x="190.00" y="42.00" width="2.00" height="20.00" />
|
||||
<rect x="42.00" y="21.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="2.00" />
|
||||
<rect x="20.00" y="62.00" width="202.00" height="2.00" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -100,8 +100,8 @@ static void test_hrt(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
unsigned char *expected;
|
||||
char *data;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -119,8 +119,6 @@ static void test_hrt(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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);
|
||||
|
||||
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(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);
|
||||
}
|
||||
@ -148,7 +146,7 @@ static void test_input(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -198,7 +196,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -100,9 +100,9 @@ static void test_hrt(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -110,8 +110,6 @@ static void test_hrt(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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);
|
||||
|
||||
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(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);
|
||||
}
|
||||
@ -139,7 +137,7 @@ static void test_input(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -201,7 +199,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -309,7 +307,7 @@ static void test_fuzz(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
};
|
||||
@ -339,7 +337,7 @@ static void test_fuzz(int index, int debug) {
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -41,7 +41,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int input_mode;
|
||||
int option_1;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
int expected_rows;
|
||||
@ -444,7 +444,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -480,7 +480,7 @@ static void test_fuzz(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int input_mode;
|
||||
int option_1;
|
||||
@ -912,7 +912,7 @@ static void test_fuzz(int index, int 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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -47,7 +47,7 @@ static void test_pixel_plot(int index, int debug) {
|
||||
struct item {
|
||||
int width;
|
||||
int height;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int repeat;
|
||||
};
|
||||
// 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);
|
||||
|
||||
char *bmp = "out.bmp";
|
||||
char escaped[1024];
|
||||
int escaped_size = 1024;
|
||||
|
||||
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));
|
||||
|
||||
symbol->bitmap = data_buf;
|
||||
symbol->bitmap = (unsigned char *) 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);
|
||||
@ -126,7 +124,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
int option_2;
|
||||
char *fgcolour;
|
||||
char *bgcolour;
|
||||
unsigned char* data;
|
||||
char* data;
|
||||
char* expected_file;
|
||||
};
|
||||
struct item data[] = {
|
||||
@ -165,7 +163,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
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);
|
||||
|
||||
strcpy(symbol->outfile, bmp);
|
||||
|
@ -38,7 +38,7 @@ static void test_input(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -127,7 +127,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -406,7 +406,7 @@ static void test_generate(int generate) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
};
|
||||
struct item data[] = { { "576688" }, { "7742862" } };
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -94,7 +94,7 @@ static void test_options(int index, int debug) {
|
||||
int input_mode;
|
||||
int option_1;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -161,7 +161,7 @@ static void test_reader_init(int index, int generate, int debug) {
|
||||
int symbology;
|
||||
int input_mode;
|
||||
int output_options;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -199,7 +199,7 @@ static void test_reader_init(int index, int generate, int debug) {
|
||||
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->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 input_mode;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -306,7 +306,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
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->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 option_1;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -472,7 +472,7 @@ static void test_fuzz(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -39,7 +39,7 @@ static void test_large(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -109,10 +109,10 @@ static void test_hrt(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -146,8 +146,6 @@ static void test_hrt(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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);
|
||||
|
||||
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(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);
|
||||
}
|
||||
@ -176,7 +174,7 @@ static void test_input(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -248,7 +246,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int option_2;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -115,7 +115,7 @@ static void test_input(int index, int debug) {
|
||||
struct item {
|
||||
int input_mode;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -172,7 +172,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -258,7 +258,7 @@ static void test_fuzz(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -40,7 +40,7 @@ static void test_large(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -108,7 +108,7 @@ static void test_hrt_cpy_iso8859_1(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
char *expected;
|
||||
@ -135,7 +135,6 @@ static void test_hrt_cpy_iso8859_1(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
int vals[20];
|
||||
struct zint_symbol symbol;
|
||||
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;
|
||||
|
||||
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++) {
|
||||
//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, (int) strlen(symbol.text), "i:%d ret %d != strlen %d\n", i, ret, (int) strlen(symbol.text));
|
||||
assert_nonzero(testUtilIsValidUTF8(symbol.text, strlen(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_equal(ret, (int) ustrlen(symbol.text), "i:%d ret %d != strlen %d\n", i, ret, (int) ustrlen(symbol.text));
|
||||
assert_nonzero(testUtilIsValidUTF8(symbol.text, ustrlen(symbol.text)), "i:%d testUtilIsValidUTF8(%s) != 1\n", i, symbol.text);
|
||||
assert_zero(strcmp((char *) symbol.text, data[i].expected), "i:%d symbol.text (%s) != expected (%s)\n", i, symbol.text, data[i].expected);
|
||||
}
|
||||
|
||||
testFinish();
|
||||
@ -166,10 +165,10 @@ static void test_hrt(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
// é U+00E9 (\351, 233), UTF-8 C3A9, CodeB-only extended ASCII
|
||||
// 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);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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);
|
||||
|
||||
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(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);
|
||||
}
|
||||
@ -219,7 +216,7 @@ static void test_reader_init(int index, int generate, int debug) {
|
||||
int symbology;
|
||||
int input_mode;
|
||||
int output_options;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -279,7 +276,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -371,7 +368,7 @@ static void test_ean128_input(int index, int generate, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_width;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -441,7 +438,7 @@ static void test_hibc_input(int index, int generate, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_width;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -496,7 +493,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -88,7 +88,7 @@ static void test_reader_init(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int input_mode;
|
||||
int output_options;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -128,7 +128,7 @@ static void test_reader_init(int index, int generate, int debug) {
|
||||
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->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;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -206,7 +206,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
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->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;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -87,7 +87,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -139,7 +139,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
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->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;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -39,7 +39,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int input_mode;
|
||||
int eci;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
} else {
|
||||
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 {
|
||||
int input_mode;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -410,7 +410,7 @@ static void test_fuzz(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int input_mode;
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
@ -504,7 +504,7 @@ static void test_large(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -71,7 +71,7 @@ static void test_bom(int debug) {
|
||||
"111111100101101000101";
|
||||
|
||||
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(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 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(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 input_mode;
|
||||
int eci;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_eci;
|
||||
char *comment;
|
||||
@ -228,7 +228,7 @@ static void test_reduced_charset_input(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (data[i].expected_eci != -1) {
|
||||
|
@ -36,8 +36,8 @@ static void test_emf(int index, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
if (!testUtilHaveInkscape()) {
|
||||
testSkip("Inkscape not available");
|
||||
if (!testUtilHaveLibreOffice()) {
|
||||
testSkip("LibreOffice not available");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ static void test_emf(int index, int debug) {
|
||||
char *fgcolour;
|
||||
char *bgcolour;
|
||||
float scale;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -76,7 +76,7 @@ static void test_emf(int index, int debug) {
|
||||
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);
|
||||
|
||||
char *filename = "out.emf";
|
||||
@ -84,8 +84,8 @@ static void test_emf(int index, int debug) {
|
||||
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);
|
||||
|
||||
ret = testUtilVerifyInkscape(symbol->outfile, debug); // Slow
|
||||
assert_zero(ret, "i:%d %s inkscape %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret);
|
||||
ret = testUtilVerifyLibreOffice(symbol->outfile, debug); // Slow
|
||||
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);
|
||||
|
||||
@ -99,7 +99,10 @@ static void test_print(int index, int generate, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int have_inkscape = testUtilHaveInkscape();
|
||||
int have_libreoffice = 0;
|
||||
if (generate) {
|
||||
have_libreoffice = testUtilHaveLibreOffice();
|
||||
}
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
@ -111,18 +114,22 @@ static void test_print(int index, int generate, int debug) {
|
||||
int option_2;
|
||||
char *fgcolour;
|
||||
char *bgcolour;
|
||||
unsigned char* data;
|
||||
int rotate_angle;
|
||||
char* data;
|
||||
char* expected_file;
|
||||
};
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT, -1, -1, -1, "", "", "Égjpqy", "../data/emf/code128_egrave_bold.emf" },
|
||||
/* 1*/ { BARCODE_TELEPEN, -1, -1, -1, -1, -1, "147AD0", "FC9630", "123", "../data/emf/telenum_fg_bg.emf" },
|
||||
/* 2*/ { BARCODE_ULTRA, -1, -1, 5, -1, -1, "147AD0", "FC9630", "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" },
|
||||
/* 4*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "", "", "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" },
|
||||
/* 6*/ { BARCODE_UPCE, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, "", "", "0123456+12", "../data/emf/upce_2addon_small_bold.emf" },
|
||||
/* 7*/ { BARCODE_ITF14, -1, BOLD_TEXT, -1, -1, -1, "", "", "123", "../data/emf/itf14_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", 0, "123", "../data/emf/telenum_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, "", "", 0, "9780877799306+54321", "../data/emf/ean13_5addon_ggs_5.2.2.5.2-2.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, "", "", 0, "0123456+12", "../data/emf/upce_2addon.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, "", "", 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);
|
||||
|
||||
@ -156,22 +163,22 @@ static void test_print(int index, int generate, int debug) {
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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,
|
||||
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);
|
||||
assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret);
|
||||
if (have_inkscape) {
|
||||
ret = testUtilVerifyInkscape(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);
|
||||
if (have_libreoffice) {
|
||||
ret = testUtilVerifyLibreOffice(data[i].expected_file, debug);
|
||||
assert_zero(ret, "i:%d %s libreoffice %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret);
|
||||
}
|
||||
} else {
|
||||
assert_nonzero(testUtilExists(symbol->outfile), "i:%d testUtilExists(%s) == 0\n", i, symbol->outfile);
|
||||
|
@ -152,7 +152,7 @@ static void test_gb18030_utf8tomb(int index) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
@ -213,7 +213,7 @@ static void test_gb18030_utf8tosb(int index) {
|
||||
struct item {
|
||||
int eci;
|
||||
int full_multibyte;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
@ -284,10 +284,9 @@ static void test_gb18030_cpy(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int full_multibyte;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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]);
|
||||
|
@ -55,7 +55,6 @@ static void test_gb2312_wctomb_zint(void) {
|
||||
testStart("");
|
||||
|
||||
int ret, ret2;
|
||||
unsigned char buf[2], buf2[2];
|
||||
unsigned int val, val2;
|
||||
|
||||
for (unsigned int i = 0; i < 0xFFFE; i++) {
|
||||
@ -93,7 +92,7 @@ static void test_gb2312_utf8tomb(int index) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
@ -154,7 +153,7 @@ static void test_gb2312_utf8tosb(int index) {
|
||||
struct item {
|
||||
int eci;
|
||||
int full_multibyte;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
@ -223,10 +222,9 @@ static void test_gb2312_cpy(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int full_multibyte;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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]);
|
||||
|
@ -46,7 +46,7 @@ static void test_pixel_plot(int index, int debug) {
|
||||
struct item {
|
||||
int width;
|
||||
int height;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int repeat;
|
||||
};
|
||||
// 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);
|
||||
|
||||
char *gif = "out.gif";
|
||||
char escaped[1024];
|
||||
int escaped_size = 1024;
|
||||
|
||||
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));
|
||||
|
||||
symbol->bitmap = data_buf;
|
||||
symbol->bitmap = (unsigned char *) 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);
|
||||
|
@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -88,7 +88,7 @@ static void test_options(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret_encode;
|
||||
@ -126,7 +126,7 @@ static void test_options(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (data[i].ret_vector != -1) {
|
||||
@ -151,7 +151,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
int input_mode;
|
||||
int eci;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_eci;
|
||||
char *expected;
|
||||
@ -238,7 +238,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -249,7 +249,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
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_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;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int input_mode;
|
||||
int option_1;
|
||||
int option_2;
|
||||
@ -395,7 +395,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -44,12 +44,12 @@ static void test_gs1_reduce(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
unsigned char *composite;
|
||||
char *data;
|
||||
char *composite;
|
||||
int ret;
|
||||
|
||||
char *comment;
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
struct item data[] = {
|
||||
/* 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);
|
||||
|
||||
ret = ZBarcode_Encode(symbol, text, length);
|
||||
ret = ZBarcode_Encode(symbol, (unsigned char *) text, length);
|
||||
|
||||
if (generate) {
|
||||
if (data[i].ret == 0) {
|
||||
@ -237,10 +237,10 @@ static void test_hrt(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
unsigned char *composite;
|
||||
char *data;
|
||||
char *composite;
|
||||
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -275,10 +275,10 @@ static void test_hrt(int index, int debug) {
|
||||
}
|
||||
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(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);
|
||||
}
|
||||
@ -294,7 +294,7 @@ static void test_gs1_verify(int index) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
char *expected;
|
||||
};
|
||||
@ -801,7 +801,7 @@ static void test_gs1_verify(int index) {
|
||||
|
||||
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);
|
||||
|
||||
if (ret == 0) {
|
||||
@ -821,8 +821,8 @@ static void test_input_mode(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
unsigned char *composite;
|
||||
char *data;
|
||||
char *composite;
|
||||
int input_mode;
|
||||
int output_options;
|
||||
int ret;
|
||||
@ -894,7 +894,7 @@ static void test_input_mode(int index, int debug) {
|
||||
}
|
||||
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);
|
||||
if (index == -1 && data[i].compare_previous) {
|
||||
ret = testUtilSymbolCmp(symbol, &previous_symbol);
|
||||
|
@ -37,7 +37,7 @@ static void test_large(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -88,7 +88,7 @@ static void test_options(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret_encode;
|
||||
@ -130,7 +130,7 @@ static void test_options(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (data[i].ret_vector != -1) {
|
||||
@ -155,7 +155,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
int input_mode;
|
||||
int eci;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -255,7 +255,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int input_mode;
|
||||
int option_1;
|
||||
int option_2;
|
||||
@ -439,7 +439,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -53,7 +53,6 @@ static void test_csv(int index, int debug) {
|
||||
char actual_daft[70];
|
||||
|
||||
int ret;
|
||||
int i;
|
||||
int lc = 0;
|
||||
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->debug |= debug;
|
||||
|
||||
ret = ZBarcode_Encode(symbol, data, strlen(data));
|
||||
ret = ZBarcode_Encode(symbol, (unsigned char *) data, strlen(data));
|
||||
|
||||
if (strcmp(return_code, "00") == 0) {
|
||||
|
||||
@ -130,8 +129,8 @@ static void test_hrt(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
unsigned char *expected;
|
||||
char *data;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -139,8 +138,6 @@ static void test_hrt(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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);
|
||||
|
||||
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(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);
|
||||
}
|
||||
@ -167,7 +164,7 @@ static void test_input(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -221,7 +218,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
int clz_u64(uint64_t x);
|
||||
|
||||
static void test_clz_u64(int index, int debug) {
|
||||
static void test_clz_u64(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
@ -187,11 +187,10 @@ static void test_clz_u64(int index, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_load(int index, int debug) {
|
||||
static void test_load(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
large_int t;
|
||||
large_int s;
|
||||
@ -224,14 +223,13 @@ static void test_load(int index, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_load_str_u64(int index, int debug) {
|
||||
static void test_load_str_u64(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
large_int t;
|
||||
const unsigned char *s;
|
||||
const char *s;
|
||||
int length;
|
||||
large_int expected;
|
||||
};
|
||||
@ -254,7 +252,7 @@ static void test_load_str_u64(int index, int debug) {
|
||||
|
||||
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",
|
||||
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();
|
||||
}
|
||||
|
||||
static void test_add_u64(int index, int debug) {
|
||||
static void test_add_u64(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
large_int t;
|
||||
uint64_t s;
|
||||
@ -309,11 +306,10 @@ static void test_add_u64(int index, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_sub_u64(int index, int debug) {
|
||||
static void test_sub_u64(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
large_int t;
|
||||
uint64_t s;
|
||||
@ -353,11 +349,10 @@ static void test_sub_u64(int index, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_mul_u64(int index, int debug) {
|
||||
static void test_mul_u64(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
large_int t;
|
||||
uint64_t s;
|
||||
@ -410,7 +405,7 @@ static void test_mul_u64(int index, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_div_u64(int index, int debug) {
|
||||
static void test_div_u64(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
@ -535,11 +530,10 @@ static void test_div_u64(int index, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_unset_bit(int index, int debug) {
|
||||
static void test_unset_bit(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
large_int t;
|
||||
int s;
|
||||
@ -699,11 +693,10 @@ static void test_unset_bit(int index, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_uint_array(int index, int debug) {
|
||||
static void test_uint_array(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
large_int t;
|
||||
int size;
|
||||
@ -784,11 +777,10 @@ static void test_uint_array(int index, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_dump(int index, int debug) {
|
||||
static void test_dump(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
large_int t;
|
||||
char *expected;
|
||||
@ -863,16 +855,16 @@ static void test_dump(int index, int debug) {
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */
|
||||
{ "test_clz_u64", test_clz_u64, 1, 0, 1 },
|
||||
{ "test_load", test_load, 1, 0, 1 },
|
||||
{ "test_load_str_u64", test_load_str_u64, 1, 0, 1 },
|
||||
{ "test_add_u64", test_add_u64, 1, 0, 1 },
|
||||
{ "test_sub_u64", test_sub_u64, 1, 0, 1 },
|
||||
{ "test_mul_u64", test_mul_u64, 1, 0, 1 },
|
||||
{ "test_div_u64", test_div_u64, 1, 0, 1 },
|
||||
{ "test_unset_bit", test_unset_bit, 1, 0, 1 },
|
||||
{ "test_uint_array", test_uint_array, 1, 0, 1 },
|
||||
{ "test_dump", test_dump, 1, 0, 1 },
|
||||
{ "test_clz_u64", test_clz_u64, 1, 0, 0 },
|
||||
{ "test_load", test_load, 1, 0, 0 },
|
||||
{ "test_load_str_u64", test_load_str_u64, 1, 0, 0 },
|
||||
{ "test_add_u64", test_add_u64, 1, 0, 0 },
|
||||
{ "test_sub_u64", test_sub_u64, 1, 0, 0 },
|
||||
{ "test_mul_u64", test_mul_u64, 1, 0, 0 },
|
||||
{ "test_div_u64", test_div_u64, 1, 0, 0 },
|
||||
{ "test_unset_bit", test_unset_bit, 1, 0, 0 },
|
||||
{ "test_uint_array", test_uint_array, 1, 0, 0 },
|
||||
{ "test_dump", test_dump, 1, 0, 0 },
|
||||
};
|
||||
|
||||
testRun(argc, argv, funcs, ARRAY_SIZE(funcs));
|
||||
|
@ -41,7 +41,7 @@ static void test_checks(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int input_mode;
|
||||
int eci;
|
||||
@ -65,10 +65,6 @@ static void test_checks(int index, int debug) {
|
||||
};
|
||||
int data_size = sizeof(data) / sizeof(struct item);
|
||||
|
||||
char *text;
|
||||
char *primary;
|
||||
char escaped_primary[1024];
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
ret = strcmp(symbol->errtxt, data[i].expected);
|
||||
@ -108,7 +104,7 @@ static void test_input_mode(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int input_mode;
|
||||
int ret;
|
||||
|
||||
@ -143,7 +139,7 @@ static void test_input_mode(int index, int debug) {
|
||||
|
||||
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(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;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_width;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -219,7 +215,7 @@ static void test_escape_char_process(int index, int generate, int debug) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_cap(int index, int debug) {
|
||||
static void test_cap(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
@ -288,7 +284,6 @@ static void test_encode_file_directory(void) {
|
||||
|
||||
int ret;
|
||||
char dirname[] = "in_dir";
|
||||
int fd;
|
||||
|
||||
struct zint_symbol *symbol = ZBarcode_Create();
|
||||
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);
|
||||
|
||||
// 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_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_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_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_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, (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_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");
|
||||
@ -366,13 +361,13 @@ static void test_bad_args(void) {
|
||||
|
||||
// Empty data/filename
|
||||
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");
|
||||
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");
|
||||
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");
|
||||
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");
|
||||
@ -395,7 +390,7 @@ int main(int argc, char *argv[]) {
|
||||
{ "test_checks", test_checks, 1, 0, 1 },
|
||||
{ "test_input_mode", test_input_mode, 1, 0, 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_directory", test_encode_file_directory, 0, 0, 0 },
|
||||
{ "test_bad_args", test_bad_args, 0, 0, 0 },
|
||||
|
@ -36,7 +36,7 @@ static void test_input(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -133,12 +133,12 @@ static void test_encode_vector(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret_encode;
|
||||
float w;
|
||||
float h;
|
||||
int ret_vector;
|
||||
unsigned char *expected_daft;
|
||||
char *expected_daft;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -179,7 +179,7 @@ static void test_encode_vector(int index, int debug) {
|
||||
|
||||
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(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;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int option_1;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
char* primary;
|
||||
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);
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -95,7 +95,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int input_mode;
|
||||
int option_1;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
char* primary;
|
||||
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);
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -224,7 +224,7 @@ static void test_best_supported_set(int index, int generate, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
float w;
|
||||
float h;
|
||||
@ -233,7 +233,7 @@ static void test_best_supported_set(int index, int generate, int debug) {
|
||||
int expected_rows;
|
||||
int expected_width;
|
||||
char *comment;
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
struct item data[] = {
|
||||
/* 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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -322,7 +322,7 @@ static void test_fuzz(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
};
|
||||
@ -351,7 +351,7 @@ static void test_fuzz(int index, int debug) {
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -39,7 +39,7 @@ static void test_large(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -96,9 +96,9 @@ static void test_hrt(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -112,8 +112,6 @@ static void test_hrt(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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);
|
||||
|
||||
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(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);
|
||||
}
|
||||
@ -141,7 +139,7 @@ static void test_input(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -210,7 +208,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -48,7 +48,7 @@ static void test_pcx(int index, int debug) {
|
||||
char *fgcolour;
|
||||
char *bgcolour;
|
||||
float scale;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -92,7 +92,7 @@ static void test_pcx(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
char *filename = "out.pcx";
|
||||
|
@ -41,7 +41,7 @@ static void test_options(int index, int debug) {
|
||||
int option_1;
|
||||
int option_2;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret_encode;
|
||||
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);
|
||||
|
||||
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(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 input_mode;
|
||||
int output_options;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -177,7 +177,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
int symbology;
|
||||
int input_mode;
|
||||
int eci;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_eci;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -264,7 +264,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int input_mode;
|
||||
int option_1;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
int expected_rows;
|
||||
@ -622,7 +622,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -670,7 +670,7 @@ static void test_fuzz(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int option_1;
|
||||
int ret;
|
||||
@ -951,7 +951,7 @@ static void test_fuzz(int index, int debug) {
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -39,7 +39,7 @@ static void test_large(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -98,9 +98,9 @@ static void test_hrt(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -120,8 +120,6 @@ static void test_hrt(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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);
|
||||
|
||||
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(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);
|
||||
}
|
||||
@ -150,7 +148,7 @@ static void test_input(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -195,7 +193,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -47,7 +47,7 @@ static void test_pixel_plot(int index, int debug) {
|
||||
struct item {
|
||||
int width;
|
||||
int height;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int repeat;
|
||||
};
|
||||
// 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);
|
||||
|
||||
char *png = "out.png";
|
||||
char escaped[1024];
|
||||
int escaped_size = 1024;
|
||||
|
||||
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));
|
||||
|
||||
symbol->bitmap = data_buf;
|
||||
symbol->bitmap = (unsigned char *) 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);
|
||||
@ -125,7 +123,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
int option_2;
|
||||
int height;
|
||||
float scale;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
char *composite;
|
||||
char *expected_file;
|
||||
char *comment;
|
||||
@ -205,7 +203,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
}
|
||||
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);
|
||||
|
||||
strcpy(symbol->outfile, png);
|
||||
|
@ -42,7 +42,7 @@ static void test_large(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -105,7 +105,7 @@ static void test_koreapost(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret_encode;
|
||||
int ret_vector;
|
||||
|
||||
@ -130,7 +130,7 @@ static void test_koreapost(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (data[i].ret_vector != -1) {
|
||||
@ -154,7 +154,7 @@ static void test_japanpost(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret_encode;
|
||||
int ret_vector;
|
||||
|
||||
@ -182,7 +182,7 @@ static void test_japanpost(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (data[i].ret_vector != -1) {
|
||||
@ -207,7 +207,7 @@ static void test_input(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -284,7 +284,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -38,9 +38,16 @@ static void test_print(int index, int generate, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int have_identify = testUtilHaveIdentify();
|
||||
int have_inkscape = testUtilHaveInkscape();
|
||||
int have_ghostscript = testUtilHaveGhostscript();
|
||||
int have_identify = 0;
|
||||
int have_libreoffice = 0;
|
||||
int have_ghostscript = 0;
|
||||
int have_vnu = 0;
|
||||
if (generate) {
|
||||
have_identify = testUtilHaveIdentify();
|
||||
have_libreoffice = testUtilHaveLibreOffice();
|
||||
have_ghostscript = testUtilHaveGhostscript();
|
||||
have_vnu = testUtilHaveVnu();
|
||||
}
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
@ -48,7 +55,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
int option_1;
|
||||
int option_2;
|
||||
float scale;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
char *expected_file;
|
||||
};
|
||||
struct item data[] = {
|
||||
@ -104,7 +111,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
} else if (strcmp(exts[j], "svg") == 0 || strcmp(exts[j], "emf") == 0) {
|
||||
if (have_inkscape) {
|
||||
ret = testUtilVerifyInkscape(expected_file, debug);
|
||||
assert_zero(ret, "i:%d %s inkscape %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), expected_file, ret);
|
||||
if (have_libreoffice) {
|
||||
ret = testUtilVerifyLibreOffice(expected_file, debug); // Slow
|
||||
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
|
||||
if (have_identify) {
|
||||
|
@ -36,7 +36,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int have_inkscape = testUtilHaveInkscape();
|
||||
int have_ghostscript = testUtilHaveGhostscript();
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
@ -48,7 +48,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
int option_2;
|
||||
char *fgcolour;
|
||||
char *bgcolour;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
char *expected_file;
|
||||
};
|
||||
struct item data[] = {
|
||||
@ -94,7 +94,7 @@ static void test_print(int index, int generate, int debug) {
|
||||
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);
|
||||
|
||||
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);
|
||||
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);
|
||||
if (have_inkscape) {
|
||||
ret = testUtilVerifyInkscape(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);
|
||||
if (have_ghostscript) {
|
||||
ret = testUtilVerifyGhostscript(data[i].expected_file, debug);
|
||||
assert_zero(ret, "i:%d %s ghostscript %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_file, ret);
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
|
||||
static void test_ps_convert(int index, int debug) {
|
||||
static void test_ps_convert(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
unsigned char *expected;
|
||||
char *data;
|
||||
char *expected;
|
||||
};
|
||||
struct item data[] = {
|
||||
/* 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;
|
||||
|
||||
ps_convert(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);
|
||||
ps_convert((unsigned char *) data[i].data, converted);
|
||||
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();
|
||||
@ -159,7 +158,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */
|
||||
{ "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));
|
||||
|
@ -37,7 +37,7 @@ static void test_qr_options(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret_encode;
|
||||
@ -102,7 +102,7 @@ static void test_qr_options(int index, int debug) {
|
||||
|
||||
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);
|
||||
if (index == -1 && data[i].compare_previous != -1) {
|
||||
ret = testUtilSymbolCmp(symbol, &previous_symbol);
|
||||
@ -132,7 +132,7 @@ static void test_qr_input(int index, int generate, int debug) {
|
||||
int input_mode;
|
||||
int eci;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_eci;
|
||||
char *expected;
|
||||
@ -265,7 +265,7 @@ static void test_qr_input(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -292,7 +292,7 @@ static void test_qr_gs1(int index, int generate, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
char *expected;
|
||||
char *comment;
|
||||
@ -327,7 +327,7 @@ static void test_qr_gs1(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -352,7 +352,7 @@ static void test_qr_optimize(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int ret;
|
||||
char *expected;
|
||||
@ -412,7 +412,7 @@ static void test_qr_optimize(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -436,7 +436,7 @@ static void test_qr_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret;
|
||||
@ -935,7 +935,7 @@ static void test_qr_encode(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -969,7 +969,7 @@ static void test_microqr_options(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret_encode;
|
||||
@ -1051,7 +1051,7 @@ static void test_microqr_options(int index, int debug) {
|
||||
|
||||
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);
|
||||
if (index == -1 && data[i].compare_previous != -1) {
|
||||
ret = testUtilSymbolCmp(symbol, &previous_symbol);
|
||||
@ -1080,7 +1080,7 @@ static void test_microqr_input(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int input_mode;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
char *expected;
|
||||
char *comment;
|
||||
@ -1162,7 +1162,7 @@ static void test_microqr_input(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -1188,7 +1188,7 @@ static void test_microqr_padding(int index, int generate, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int ret;
|
||||
char *expected;
|
||||
@ -1242,7 +1242,7 @@ static void test_microqr_padding(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -1268,7 +1268,7 @@ static void test_microqr_optimize(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret;
|
||||
@ -1312,7 +1312,7 @@ static void test_microqr_optimize(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -1336,7 +1336,7 @@ static void test_microqr_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret;
|
||||
@ -1522,7 +1522,7 @@ static void test_microqr_encode(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -1557,7 +1557,7 @@ static void test_upnqr_input(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
char *expected;
|
||||
char *comment;
|
||||
@ -1589,7 +1589,7 @@ static void test_upnqr_input(int index, int generate, int debug) {
|
||||
|
||||
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(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;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret;
|
||||
@ -1729,7 +1729,7 @@ static void test_upnqr_encode(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -1763,7 +1763,7 @@ static void test_rmqr_options(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret_encode;
|
||||
@ -1861,7 +1861,7 @@ static void test_rmqr_options(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (data[i].ret_vector != -1) {
|
||||
@ -1885,7 +1885,7 @@ static void test_rmqr_input(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int input_mode;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
char *expected;
|
||||
char *comment;
|
||||
@ -1933,7 +1933,7 @@ static void test_rmqr_input(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -1958,7 +1958,7 @@ static void test_rmqr_gs1(int index, int generate, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
char *expected;
|
||||
char *comment;
|
||||
@ -1994,7 +1994,7 @@ static void test_rmqr_gs1(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -2019,7 +2019,7 @@ static void test_rmqr_optimize(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int ret;
|
||||
char *expected;
|
||||
@ -2071,7 +2071,7 @@ static void test_rmqr_optimize(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -2095,7 +2095,7 @@ static void test_rmqr_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int input_mode;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int ret;
|
||||
@ -2156,7 +2156,7 @@ static void test_rmqr_encode(int index, int generate, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -51,7 +51,7 @@ static void test_options(int index, int debug) {
|
||||
char *fgcolour;
|
||||
char *bgcolour;
|
||||
int rotate_angle;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
int expected_width;
|
||||
@ -88,7 +88,7 @@ static void test_options(int index, int debug) {
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -111,7 +111,7 @@ static void test_buffer(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
char *composite;
|
||||
|
||||
int expected_height;
|
||||
@ -274,7 +274,7 @@ static void test_buffer(int index, int generate, int debug) {
|
||||
}
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer(symbol, 0);
|
||||
@ -311,7 +311,7 @@ static void test_upcean_hrt(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int show_hrt;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
int expected_height;
|
||||
@ -379,7 +379,7 @@ static void test_upcean_hrt(int index, int debug) {
|
||||
|
||||
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_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 option_1;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
int expected_height;
|
||||
@ -486,7 +486,7 @@ static void test_row_separator(int index, int debug) {
|
||||
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_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 option_1;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
unsigned char *data2;
|
||||
char *data;
|
||||
char *data2;
|
||||
|
||||
int expected_height;
|
||||
int expected_rows;
|
||||
@ -561,11 +561,11 @@ static void test_stacking(int index, int debug) {
|
||||
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);
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer(symbol, 0);
|
||||
@ -616,7 +616,7 @@ static void test_output_options(int index, int debug) {
|
||||
int border_width;
|
||||
int output_options;
|
||||
int rotate_angle;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
int expected_height;
|
||||
@ -692,8 +692,6 @@ static void test_output_options(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
struct zint_vector_rect *rect;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer(symbol, data[i].rotate_angle);
|
||||
@ -754,8 +752,8 @@ static void test_draw_string_wrap(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int output_options;
|
||||
unsigned char *data;
|
||||
unsigned char* text;
|
||||
char *data;
|
||||
char* text;
|
||||
|
||||
int expected_height;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
// Cheat by overwriting text
|
||||
strcpy(symbol->text, data[i].text);
|
||||
strcpy((char *) symbol->text, data[i].text);
|
||||
|
||||
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);
|
||||
@ -825,7 +823,7 @@ static void test_code128_utf8(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
|
||||
int expected_height;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer(symbol, 0);
|
||||
@ -895,7 +893,7 @@ static void test_scale(int index, int debug) {
|
||||
int border_width;
|
||||
int output_options;
|
||||
float scale;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
char *composite;
|
||||
|
||||
int expected_height;
|
||||
@ -961,7 +959,7 @@ static void test_scale(int index, int debug) {
|
||||
}
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer(symbol, 0);
|
||||
|
@ -1059,8 +1059,6 @@ static void test_hrt(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
if (index != -1 && i != index) continue;
|
||||
|
@ -112,7 +112,7 @@ static void test_sjis_utf8tomb(int index) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
@ -172,7 +172,7 @@ static void test_sjis_utf8tosb(int index) {
|
||||
struct item {
|
||||
int eci;
|
||||
int full_multibyte;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
@ -234,10 +234,9 @@ static void test_sjis_cpy(int index) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int full_multibyte;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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;
|
||||
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);
|
||||
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]);
|
||||
|
@ -36,53 +36,59 @@ static void test_print(int index, int generate, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int have_inkscape = testUtilHaveInkscape();
|
||||
int have_libreoffice = 0;
|
||||
int have_vnu = 0;
|
||||
if (generate) {
|
||||
have_libreoffice = testUtilHaveLibreOffice();
|
||||
have_vnu = testUtilHaveVnu();
|
||||
}
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
int input_mode;
|
||||
int border_width;
|
||||
int output_options;
|
||||
int show_hrt;
|
||||
int option_1;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
char *composite;
|
||||
char *expected_file;
|
||||
};
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_CODE128, -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" },
|
||||
/* 2*/ { BARCODE_CODE128, UNICODE_MODE, 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" },
|
||||
/* 4*/ { BARCODE_CODABLOCKF, -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" },
|
||||
/* 6*/ { BARCODE_EANX, -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" },
|
||||
/* 8*/ { BARCODE_EANX_CC, -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" },
|
||||
/* 10*/ { BARCODE_UPCA, -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" },
|
||||
/* 12*/ { BARCODE_UPCA, -1, 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" },
|
||||
/* 14*/ { BARCODE_UPCA_CC, -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" },
|
||||
/* 16*/ { BARCODE_UPCA_CC, -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" },
|
||||
/* 18*/ { BARCODE_UPCE, -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" },
|
||||
/* 20*/ { BARCODE_UPCE, -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" },
|
||||
/* 22*/ { BARCODE_UPCE_CC, -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" },
|
||||
/* 24*/ { BARCODE_EANX, -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" },
|
||||
/* 26*/ { BARCODE_EANX_CC, -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" },
|
||||
/* 28*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "12345", "", "../data/svg/ean5.svg" },
|
||||
/* 29*/ { BARCODE_EANX, -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" },
|
||||
/* 31*/ { BARCODE_POSTNET, -1, -1, -1, -1, -1, "12345", "", "../data/svg/postnet_zip.svg" },
|
||||
/* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, -1, -1, "<>\"&'", "", "../data/svg/code128_amperands.svg" },
|
||||
/* 1*/ { BARCODE_CODE128, UNICODE_MODE, -1, BOLD_TEXT, -1, -1, -1, "Égjpqy", "", "../data/svg/code128_egrave_bold.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, -1, 3, -1, "[00]030123456789012340", "[02]13012345678909[37]24[10]1234567ABCDEFG", "../data/svg/gs1_128_cc_fig12.svg" },
|
||||
/* 4*/ { BARCODE_CODABLOCKF, -1, -1, -1, -1, 3, -1, "AAAAAAAAA", "", "../data/svg/codablockf_3rows.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, -1, "9780877799306+54321", "", "../data/svg/ean13_5addon_ggs_5.2.2.5.2-2.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, -1, 2, -1, "123456789012+54321", "[91]1234567890", "../data/svg/ean13_cc_5addon_ccb_3x4.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, -1, "012345678905+24", "", "../data/svg/upca_2addon_ggs_5.2.6.6-5.svg" },
|
||||
/* 11*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon.svg" },
|
||||
/* 12*/ { BARCODE_UPCA, -1, 3, BARCODE_BIND, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon_bind3.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, -1, "12345678901+12", "[91]123456789", "../data/svg/upca_cc_2addon_cca_3x4.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, -1, 0, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4_notext.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, -1, "1234567+12", "", "../data/svg/upce_2addon.svg" },
|
||||
/* 19*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, -1, "1234567+12345", "", "../data/svg/upce_5addon.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, -1, "0654321+89", "[91]1", "../data/svg/upce_cc_2addon_cca_5x2.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, -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, -1, "1234567+12", "", "../data/svg/ean8_2addon.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, -1, "9876543+65", "[91]1234567", "../data/svg/ean8_cc_2addon_cca_4x3.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, -1, "12345", "", "../data/svg/ean5.svg" },
|
||||
/* 29*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, "12", "", "../data/svg/ean2.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, -1, "12345", "", "../data/svg/postnet_zip.svg" },
|
||||
};
|
||||
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) {
|
||||
symbol->show_hrt = data[i].show_hrt;
|
||||
}
|
||||
if (data[i].output_options & (BARCODE_BOX | BARCODE_BIND)) {
|
||||
symbol->border_width = 3;
|
||||
if (data[i].border_width != -1) {
|
||||
symbol->border_width = data[i].border_width;
|
||||
}
|
||||
if (strlen(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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
printf(" /*%3d*/ { %s, %s, %s, %d, %d, %d, \"%s\", \"%s\", \"%s\" },\n",
|
||||
i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), testUtilOutputOptionsName(data[i].output_options),
|
||||
printf(" /*%3d*/ { %s, %s, %d, %s, %d, %d, %d, \"%s\", \"%s\", \"%s\" },\n",
|
||||
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);
|
||||
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);
|
||||
if (have_inkscape) {
|
||||
ret = testUtilVerifyInkscape(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);
|
||||
if (have_libreoffice) {
|
||||
ret = testUtilVerifyLibreOffice(data[i].expected_file, debug);
|
||||
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 {
|
||||
assert_nonzero(testUtilExists(symbol->outfile), "i:%d testUtilExists(%s) == 0\n", i, symbol->outfile);
|
||||
|
@ -38,7 +38,7 @@ static void test_large(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -88,10 +88,10 @@ static void test_hrt(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
|
||||
unsigned char *expected;
|
||||
char *expected;
|
||||
};
|
||||
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
|
||||
struct item data[] = {
|
||||
@ -106,8 +106,6 @@ static void test_hrt(int index, int debug) {
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
char *text;
|
||||
|
||||
for (int i = 0; i < data_size; i++) {
|
||||
|
||||
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);
|
||||
|
||||
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(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);
|
||||
}
|
||||
@ -135,7 +133,7 @@ static void test_input(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -189,7 +187,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -285,7 +283,7 @@ static void test_fuzz(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -47,7 +47,7 @@ static void test_pixel_plot(int index, int debug) {
|
||||
struct item {
|
||||
int width;
|
||||
int height;
|
||||
unsigned char *pattern;
|
||||
char *pattern;
|
||||
int repeat;
|
||||
};
|
||||
// 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);
|
||||
|
||||
char *tif = "out.tif";
|
||||
char escaped[1024];
|
||||
int escaped_size = 1024;
|
||||
|
||||
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));
|
||||
|
||||
symbol->bitmap = data_buf;
|
||||
symbol->bitmap = (unsigned char *) 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);
|
||||
|
@ -41,7 +41,7 @@ static void test_input(int index, int generate, int debug) {
|
||||
int eci;
|
||||
int option_1;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
char *expected;
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -137,7 +137,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
int eci;
|
||||
int option_1;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
|
@ -38,7 +38,7 @@ static void test_upce_length(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
};
|
||||
// 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);
|
||||
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
@ -90,7 +90,7 @@ static void test_upca_print(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
};
|
||||
// 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);
|
||||
|
||||
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);
|
||||
|
||||
strcpy(symbol->outfile, "out.gif");
|
||||
@ -132,7 +132,7 @@ static void test_isbn(int index, int debug) {
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret_encode;
|
||||
int ret_vector;
|
||||
};
|
||||
@ -196,7 +196,7 @@ static void test_isbn(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
if (data[i].ret_vector != -1) {
|
||||
@ -217,7 +217,7 @@ static void test_vector_same(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret_encode;
|
||||
int ret_vector;
|
||||
};
|
||||
@ -244,7 +244,7 @@ static void test_vector_same(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer_Vector(symbol, 0);
|
||||
@ -283,7 +283,7 @@ static void test_encode(int index, int generate, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int option_2;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
if (generate) {
|
||||
@ -457,7 +457,7 @@ static void test_fuzz(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int length;
|
||||
int ret;
|
||||
};
|
||||
@ -491,7 +491,7 @@ static void test_fuzz(int index, int debug) {
|
||||
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);
|
||||
|
||||
ZBarcode_Delete(symbol);
|
||||
|
@ -70,7 +70,7 @@ static void test_options(int index, int debug) {
|
||||
char *fgcolour;
|
||||
char *bgcolour;
|
||||
int rotate_angle;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
int expected_rows;
|
||||
int expected_width;
|
||||
@ -103,7 +103,7 @@ static void test_options(int index, int debug) {
|
||||
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);
|
||||
|
||||
if (ret < 5) {
|
||||
@ -128,7 +128,7 @@ static void test_buffer_vector(int index, int generate, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
char *composite;
|
||||
|
||||
int expected_height;
|
||||
@ -289,7 +289,7 @@ static void test_buffer_vector(int index, int generate, int debug) {
|
||||
}
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer_Vector(symbol, 0);
|
||||
@ -324,7 +324,7 @@ static void test_upcean_hrt(int index, int debug) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int show_hrt;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
int expected_height;
|
||||
@ -395,7 +395,7 @@ static void test_upcean_hrt(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer_Vector(symbol, 0);
|
||||
@ -446,7 +446,7 @@ static void test_row_separator(int index, int debug) {
|
||||
int border_width;
|
||||
int option_1;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
int expected_height;
|
||||
@ -484,7 +484,7 @@ static void test_row_separator(int index, int debug) {
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer_Vector(symbol, 0);
|
||||
@ -514,8 +514,8 @@ static void test_stacking(int index, int debug) {
|
||||
int output_options;
|
||||
int option_1;
|
||||
int option_3;
|
||||
unsigned char *data;
|
||||
unsigned char *data2;
|
||||
char *data;
|
||||
char *data2;
|
||||
|
||||
int expected_height;
|
||||
int expected_rows;
|
||||
@ -544,11 +544,11 @@ static void test_stacking(int index, int debug) {
|
||||
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);
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer(symbol, 0);
|
||||
@ -593,7 +593,7 @@ static void test_output_options(int index, int debug) {
|
||||
int whitespace_width;
|
||||
int border_width;
|
||||
int output_options;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int ret;
|
||||
|
||||
int expected_height;
|
||||
@ -666,7 +666,7 @@ static void test_output_options(int index, int debug) {
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer_Vector(symbol, 0);
|
||||
@ -713,7 +713,7 @@ static void test_noncomposite_string_x(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
|
||||
int expected_width;
|
||||
float expected_string_x;
|
||||
@ -739,7 +739,7 @@ static void test_noncomposite_string_x(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer_Vector(symbol, 0);
|
||||
@ -765,7 +765,7 @@ static void test_upcean_whitespace_width(int index, int debug) {
|
||||
int ret;
|
||||
struct item {
|
||||
int symbology;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
int whitespace_width;
|
||||
|
||||
int expected_width;
|
||||
@ -799,7 +799,7 @@ static void test_upcean_whitespace_width(int index, int debug) {
|
||||
|
||||
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);
|
||||
|
||||
ret = ZBarcode_Buffer_Vector(symbol, 0);
|
||||
|
@ -1397,8 +1397,7 @@ int testUtilHaveIdentify() {
|
||||
}
|
||||
|
||||
int testUtilVerifyIdentify(char *filename, int debug) {
|
||||
int ret;
|
||||
char buf[512 + 128];
|
||||
char cmd[512 + 128];
|
||||
|
||||
if (strlen(filename) > 512) {
|
||||
return -1;
|
||||
@ -1407,36 +1406,90 @@ int testUtilVerifyIdentify(char *filename, int debug) {
|
||||
if (debug & ZINT_DEBUG_TEST_PRINT) {
|
||||
// Verbose very noisy though so for quick check just return default output
|
||||
if (debug & ZINT_DEBUG_TEST_LESS_NOISY) {
|
||||
sprintf(buf, "identify %s", filename);
|
||||
sprintf(cmd, "identify %s", filename);
|
||||
} else {
|
||||
sprintf(buf, "identify -verbose %s", filename);
|
||||
sprintf(cmd, "identify -verbose %s", filename);
|
||||
}
|
||||
} 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() {
|
||||
return system("inkscape -z -V > /dev/null") == 0;
|
||||
int testUtilHaveLibreOffice() {
|
||||
return system("libreoffice --version > /dev/null") == 0;
|
||||
}
|
||||
|
||||
int testUtilVerifyInkscape(char *filename, int debug) {
|
||||
int ret;
|
||||
char buf[512 + 128];
|
||||
int testUtilVerifyLibreOffice(char *filename, int debug) {
|
||||
char cmd[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) {
|
||||
return -1;
|
||||
}
|
||||
if (debug & ZINT_DEBUG_TEST_PRINT) {
|
||||
sprintf(buf, "inkscape -z -f %s", filename); // Prints nothing unless bad
|
||||
printf("%s\n", buf);
|
||||
slash = strrchr(filename, '/');
|
||||
if (slash) {
|
||||
strcpy(svg, slash + 1);
|
||||
} 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() {
|
||||
@ -1444,17 +1497,38 @@ int testUtilHaveGhostscript() {
|
||||
}
|
||||
|
||||
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];
|
||||
|
||||
if (strlen(filename) > 512) {
|
||||
return -1;
|
||||
}
|
||||
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);
|
||||
} else {
|
||||
sprintf(buf, "gs -dNOPAUSE -dBATCH -dNODISPLAY -q %s", filename);
|
||||
sprintf(buf, "vnu --svg %s", filename);
|
||||
}
|
||||
|
||||
return system(buf);
|
||||
@ -1764,7 +1838,6 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
|
||||
int r, h;
|
||||
int parse;
|
||||
|
||||
int composite = is_composite(symbology);
|
||||
int upcean = is_extendable(symbology);
|
||||
int upca = symbology == BARCODE_UPCA || symbology == BARCODE_UPCA_CHK || symbology == BARCODE_UPCA_CC;
|
||||
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) {
|
||||
for (r = 0; r < symbol->rows; r++) bwipp_row_height[r] = 1; /* Zap */
|
||||
if (symbology == BARCODE_KIX) {
|
||||
to_upper(bwipp_data);
|
||||
to_upper((unsigned char *) bwipp_data);
|
||||
} else if (symbology == BARCODE_USPS_IMAIL) {
|
||||
char *dash = strchr(bwipp_data, '-');
|
||||
if (dash) {
|
||||
|
@ -106,10 +106,12 @@ int testUtilCmpSvgs(char *svg1, char *svg2);
|
||||
int testUtilCmpEpss(char *eps1, char *eps2);
|
||||
int testUtilHaveIdentify();
|
||||
int testUtilVerifyIdentify(char *filename, int debug);
|
||||
int testUtilHaveInkscape();
|
||||
int testUtilVerifyInkscape(char *filename, int debug);
|
||||
int testUtilHaveLibreOffice();
|
||||
int testUtilVerifyLibreOffice(char *filename, int debug);
|
||||
int testUtilHaveGhostscript();
|
||||
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 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);
|
||||
|
@ -1,5 +1,5 @@
|
||||
--- ../../../../postscriptbarcode/build/monolithic/barcode.ps 2020-09-18 02:41:06.166708679 +0100
|
||||
+++ ../tools/bwipp_dump.ps 2020-09-18 03:56:06.144846176 +0100
|
||||
--- ../../../../postscriptbarcode/build/monolithic/barcode.ps 2020-10-02 20:03:59.411955883 +0100
|
||||
+++ ../tools/bwipp_dump.ps 2020-10-03 01:47:30.454223200 +0100
|
||||
@@ -29,6 +29,8 @@
|
||||
% CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
% IN THE SOFTWARE.
|
||||
@ -9,7 +9,7 @@
|
||||
% --BEGIN TEMPLATE--
|
||||
|
||||
% --BEGIN RESOURCE preamble--
|
||||
@@ -25403,34 +25405,80 @@
|
||||
@@ -25404,34 +25406,80 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -25489,7 +25537,7 @@
|
||||
@@ -25490,7 +25538,7 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
|
||||
% Get the result of encoding with ean8 and gs1-cc
|
||||
options (lintype) (ean8) put
|
||||
@@ -25497,29 +25545,75 @@
|
||||
@@ -25498,29 +25546,75 @@
|
||||
options (dontdraw) true put
|
||||
|
||||
% Plot the linear part
|
||||
@ -214,7 +214,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -25578,34 +25672,80 @@
|
||||
@@ -25579,34 +25673,80 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -314,7 +314,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -25679,34 +25819,80 @@
|
||||
@@ -25680,34 +25820,80 @@
|
||||
/opt options
|
||||
>> def
|
||||
|
||||
@ -414,7 +414,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -25765,7 +25951,7 @@
|
||||
@@ -25766,7 +25952,7 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -423,7 +423,7 @@
|
||||
|
||||
options (lintype) (databaromni) put
|
||||
options (linkage) true put
|
||||
@@ -25776,7 +25962,7 @@
|
||||
@@ -25777,7 +25963,7 @@
|
||||
linear options //databaromni exec
|
||||
dup (sbs) get /linsbs exch def
|
||||
dup (bhs) get 0 get 72 mul /linheight exch def
|
||||
@ -432,7 +432,7 @@
|
||||
|
||||
% Plot the separator
|
||||
/sepfinder {
|
||||
@@ -25807,20 +25993,66 @@
|
||||
@@ -25808,20 +25994,66 @@
|
||||
sep 0 [0 0 0] putinterval
|
||||
sep sep length 4 sub [0 0 0 0] putinterval
|
||||
18 sepfinder 64 sepfinder
|
||||
@ -511,7 +511,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -25878,7 +26110,7 @@
|
||||
@@ -25879,7 +26111,7 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -520,7 +520,7 @@
|
||||
|
||||
options (lintype) (databarstacked) put
|
||||
options (linkage) true put
|
||||
@@ -25889,7 +26121,7 @@
|
||||
@@ -25890,7 +26122,7 @@
|
||||
linear options //databarstacked exec
|
||||
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
||||
dup (pixy) get /linheight exch def
|
||||
@ -529,7 +529,7 @@
|
||||
|
||||
% Plot the separator
|
||||
/sepfinder {
|
||||
@@ -25917,20 +26149,52 @@
|
||||
@@ -25918,20 +26150,52 @@
|
||||
sep 0 [ 0 0 0 0 ] putinterval
|
||||
sep sep length 4 sub [ 0 0 0 0 ] putinterval
|
||||
18 sepfinder
|
||||
@ -594,7 +594,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -25988,7 +26252,7 @@
|
||||
@@ -25989,7 +26253,7 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -603,7 +603,7 @@
|
||||
|
||||
options (lintype) (databarstackedomni) put
|
||||
options (linkage) true put
|
||||
@@ -25999,7 +26263,7 @@
|
||||
@@ -26000,7 +26264,7 @@
|
||||
linear options //databarstackedomni exec
|
||||
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
||||
dup (pixy) get /linheight exch def
|
||||
@ -612,7 +612,7 @@
|
||||
|
||||
% Plot the separator
|
||||
/sepfinder {
|
||||
@@ -26027,20 +26291,52 @@
|
||||
@@ -26028,20 +26292,52 @@
|
||||
sep 0 [ 0 0 0 0 ] putinterval
|
||||
sep sep length 4 sub [ 0 0 0 0 ] putinterval
|
||||
18 sepfinder
|
||||
@ -677,7 +677,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -26213,7 +26509,7 @@
|
||||
@@ -26214,7 +26510,7 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -686,7 +686,7 @@
|
||||
|
||||
options (lintype) (databarlimited) put
|
||||
options (linkage) true put
|
||||
@@ -26224,7 +26520,7 @@
|
||||
@@ -26225,7 +26521,7 @@
|
||||
linear options //databarlimited exec
|
||||
dup (sbs) get /linsbs exch def
|
||||
dup (bhs) get 0 get 72 mul /linheight exch def
|
||||
@ -695,7 +695,7 @@
|
||||
|
||||
% Plot the separator
|
||||
mark
|
||||
@@ -26232,22 +26528,68 @@
|
||||
@@ -26233,22 +26529,68 @@
|
||||
counttomark 1 sub array astore /sep exch def pop pop
|
||||
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
|
||||
@ -778,7 +778,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -26306,7 +26648,7 @@
|
||||
@@ -26307,7 +26649,7 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -787,7 +787,7 @@
|
||||
|
||||
options (lintype) (databarexpanded) put
|
||||
options (linkage) true put
|
||||
@@ -26317,7 +26659,7 @@
|
||||
@@ -26318,7 +26660,7 @@
|
||||
linear options //databarexpanded exec
|
||||
dup (sbs) get /linsbs exch def
|
||||
dup (bhs) get 0 get 72 mul /linheight exch def
|
||||
@ -796,7 +796,7 @@
|
||||
|
||||
% Plot the separator
|
||||
/sepfinder {
|
||||
@@ -26346,20 +26688,60 @@
|
||||
@@ -26347,20 +26689,60 @@
|
||||
18 98 bot length 13 sub {} for
|
||||
69 98 bot length 13 sub {} for
|
||||
] {sepfinder} forall
|
||||
@ -869,7 +869,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -26417,7 +26799,7 @@
|
||||
@@ -26418,7 +26800,7 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -878,7 +878,7 @@
|
||||
|
||||
options (lintype) (databarexpandedstacked) put
|
||||
options (linkage) true put
|
||||
@@ -26428,7 +26810,7 @@
|
||||
@@ -26429,7 +26811,7 @@
|
||||
linear options //databarexpandedstacked exec
|
||||
dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def
|
||||
dup (pixy) get /linheight exch def
|
||||
@ -887,7 +887,7 @@
|
||||
|
||||
% Plot the separator
|
||||
/sepfinder {
|
||||
@@ -26448,27 +26830,55 @@
|
||||
@@ -26449,27 +26831,55 @@
|
||||
} for
|
||||
} bind def
|
||||
/sep [ bot {1 exch sub} forall ] def
|
||||
@ -957,7 +957,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -26527,7 +26937,7 @@
|
||||
@@ -26528,7 +26938,7 @@
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
@ -966,7 +966,7 @@
|
||||
|
||||
options (inkspread) (0) put
|
||||
options (dontdraw) true put
|
||||
@@ -26554,35 +26964,87 @@
|
||||
@@ -26555,35 +26965,87 @@
|
||||
linear << options {} forall >> //gs1-128 exec
|
||||
dup (sbs) get /linsbs exch def
|
||||
dup (bhs) get 0 get 72 mul /linheight exch def
|
||||
@ -1068,7 +1068,7 @@
|
||||
|
||||
end
|
||||
|
||||
@@ -27880,3 +28342,176 @@
|
||||
@@ -27881,3 +28343,176 @@
|
||||
% --END ENCODER hibcazteccode--
|
||||
|
||||
% --END TEMPLATE--
|
||||
|
Binary file not shown.
@ -48,7 +48,7 @@ extern "C" {
|
||||
float width; /* Suggested string width, may be 0 if none recommended */
|
||||
int length;
|
||||
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;
|
||||
struct zint_vector_string *next; /* Pointer to next character */
|
||||
};
|
||||
|
@ -189,7 +189,7 @@ static char *s_code_list[] = {
|
||||
"UPC-A+Check",
|
||||
"UPC-E",
|
||||
"UPC-E+Check",
|
||||
"Postnet",
|
||||
"POSTNET",
|
||||
"MSIPlessey",
|
||||
"FIM",
|
||||
"Logmars",
|
||||
@ -217,7 +217,7 @@ static char *s_code_list[] = {
|
||||
"GS1DataBarStacked",
|
||||
"GS1DataBarSstackedOmni",
|
||||
"GS1DataBarExpandedStacked",
|
||||
"Planet",
|
||||
"PLANET",
|
||||
"DPDCode",
|
||||
"MicroPDF417",
|
||||
"USPSIntelligentMail",
|
||||
|
@ -284,7 +284,7 @@ Numeric Value | Barcode Name
|
||||
35 | UPC-A + Check Digit
|
||||
37 | UPC-E
|
||||
38 | UPC-E + Check Digit
|
||||
40 | PostNet
|
||||
40 | POSTNET
|
||||
47 | MSI Plessey
|
||||
49 | FIM
|
||||
50 | LOGMARS
|
||||
@ -1081,7 +1081,7 @@ Value |
|
||||
35 | BARCODE_UPCA_CHK | UPC-A + Check Digit
|
||||
37 | BARCODE_UPCE | UPC-E
|
||||
38 | BARCODE_UPCE_CHK | UPC-E + Check Digit
|
||||
40 | BARCODE_POSTNET | PostNet
|
||||
40 | BARCODE_POSTNET | POSTNET
|
||||
47 | BARCODE_MSI_PLESSEY | MSI Plessey
|
||||
49 | BARCODE_FIM | FIM
|
||||
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
|
||||
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
|
||||
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
|
||||
--------------------------
|
||||
It is sometimes advantageous to stop Code 128 from using subset mode C which
|
||||
compresses numerical data. The BARCODE_CODE128B option (symbology 60)
|
||||
suppresses mode C in favour of mode B.
|
||||
compresses numerical data. The BARCODE_CODE128B option (symbology 60) suppresses
|
||||
mode C in favour of mode B.
|
||||
|
||||
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
|
||||
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 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
|
||||
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
|
||||
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
|
||||
input), PostNet10 (5 digit ZIP + 4 digit user data) and PostNet12 (5 digit ZIP
|
||||
+ 6 digit user data).
|
||||
@ -1987,7 +1987,7 @@ the input data.
|
||||
6.5.5 USPS Intelligent Mail
|
||||
---------------------------
|
||||
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
|
||||
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
|
||||
@ -2661,7 +2661,7 @@ generated using the characters A-D as shown in the table below.
|
||||
Code Letter | Usage
|
||||
----------------------------------------------------------------------------
|
||||
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.
|
||||
C | Used for business reply mail with a pre-printed zip code.
|
||||
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
|
||||
|
||||
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)
|
||||
|
||||
v2.0 - Made corrections to Aztec Code and tested output with bcTester. Added
|
||||
|
@ -63,11 +63,11 @@ static void types(void) {
|
||||
"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"
|
||||
"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"
|
||||
"37: UPC-E 85: USPS Intelligent Mail 140: Channel Code\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"
|
||||
"49: FIM 90: KIX Code 144: Ultracode\n"
|
||||
"50: Logmars 92: Aztec Code 145: rMQR\n"
|
||||
|
@ -4,6 +4,7 @@
|
||||
# vim: set ts=4 sw=4 et :
|
||||
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
project(zint_frontend_tests)
|
||||
|
||||
enable_testing()
|
||||
|
||||
@ -15,14 +16,31 @@ set(ZINT_SANITIZE FALSE CACHE BOOL "Set sanitize compile/link flags")
|
||||
find_package(LibZint REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
if(ZINT_DEBUG)
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
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")
|
||||
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=address")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address")
|
||||
link_libraries("-fsanitize=undefined -fsanitize=address")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -161,7 +161,6 @@ static void test_dump_args(int index, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int b;
|
||||
char *data;
|
||||
@ -280,7 +279,6 @@ static void test_input(int index, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int b;
|
||||
int batch;
|
||||
@ -351,7 +349,6 @@ static void test_batch_input(int index, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int b;
|
||||
char *data;
|
||||
@ -410,7 +407,6 @@ static void test_batch_large(int index, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int b;
|
||||
int mirror;
|
||||
@ -469,7 +465,6 @@ static void test_checks(int index, int debug) {
|
||||
|
||||
testStart("");
|
||||
|
||||
int ret;
|
||||
struct item {
|
||||
int addongap;
|
||||
int border;
|
||||
|
@ -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_UI(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui)
|
||||
# grpAztec.ui grpC49.ui grpDBExtend.ui grpLOGMARS.ui grpPDF417.ui grpUPCA.ui
|
||||
# grpC11.ui grpChannel.ui grpDM.ui grpMaxicode.ui grpPZN.ui grpUPCEAN.ui
|
||||
# grpC128.ui grpCodabar.ui grpDotCode.ui grpMicroPDF.ui grpQR.ui grpVIN.ui
|
||||
# grpC16k.ui grpCodablockF.ui grpGrid.ui grpMQR.ui grpRMQR.ui
|
||||
# grpC39.ui grpCodeOne.ui grpHX.ui grpMSICheck.ui grpUltra.ui
|
||||
# grpAztec.ui grpC49.ui grpDBExtend.ui grpLOGMARS.ui grpPDF417.ui grpUPCEAN.ui
|
||||
# grpC11.ui grpChannel.ui grpDM.ui grpMaxicode.ui grpQR.ui grpVIN.ui
|
||||
# grpC128.ui grpCodabar.ui grpDotCode.ui grpMicroPDF.ui grpRMQR.ui
|
||||
# grpC16k.ui grpCodablockF.ui grpGrid.ui grpMQR.ui grpUltra.ui
|
||||
# grpC39.ui grpCodeOne.ui grpHX.ui grpMSICheck.ui grpUPCA.ui
|
||||
|
||||
QT5_ADD_RESOURCES(zint-qt_SRCS resources.qrc)
|
||||
|
||||
|
@ -24,7 +24,14 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Data</string>
|
||||
<string>&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>
|
||||
</widget>
|
||||
</item>
|
||||
@ -46,14 +53,34 @@
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnFromFile">
|
||||
<property name="text">
|
||||
<string>From File...</string>
|
||||
<string>&From File...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Get input data from a file. Certain characters <br/>will be converted to escape sequences
|
||||
<table cellpadding="3">
|
||||
<tr><td>End of Transmission (0x04)</td><td>\E</td></tr>
|
||||
<tr><td>Bell (0x07)</td><td>\a</td></tr>
|
||||
<tr><td>Backspace (0x08)</td><td>\b</td></tr>
|
||||
<tr><td>Horizontal Tab (0x09)</td><td>\t</td></tr>
|
||||
<tr><td>Vertical Tab (0x0B)</td><td>\v</td></tr>
|
||||
<tr><td>Form Feed (0x0C)</td><td>\f</td></tr>
|
||||
<tr><td>Carriage Return (0x0D)</td><td>\r</td></tr>
|
||||
<tr><td>Escape (0x1B)</td><td>\e</td></tr>
|
||||
<tr><td>Group Selector (0x1D)</td><td>\G</td></tr>
|
||||
<tr><td>Record Selector (0x1E)</td><td>\R</td></tr>
|
||||
<tr><td>Backslash (0x5C)</td><td>\\</td></tr>
|
||||
</table>
|
||||
Note that newlines (Line Feed (0x0A)) are <br/>not included</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnReset">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
<string>&Reset</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Clear data window</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -73,14 +100,20 @@
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnOK">
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Close window and update input data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCancel">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
<string>&Cancel</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Close window without updating input data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -74,7 +74,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Sat the naming convention used by the files</string>
|
||||
<string>Set the naming convention used by the files</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
@ -153,7 +153,7 @@
|
||||
<string>Find a destination for your files</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
<string>&...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
@ -166,7 +166,13 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Destination Path:</string>
|
||||
<string>&Destination Path:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Destination folder</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>linDestPath</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
@ -179,7 +185,13 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Name Prefix:</string>
|
||||
<string>File Name &Prefix:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>The first part of the filenames</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>linPrefix</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
@ -192,7 +204,13 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Name:</string>
|
||||
<string>File &Name:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set the naming convention used by the files</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbFileName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
@ -205,7 +223,13 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Format:</string>
|
||||
<string>File &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>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btnCancel">
|
||||
@ -218,7 +242,10 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Close window</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btnOK">
|
||||
@ -231,23 +258,26 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Export</string>
|
||||
<string>&Export</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create files</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="txtFeedback">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<x>10</x>
|
||||
<y>180</y>
|
||||
<width>441</width>
|
||||
<height>321</height>
|
||||
<width>430</width>
|
||||
<height>315</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="lblFeedback">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<x>10</x>
|
||||
<y>160</y>
|
||||
<width>101</width>
|
||||
<height>17</height>
|
||||
|
@ -42,28 +42,57 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Start Value:</string>
|
||||
<string>&Start Value:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>linStartVal</cstring>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Start sequence at this value</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>End Value:</string>
|
||||
<string>End &Value:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>linEndVal</cstring>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>End sequence at this value</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblIncrement">
|
||||
<property name="text">
|
||||
<string>Increment By:</string>
|
||||
<string>Increment &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>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Format:</string>
|
||||
<string>&Format:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>linFormat</cstring>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Format sequence using special characters<table cellpadding="3">
|
||||
<tr><td>#</td><td>Number or space</td></tr>
|
||||
<tr><td>$</td><td>Number or '0'</td></tr>
|
||||
<tr><td>*</td><td>Number or '*'</td></tr>
|
||||
<tr><td>Other</td><td>Insert literally</td></tr>
|
||||
</table></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -72,6 +101,9 @@
|
||||
<property name="text">
|
||||
<string>Sequence:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create a data sequence</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -79,13 +111,22 @@
|
||||
<property name="text">
|
||||
<string>Sequence File:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Get a data sequence from a file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<widget class="QLabel" name="lblExport">
|
||||
<property name="text">
|
||||
<string>Generate Bar Codes:</string>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save the symbols to files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -100,6 +141,9 @@
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Start sequence at this value</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -107,6 +151,9 @@
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>End sequence at this value</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -114,6 +161,9 @@
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Go from start to end in steps of this amount</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -121,6 +171,14 @@
|
||||
<property name="text">
|
||||
<string>$$$$$$</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Format sequence using special characters<table cellpadding="3">
|
||||
<tr><td>#</td><td>Number or space</td></tr>
|
||||
<tr><td>$</td><td>Number or '0'</td></tr>
|
||||
<tr><td>*</td><td>Number or '*'</td></tr>
|
||||
<tr><td>Other</td><td>Insert literally</td></tr>
|
||||
</table></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -129,17 +187,17 @@
|
||||
<string>Create a data sequence</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create</string>
|
||||
<string>Crea&te</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnImport">
|
||||
<property name="toolTip">
|
||||
<string>Get a data sequence from file</string>
|
||||
<string>Get a data sequence from a file</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Import...</string>
|
||||
<string>&Import...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -149,10 +207,10 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save the symbols to file</string>
|
||||
<string>Save the symbols to files</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Export...</string>
|
||||
<string>&Export...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -172,7 +230,10 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Sequence Preview</string>
|
||||
<string>Sequence &Data</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>The data to be encoded, one line per symbol</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
@ -212,14 +273,20 @@
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnReset">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
<string>&Reset</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Clear the sequence data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClose">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Close window</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radAztecAuto">
|
||||
<property name="text">
|
||||
<string>Automatic Resizing</string>
|
||||
<string>Auto&matic Resizing</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -35,7 +35,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radAztecSize">
|
||||
<property name="text">
|
||||
<string>Adjust Size To:</string>
|
||||
<string>Adjust Si&ze To:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -229,7 +229,7 @@
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="radAztecECC">
|
||||
<property name="text">
|
||||
<string>Add Minimum Error Correction:</string>
|
||||
<string>Add Minimum E&rror Correction:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -274,7 +274,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radAztecStand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -284,14 +284,14 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radAztecGS1">
|
||||
<property name="text">
|
||||
<string>GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radAztecHIBC">
|
||||
<property name="text">
|
||||
<string>HIBC Aztec Code</string>
|
||||
<string>H&IBC Aztec Code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radC11TwoCheckDigits">
|
||||
<property name="text">
|
||||
<string>Two (Mod-11)</string>
|
||||
<string>&Two (Mod-11)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -39,14 +39,14 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radC11OneCheckDigit">
|
||||
<property name="text">
|
||||
<string>One (Mod-11)</string>
|
||||
<string>&One (Mod-11)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radC11NoCheckDigits">
|
||||
<property name="text">
|
||||
<string>No Check Digit</string>
|
||||
<string>&No Check Digit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -32,7 +32,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radC128Stand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -42,21 +42,21 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radC128CSup">
|
||||
<property name="text">
|
||||
<string>Subset C Supression</string>
|
||||
<string>Subset &C Suppression</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radC128EAN">
|
||||
<property name="text">
|
||||
<string>GS1-128</string>
|
||||
<string>GS&1-128</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QRadioButton" name="radC128HIBC">
|
||||
<property name="text">
|
||||
<string>HIBC 128</string>
|
||||
<string>H&IBC 128</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelRowSeparatorHeight">
|
||||
<property name="text">
|
||||
<string>Row Separator Height:</string>
|
||||
<string>&Row Separator Height:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbC16kRowSepHeight</cstring>
|
||||
@ -70,7 +70,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radC16kStand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -80,7 +80,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radC16kGS1">
|
||||
<property name="text">
|
||||
<string>GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radC39Stand">
|
||||
<property name="text">
|
||||
<string>No Check Digit</string>
|
||||
<string>&No Check Digit</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -35,14 +35,14 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radC39HIBC">
|
||||
<property name="text">
|
||||
<string>HIBC 39</string>
|
||||
<string>H&IBC 39</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radC39Check">
|
||||
<property name="text">
|
||||
<string>Mod-43 Check Digit</string>
|
||||
<string>&Mod-43 Check Digit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelRowSeparatorHeight">
|
||||
<property name="text">
|
||||
<string>Row Separator Height:</string>
|
||||
<string>&Row Separator Height:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbC49RowSepHeight</cstring>
|
||||
@ -70,7 +70,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radC49Stand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -80,7 +80,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radC49GS1">
|
||||
<property name="text">
|
||||
<string>GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkCodabarCheck">
|
||||
<property name="text">
|
||||
<string>Add Check Character (Mod-16)</string>
|
||||
<string>Add &Check Character (Mod-16)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelWidth">
|
||||
<property name="text">
|
||||
<string>Symbol Width (Columns):</string>
|
||||
<string>Symbol &Width (Columns):</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbCbfWidth</cstring>
|
||||
@ -342,7 +342,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelHeight">
|
||||
<property name="text">
|
||||
<string>Symbol Height (Rows):</string>
|
||||
<string>Symbol &Height (Rows):</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbCbfHeight</cstring>
|
||||
@ -584,7 +584,7 @@
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelRowSeparatorHeight">
|
||||
<property name="text">
|
||||
<string>Row Separator Height:</string>
|
||||
<string>&Row Separator Height:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbCbfRowSepHeight</cstring>
|
||||
@ -629,7 +629,7 @@
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radCbfStand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -639,7 +639,7 @@
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radCbfHIBC">
|
||||
<property name="text">
|
||||
<string>HIBC Codablock-F</string>
|
||||
<string>H&IBC Codablock-F</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblChannel">
|
||||
<property name="text">
|
||||
<string>Symbol Size:</string>
|
||||
<string>Symbol Si&ze:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
@ -108,7 +108,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radC1Stand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -118,7 +118,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radC1GS1">
|
||||
<property name="text">
|
||||
<string>GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblDM200Size">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
<string>Si&ze:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbDM200Size</cstring>
|
||||
@ -298,7 +298,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radDM200Stand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -308,14 +308,14 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radDM200GS1">
|
||||
<property name="text">
|
||||
<string>GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radDM200HIBC">
|
||||
<property name="text">
|
||||
<string>HIBC Data Matrix</string>
|
||||
<string>H&IBC Data Matrix</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -325,7 +325,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkDMRectangle">
|
||||
<property name="text">
|
||||
<string>Suppress Rectangular Symbols in Automatic Mode</string>
|
||||
<string>Suppress &Rectangular Symbols in Automatic Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -335,7 +335,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkDMRE">
|
||||
<property name="text">
|
||||
<string>Allow DMRE in Automatic Mode</string>
|
||||
<string>Allo&w DMRE in Automatic Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
@ -345,7 +345,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkDMGSSep">
|
||||
<property name="text">
|
||||
<string>Use separator GS for GS1</string>
|
||||
<string>&Use separator GS for GS1</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
@ -321,7 +321,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radDotGS1">
|
||||
<property name="text">
|
||||
<string>&GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelGridSize">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
<string>Si&ze:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbGridSize</cstring>
|
||||
@ -109,7 +109,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelGridECC">
|
||||
<property name="text">
|
||||
<string>Error Correction:</string>
|
||||
<string>E&rror Correction:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbGridECC</cstring>
|
||||
@ -182,7 +182,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkGridFullMultibyte">
|
||||
<property name="text">
|
||||
<string>Full Multibyte</string>
|
||||
<string>&Full Multibyte</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelHXSize">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
<string>Si&ze:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbHXSize</cstring>
|
||||
@ -467,7 +467,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelHXECC">
|
||||
<property name="text">
|
||||
<string>Error Correction:</string>
|
||||
<string>E&rror Correction:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbHXECC</cstring>
|
||||
@ -508,7 +508,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkHXFullMultibyte">
|
||||
<property name="text">
|
||||
<string>Full Multibyte</string>
|
||||
<string>&Full Multibyte</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radLOGMARSStand">
|
||||
<property name="text">
|
||||
<string>No Check Digit</string>
|
||||
<string>&No Check Digit</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -39,7 +39,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radLOGMARSCheck">
|
||||
<property name="text">
|
||||
<string>One (Mod-43)</string>
|
||||
<string>&One (Mod-43)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -24,7 +24,7 @@
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="lavelMQRSize" >
|
||||
<property name="text" >
|
||||
<string>Size:</string>
|
||||
<string>Si&ze:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbMQRSize</cstring>
|
||||
@ -63,7 +63,7 @@
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="labelMQRECC" >
|
||||
<property name="text" >
|
||||
<string>Error Correction:</string>
|
||||
<string>E&rror Correction:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbMQRECC</cstring>
|
||||
@ -99,7 +99,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkMQRFullMultibyte">
|
||||
<property name="text">
|
||||
<string>Full Multibyte</string>
|
||||
<string>&Full Multibyte</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
@ -41,7 +41,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Primary Message:</string>
|
||||
<string>P&rimary Message:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
|
@ -78,7 +78,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radMPDFStand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -88,7 +88,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radMPDFHIBC">
|
||||
<property name="text">
|
||||
<string>HIBC MicroPDF417</string>
|
||||
<string>H&IBC MicroPDF417</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -146,7 +146,7 @@
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="lblPDFECC" >
|
||||
<property name="text" >
|
||||
<string>&Error Correction Capacity:</string>
|
||||
<string>E&rror Correction Capacity:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
@ -224,7 +224,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radPDFStand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -234,7 +234,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radPDFHIBC">
|
||||
<property name="text">
|
||||
<string>HIBC PDF417</string>
|
||||
<string>H&IBC PDF417</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelQRSize">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
<string>Si&ze:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbQRSize</cstring>
|
||||
@ -247,7 +247,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelQRECC">
|
||||
<property name="text">
|
||||
<string>Error Correction:</string>
|
||||
<string>E&rror Correction:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbQRECC</cstring>
|
||||
@ -297,7 +297,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radQRStand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -307,14 +307,14 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radQRGS1">
|
||||
<property name="text">
|
||||
<string>GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radQRHIBC">
|
||||
<property name="text">
|
||||
<string>HIBC QR Code</string>
|
||||
<string>H&IBC QR Code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -324,7 +324,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkQRFullMultibyte">
|
||||
<property name="text">
|
||||
<string>Full Multibyte</string>
|
||||
<string>&Full Multibyte</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelRMQRSize">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
<string>Si&ze:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbRMQRSize</cstring>
|
||||
@ -237,7 +237,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelRMQRECC">
|
||||
<property name="text">
|
||||
<string>Error Correction:</string>
|
||||
<string>E&rror Correction:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbRMQRECC</cstring>
|
||||
@ -277,7 +277,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radRMQRStand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -287,7 +287,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radRMQRGS1">
|
||||
<property name="text">
|
||||
<string>GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -297,7 +297,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkRMQRFullMultibyte">
|
||||
<property name="text">
|
||||
<string>Full Multibyte</string>
|
||||
<string>&Full Multibyte</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="lblUPCAAddonGap">
|
||||
<property name="text">
|
||||
<string>&Add-on Gap:</string>
|
||||
<string>A&dd-on Gap:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="lblUPCEANAddonGap">
|
||||
<property name="text">
|
||||
<string>&Add-on Gap:</string>
|
||||
<string>A&dd-on Gap:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
|
@ -25,13 +25,20 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radUltraAuto">
|
||||
<property name="text">
|
||||
<string>A&utomatic Resizing</string>
|
||||
<string>Auto&matic Resizing</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radUltraEcc">
|
||||
<property name="text">
|
||||
<string>E&rror Correction Level:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="cmbUltraEcc">
|
||||
<property name="enabled">
|
||||
@ -72,13 +79,6 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radUltraEcc">
|
||||
<property name="text">
|
||||
<string>Error Correction Level:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@ -93,7 +93,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radUltraStand">
|
||||
<property name="text">
|
||||
<string>Standard Mode</string>
|
||||
<string>S&tandard Mode</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -103,7 +103,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="radUltraGS1">
|
||||
<property name="text">
|
||||
<string>GS1 Data Mode</string>
|
||||
<string>GS&1 Data Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="chkVINImportChar">
|
||||
<property name="text">
|
||||
<string>Import Character Prefix</string>
|
||||
<string>&Import Character Prefix</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
@ -129,7 +129,7 @@
|
||||
</property>
|
||||
<widget class="QWidget" name="tabGeneral">
|
||||
<attribute name="title">
|
||||
<string>General</string>
|
||||
<string>&General</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
@ -167,7 +167,7 @@
|
||||
or import from file</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
<string>&...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -301,7 +301,7 @@ or import from file</string>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&2D Component Data:</string>
|
||||
<string>2D &Component Data:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>txtComposite</cstring>
|
||||
@ -540,22 +540,23 @@ p, li { white-space: pre-wrap; }
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkEscape">
|
||||
<property name="toolTip">
|
||||
<string>Process escape sequences in input data
|
||||
\0 - NUL character (0x00)
|
||||
\E - End of Transmission (0x04)
|
||||
\a - Bell (0x07)
|
||||
\b - Backspace (0x08)
|
||||
\t - Horizontal Tab (0x09)
|
||||
\n - Line Feed (0x0A)
|
||||
\v - Vertical Tab (0x0B)
|
||||
\f - Form Feed (0x0C)
|
||||
\r - Carriage Return (0x0D)
|
||||
\e - Escape (0x1B)
|
||||
\G - Group Selector (0x1D)
|
||||
\R - Record Selector (0x1E)
|
||||
\\ - Backslash (0x5C)
|
||||
\xNN - 8-bit character (N hex)
|
||||
\uNNNN - 16-bit Unicode (N hex)</string>
|
||||
<string>Process escape sequences in input data<table cellpadding="3">
|
||||
<tr><td>\0</td><td>NUL character (0x00)</td></tr>
|
||||
<tr><td>\E</td><td>End of Transmission (0x04)</td></tr>
|
||||
<tr><td>\a</td><td>Bell (0x07)</td></tr>
|
||||
<tr><td>\b</td><td>Backspace (0x08)</td></tr>
|
||||
<tr><td>\t</td><td>Horizontal Tab (0x09)</td></tr>
|
||||
<tr><td>\n</td><td>Line Feed (0x0A)</td></tr>
|
||||
<tr><td>\v</td><td>Vertical Tab (0x0B)</td></tr>
|
||||
<tr><td>\f</td><td>Form Feed (0x0C)</td></tr>
|
||||
<tr><td>\r</td><td>Carriage Return (0x0D)</td></tr>
|
||||
<tr><td>\e</td><td>Escape (0x1B)</td></tr>
|
||||
<tr><td>\G</td><td>Group Selector (0x1D)</td></tr>
|
||||
<tr><td>\R</td><td>Record Selector (0x1E)</td></tr>
|
||||
<tr><td>\\</td><td>Backslash (0x5C)</td></tr>
|
||||
<tr><td>\xNN</td><td>8-bit character (N hex)</td></tr>
|
||||
<tr><td>\uNNNN</td><td>16-bit Unicode (N hex)</td></tr>
|
||||
</table></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Parse Escapes</string>
|
||||
@ -605,7 +606,7 @@ p, li { white-space: pre-wrap; }
|
||||
</size>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Appearance</string>
|
||||
<string>A&ppearance</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
@ -773,7 +774,7 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lblScale">
|
||||
<property name="text">
|
||||
<string>&Printing Scale:</string>
|
||||
<string>Printing Sca&le:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
@ -874,7 +875,7 @@ p, li { white-space: pre-wrap; }
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Colour: </string>
|
||||
<string>Colour:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -1003,7 +1004,7 @@ p, li { white-space: pre-wrap; }
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Dot Size:</string>
|
||||
<string>Dot S&ize:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -1123,13 +1124,6 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>tabMain</tabstop>
|
||||
<tabstop>txtData</tabstop>
|
||||
<tabstop>chkComposite</tabstop>
|
||||
<tabstop>cmbCompType</tabstop>
|
||||
<tabstop>txtComposite</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
</resources>
|
||||
|
@ -52,27 +52,27 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
||||
"Australia Post Reply-Paid",
|
||||
"Australia Post Routing Code",
|
||||
"Australia Post Standard Customer",
|
||||
"Aztec Code (ISO 24778)",
|
||||
"Aztec Code (ISO 24778) (and HIBC)",
|
||||
"Aztec Runes",
|
||||
"Channel Code",
|
||||
"Codabar",
|
||||
"Codablock-F",
|
||||
"Codablock-F (and HIBC)",
|
||||
"Code 11",
|
||||
"Code 128 (ISO 15417)",
|
||||
"Code 128 (ISO 15417) (and GS1-128 and HIBC)",
|
||||
"Code 16k",
|
||||
"Code 2 of 5 Data Logic",
|
||||
"Code 2 of 5 IATA",
|
||||
"Code 2 of 5 Industrial",
|
||||
"Code 2 of 5 Interleaved",
|
||||
"Code 2 of 5 Standard",
|
||||
"Code 2 of 5 Standard (Matrix)",
|
||||
"Code 32 (Italian Pharmacode)",
|
||||
"Code 39 (ISO 16388)",
|
||||
"Code 39 (ISO 16388) (and HIBC)",
|
||||
"Code 39 Extended",
|
||||
"Code 49",
|
||||
"Code 93",
|
||||
"Code One",
|
||||
"DAFT Code",
|
||||
"Data Matrix (ISO 16022)",
|
||||
"Data Matrix (ISO 16022) (and HIBC)",
|
||||
"Deutsche Post Identcode",
|
||||
"Deutsche Post Leitcode",
|
||||
"DotCode",
|
||||
@ -96,17 +96,17 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
|
||||
"Korean Postal Barcode",
|
||||
"LOGMARS",
|
||||
"Maxicode (ISO 16023)",
|
||||
"MicroPDF417 (ISO 24728)",
|
||||
"MicroPDF417 (ISO 24728) (and HIBC)",
|
||||
"Micro QR Code",
|
||||
"MSI Plessey",
|
||||
"NVE-18 (SSCC-18)",
|
||||
"PDF417 (ISO 15438)",
|
||||
"PDF417 (ISO 15438) (and Compact and HIBC)",
|
||||
"Pharmacode",
|
||||
"Pharmacode 2-track",
|
||||
"Pharma Zentralnummer (PZN)",
|
||||
"PLANET",
|
||||
"Postnet",
|
||||
"QR Code (ISO 18004)",
|
||||
"POSTNET",
|
||||
"QR Code (ISO 18004) (and HIBC)",
|
||||
"Rectangular Micro QR (rMQR)",
|
||||
"Royal Mail 4-state Barcode",
|
||||
"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()));
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
@ -582,7 +582,7 @@ void MainWindow::change_options()
|
||||
if (tabMain->count()==3)
|
||||
tabMain->removeTab(1);
|
||||
|
||||
chkComposite->setText(tr("Add 2D Component"));
|
||||
chkComposite->setText(tr("Add &2D Component"));
|
||||
btype->setItemText(0, tr("No border"));
|
||||
combobox_item_enabled(cmbFontSetting, 1, true);
|
||||
cmbFontSetting->setItemText(2, tr("Small"));
|
||||
@ -594,8 +594,8 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
file.close();
|
||||
tabMain->insertTab(1,m_optionWidget,tr("Code 128"));
|
||||
chkComposite->setText(tr("Add 2D Component (GS1-128 only)"));
|
||||
tabMain->insertTab(1,m_optionWidget,tr("Cod&e 128"));
|
||||
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*>("radC128Stand"), 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;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("cmbPDFCols"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(m_optionWidget->findChild<QObject*>("radPDFTruncated"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||
@ -626,7 +626,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("radMPDFStand"), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||
}
|
||||
@ -638,7 +638,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("radDotStand"), 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;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("radAztecSize"), 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;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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()));
|
||||
}
|
||||
|
||||
@ -680,7 +680,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("radC11OneCheckDigit"), 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()));
|
||||
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)
|
||||
{
|
||||
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setChecked(false);
|
||||
@ -707,7 +707,7 @@ void MainWindow::change_options()
|
||||
m_optionWidget->findChild<QRadioButton*>("radC39HIBC")->setEnabled(false);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -731,7 +731,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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)"));
|
||||
connect(m_optionWidget->findChild<QObject*>("cmbC16kRowSepHeight"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(m_optionWidget->findChild<QObject*>("radC16kStand"), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||
@ -755,7 +755,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
file.close();
|
||||
tabMain->insertTab(1,m_optionWidget,tr("Codablock-F"));
|
||||
tabMain->insertTab(1,m_optionWidget,tr("Codablock&-F"));
|
||||
btype->setItemText(0, tr("Default (bind)"));
|
||||
connect(m_optionWidget->findChild<QObject*>("cmbCbfWidth"), 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;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("cmbQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(m_optionWidget->findChild<QObject*>("radQRStand"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||
@ -809,7 +809,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("cmbRMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(m_optionWidget->findChild<QObject*>("radRMQRStand"), SIGNAL(clicked( bool )), SLOT(update_preview()));
|
||||
@ -824,7 +824,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("cmbHXECC"), SIGNAL(currentIndexChanged( 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;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("cmbMQRECC"), SIGNAL(currentIndexChanged( 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;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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(maxi_primary()));
|
||||
connect(m_optionWidget->findChild<QObject*>("txtMaxiPrimary"), SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
|
||||
@ -876,7 +876,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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()));
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("radC1GS1"), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||
}
|
||||
@ -899,7 +899,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("radC49GS1"), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||
}
|
||||
@ -911,7 +911,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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()));
|
||||
}
|
||||
|
||||
@ -922,7 +922,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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*>("radUltraEcc"), SIGNAL(clicked( bool )), 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);
|
||||
file.close();
|
||||
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) {
|
||||
tabMain->insertTab(1, m_optionWidget, tr("ISBN"));
|
||||
} else {
|
||||
tabMain->insertTab(1, m_optionWidget, tr("EAN"));
|
||||
tabMain->insertTab(1, m_optionWidget, tr("&EAN"));
|
||||
}
|
||||
combobox_item_enabled(cmbFontSetting, 1, false);
|
||||
if (cmbFontSetting->currentIndex() == 1) {
|
||||
@ -977,7 +977,7 @@ void MainWindow::change_options()
|
||||
return;
|
||||
m_optionWidget=uiload.load(&file);
|
||||
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()));
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,7 @@
|
||||
#include "ui_mainWindow.h"
|
||||
#include "barcodeitem.h"
|
||||
|
||||
class QAction;
|
||||
class QActionGroup;
|
||||
class QLabel;
|
||||
class QMenu;
|
||||
|
||||
class MainWindow : public QWidget, private Ui::mainWindow
|
||||
{
|
||||
@ -138,8 +135,6 @@ protected:
|
||||
void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled);
|
||||
void upcean_addon_gap(QComboBox *comboBox, QLabel *label, int base);
|
||||
void set_gs1_mode(bool gs1_mode);
|
||||
bool fixed_height();
|
||||
bool no_hrt();
|
||||
const char *get_setting_name(int symbology);
|
||||
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);
|
||||
|
@ -158,8 +158,10 @@ void SequenceWindow::check_generate()
|
||||
preview_copy = txtPreview->toPlainText();
|
||||
if(preview_copy.isEmpty()) {
|
||||
btnExport->setEnabled(false);
|
||||
lblExport->setEnabled(false);
|
||||
} else {
|
||||
btnExport->setEnabled(true);
|
||||
lblExport->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user