From aaf631e76df1e1a730b6a0ffb0d62b3ba661643e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 8 Jan 2023 11:11:55 +0100 Subject: Move test-todos into .c-files and add empty test functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 7 +------ libfonts.h | 3 --- libfonts_decode_font_description.c | 15 +++++++++++++++ libfonts_encode_font_description.c | 15 +++++++++++++++ libfonts_get_output_dpi.c | 14 ++++++++++++++ 5 files changed, 45 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 86e2ab9..1724961 100644 --- a/Makefile +++ b/Makefile @@ -25,17 +25,12 @@ OBJ =\ libfonts_get_subpixel_order_class.o\ libfonts_unget_subpixel_order_class.o -TESTS =\ - libfonts_calculate_subpixel_order.test\ - libfonts_get_default_font_name.test\ - libfonts_get_subpixel_order_class.test\ - libfonts_unget_subpixel_order_class.test - HDR =\ common.h\ libfonts.h LOBJ = $(OBJ:.o=.lo) +TESTS = $(OBJ:.o=.test) all: libfonts.a libfonts.$(LIBEXT) $(TESTS) diff --git a/libfonts.h b/libfonts.h index 06f8d48..2caaced 100644 --- a/libfonts.h +++ b/libfonts.h @@ -1647,7 +1647,6 @@ int libfonts_get_default_font_by_name(enum libfonts_default_font *, const char * * @throws EINVAL Invalid font description */ int libfonts_encode_font_description(const struct libfonts_font_description *, char[static 256]); -/* TODO add test */ /** * Decode an X Logical Font Description (XLFD) string @@ -1659,7 +1658,6 @@ int libfonts_encode_font_description(const struct libfonts_font_description *, c * @throws EINVAL Invalid font description */ int libfonts_decode_font_description(struct libfonts_font_description *, const char *); -/* TODO add test */ /** * Check if an X Logical Font Description (XLFD) matches @@ -1762,7 +1760,6 @@ int libfonts_get_output_rendering_settings(struct libfonts_rendering_settings *, * non-invertable output transformation) */ int libfonts_get_output_dpi(struct libfonts_output *, const char *); -/* TODO add test */ /** * Calculate the subpixel order on an output device after diff --git a/libfonts_decode_font_description.c b/libfonts_decode_font_description.c index 46031de..2348d97 100644 --- a/libfonts_decode_font_description.c +++ b/libfonts_decode_font_description.c @@ -1,5 +1,7 @@ /* See LICENSE file for copyright and license details. */ #include "common.h" +#ifndef TEST + #define LIST_FIELDS_EXCEPT_FINAL(X)\ X(foundry)\ @@ -215,3 +217,16 @@ private: desc->private_font_name = desc->_buf; return 0; } + + +#else + + +int +main(void) /* TODO add test */ +{ + return 0; +} + + +#endif diff --git a/libfonts_encode_font_description.c b/libfonts_encode_font_description.c index 5bbac5f..5cc26bb 100644 --- a/libfonts_encode_font_description.c +++ b/libfonts_encode_font_description.c @@ -1,5 +1,7 @@ /* See LICENSE file for copyright and license details. */ #include "common.h" +#ifndef TEST + #define LIST_FIELDS(X)\ X(foundry)\ @@ -102,3 +104,16 @@ einval: errno = EINVAL; return -1; } + + +#else + + +int +main(void) /* TODO add test */ +{ + return 0; +} + + +#endif diff --git a/libfonts_get_output_dpi.c b/libfonts_get_output_dpi.c index 17ae837..47fcb70 100644 --- a/libfonts_get_output_dpi.c +++ b/libfonts_get_output_dpi.c @@ -1,5 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include "common.h" +#ifndef TEST static int @@ -115,3 +116,16 @@ libfonts_get_output_dpi(struct libfonts_output *output, const char *edid) return 1; } + + +#else + + +int +main(void) /* TODO add test */ +{ + return 0; +} + + +#endif -- cgit v1.2.3-70-g09d2