mirror of https://github.com/nirenjan/libx52.git
fix: Add support for Automake tests
In order to continue to support Automake builds, we need to update the source to comply with C90 standards, as well as ignoring the warnings in the test binary.fix-issue-63
parent
0cb137bbe0
commit
569902be76
|
|
@ -20,33 +20,25 @@ x52include_HEADERS += libx52util/libx52util.h
|
|||
pkgconfig_DATA += libx52util/libx52util.pc
|
||||
|
||||
# Autogenerated file that needs to be cleaned up
|
||||
CLEANFILES += libx52util/util_char_map.c
|
||||
char_map_TARGETS = \
|
||||
libx52util/util_char_map.c \
|
||||
libx52util/x52_char_map.bin
|
||||
|
||||
util_char_map_c_DEPENDS = \
|
||||
CLEANFILES += $(char_map_TARGETS)
|
||||
|
||||
char_map_DEPENDS = \
|
||||
$(srcdir)/libx52util/x52_char_map_gen.py \
|
||||
$(srcdir)/libx52util/x52_char_map.cfg
|
||||
|
||||
libx52util/util_char_map.c: $(util_char_map_c_DEPENDS)
|
||||
$(AM_V_GEN) $(PYTHON) $(util_char_map_c_DEPENDS) $@
|
||||
$(char_map_TARGETS): $(char_map_DEPENDS)
|
||||
$(AM_V_GEN) $(PYTHON) $(char_map_DEPENDS) $(char_map_TARGETS)
|
||||
|
||||
if HAVE_CMOCKA
|
||||
TESTS += libx52util-map-test
|
||||
TESTS += libx52util/test-runner.sh
|
||||
|
||||
check_PROGRAMS += libx52util-map-test
|
||||
|
||||
CLEANFILES += libx52util/x52_map_test.c
|
||||
x52_map_test_c_DEPENDS = \
|
||||
$(srcdir)/libx52util/x52_map_test_gen.py \
|
||||
$(srcdir)/libx52util/x52_char_map.cfg
|
||||
|
||||
libx52util/x52_map_test.c: $(x52_map_test_c_DEPENDS)
|
||||
$(AM_V_GEN) $(PYTHON) $(x52_map_test_c_DEPENDS) $@
|
||||
|
||||
libx52util_map_test_SOURCES = libx52util/x52_map_test.c
|
||||
libx52util_map_test_CFLAGS = @CMOCKA_CFLAGS@ -I $(top_srcdir) -I $(top_srcdir)/libx52util
|
||||
libx52util_map_test_LDFLAGS = @CMOCKA_LIBS@
|
||||
libx52util_map_test_LDADD = libx52util.la
|
||||
endif
|
||||
check_PROGRAMS += libx52util-bmp-test
|
||||
libx52util_bmp_test_SOURCES = libx52util/x52_char_map_test.c
|
||||
libx52util_bmp_test_CFLAGS = -I $(top_srcdir)/libx52util
|
||||
libx52util_bmp_test_LDADD = libx52util.la
|
||||
|
||||
# Extra files that need to be in the distribution
|
||||
EXTRA_DIST += libx52util/x52_char_map.cfg \
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
TEST_RUNNER="./libx52util-bmp-test"
|
||||
TEST_BIN="./libx52util/x52_char_map.bin"
|
||||
|
||||
if [ -e "${TEST_RUNNER}" ] && [ -e "${TEST_BIN}" ];
|
||||
then
|
||||
"${TEST_RUNNER}" "${TEST_BIN}"
|
||||
else
|
||||
echo "TAP version 13"
|
||||
echo "1..0 # missing files"
|
||||
fi
|
||||
|
|
@ -27,9 +27,10 @@
|
|||
*/
|
||||
static int utf8_to_u32(const uint8_t *utf8in, uint32_t *unichr)
|
||||
{
|
||||
uint8_t b;
|
||||
if (!utf8in || !*utf8in) return 0;
|
||||
|
||||
uint8_t b = utf8in[0];
|
||||
b = utf8in[0];
|
||||
|
||||
// 1-byte (0xxxxxxx)
|
||||
if (b < 0x80) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue