# HG changeset patch # User David Demelier # Date 1675776633 -3600 # Node ID f06312a7432bbbd9859445050657e6f2298b51ed # Parent 4da5819148c6793951ec145dc094f0a4069666cf cmake: enable tests diff -r 4da5819148c6 -r f06312a7432b CMakeLists.txt --- a/CMakeLists.txt Wed Feb 01 13:07:04 2023 +0100 +++ b/CMakeLists.txt Tue Feb 07 14:30:33 2023 +0100 @@ -29,7 +29,12 @@ include(GNUInstallDirs) add_library(libunicode-static STATIC unicode.c unicode.h) -target_include_directories(libunicode-static PUBLIC $) +target_include_directories( + libunicode-static + PUBLIC + $ + $ +) install( TARGETS libunicode-static EXPORT unicode-targets @@ -88,3 +93,12 @@ ${PROJECT_SOURCE_DIR}/unicode-config.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unicode ) + +enable_testing() + +foreach (t test-unicode) + add_executable(${t} tests/${t}.c) + target_link_libraries(${t} libunicode-static) + target_include_directories(${t} PRIVATE ${CMAKE_SOURCE_DIR}/extern/libdt) + add_test(NAME ${t} COMMAND ${t}) +endforeach () diff -r 4da5819148c6 -r f06312a7432b GNUmakefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GNUmakefile Tue Feb 07 14:30:33 2023 +0100 @@ -0,0 +1,67 @@ +# +# GNUmakefile -- GNU Makefile for libunicode +# +# Copyright (c) 2013-2023 David Demelier +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +PREFIX := /usr/local +INCDIR := $(PREFIX)/include +LIBDIR := $(PREFIX)/lib +MANDIR := $(PREFIX)/share/man + +VERSION := 1.0.0 + +LIB_SRCS := unicode.c +LIB_OBJS := $(LIB_SRCS:.c=.o) +LIB_DEPS := $(LIB_SRCS:.c=.d) +LIB := libunicode.a + +TESTS_SRCS := tests/test-unicode.c +TESTS_OBJS := $(TESTS_SRCS:.c=) + +override CFLAGS += -fPIC + +all: $(LIB) + +gen/UnicodeData.txt: + curl http://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt -o $@ + +unicode.c: gen/UnicodeData.txt gen/mkutf.awk + cat gen/unicode-before.c > unicode.c + cat gen/UnicodeData.txt | awk -f gen/mkutf.awk >> unicode.c + cat gen/unicode-after.c >> unicode.c + +$(LIB): $(LIB_OBJS) + $(AR) -rc $@ $(LIB_OBJS) + +$(TESTS_OBJS): | $(LIB) +$(TESTS_OBJS): private CFLAGS += -Iextern/libdt -I. +$(TESTS_OBJS): private LDLIBS += $(LIB) + +tests: $(TESTS_OBJS) + for t in $(TESTS_OBJS); do ./$$t; done + +install: + mkdir -p $(DESTDIR)$(LIBDIR) + cp libunicode.a $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCDIR) + cp unicode.h $(DESTDIR)$(INCDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man3 + cp libunicode.3 $(DESTDIR)$(MANDIR)/man3 + +clean: + rm -f $(LIB) $(LIB_DEPS) $(LIB_OBJS) $(TESTS_OBJS) + +.PHONY: all clean install tests diff -r 4da5819148c6 -r f06312a7432b INSTALL.md --- a/INSTALL.md Wed Feb 01 13:07:04 2023 +0100 +++ b/INSTALL.md Tue Feb 07 14:30:33 2023 +0100 @@ -42,6 +42,10 @@ - `unicode::libunicode-shared`: shared version, - `unicode::libunicode-static`: static version. +The test suite is available using: + + $ ctest --test-dir build + Example: cmake_minimum_required(VERSION 3.20) @@ -50,9 +54,9 @@ add_executable(example example.c) target_link_libraries(example unicode::libunicode) -### Using POSIX make (not recommended) +### Using GNU make (not recommended) -POSIX make (not recommended, only static library): +Using [GNU make][gmake] (not recommended, only static library): $ make # make install @@ -61,4 +65,7 @@ $ make tests +On some systems you make need to call `gmake` rather than `make`. + [cmake]: http://cmake.org +[gmake]: https://www.gnu.org/software/make diff -r 4da5819148c6 -r f06312a7432b Makefile --- a/Makefile Wed Feb 01 13:07:04 2023 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -# -# Makefile -- basic Makefile for libunicode -# -# Copyright (c) 2013-2023 David Demelier -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# - -.POSIX: - -CC= cc - -PREFIX= /usr/local -INCDIR= ${PREFIX}/include -LIBDIR= ${PREFIX}/lib -MANDIR= ${PREFIX}/share/man - -VERSION= 1.0.0 - -LIB_SRCS= unicode.c -LIB_OBJS= ${LIB_SRCS:.c=.o} -LIB_DEPS= ${LIB_SRCS:.c=.d} -LIB= libunicode.a - -TESTS_SRCS= tests/test-unicode.c -TESTS_OBJS= ${TESTS_SRCS:.c=} - -.SUFFIXES: -.SUFFIXES: .c .o - -all: ${LIB} - --include ${LIB_DEPS} - -.c: - ${CC} ${CFLAGS} -Iextern/librexo -I. $< -o $@ ${LIB} ${LDFLAGS} - -.c.o: - ${CC} ${CFLAGS} -Iextern/librexo -I. -MMD -c $< -o $@ ${LDFLAGS} - -gen/UnicodeData.txt: - curl http://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt -o $@ - -unicode.c: gen/UnicodeData.txt gen/mkutf.awk - cat gen/unicode-before.c > unicode.c - cat gen/UnicodeData.txt | awk -f gen/mkutf.awk >> unicode.c - cat gen/unicode-after.c >> unicode.c - -${LIB}: ${LIB_OBJS} - ${AR} -rc $@ ${LIB_OBJS} - -${TESTS_OBJS}: ${LIB} - -tests: ${TESTS_OBJS} - for t in ${TESTS_OBJS}; do ./$$t; done - -install: - mkdir -p ${DESTDIR}${LIBDIR} - cp libunicode.a ${DESTDIR}${LIBDIR} - mkdir -p ${DESTDIR}${INCDIR} - cp unicode.h ${DESTDIR}${INCDIR} - mkdir -p ${DESTDIR}${MANDIR}/man3 - cp libunicode.3 ${DESTDIR}${MANDIR}/man3 - -clean: - rm -f ${LIB} ${LIB_DEPS} ${LIB_OBJS} ${TESTS_OBJS} - -.PHONY: all clean install tests diff -r 4da5819148c6 -r f06312a7432b extern/LICENSE.libdt.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extern/LICENSE.libdt.txt Tue Feb 07 14:30:33 2023 +0100 @@ -0,0 +1,16 @@ +libdt ISC LICENSE +================= + +Copyright (c) 2022-2023 David Demelier + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff -r 4da5819148c6 -r f06312a7432b extern/LICENSE.librexo.txt --- a/extern/LICENSE.librexo.txt Wed Feb 01 13:07:04 2023 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to diff -r 4da5819148c6 -r f06312a7432b extern/VERSION.libdt.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extern/VERSION.libdt.txt Tue Feb 07 14:30:33 2023 +0100 @@ -0,0 +1,1 @@ +e1ce3a1ac942548e31b637a96c49f68d9d54fcf7 diff -r 4da5819148c6 -r f06312a7432b extern/VERSION.librexo.txt --- a/extern/VERSION.librexo.txt Wed Feb 01 13:07:04 2023 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0.2.2 diff -r 4da5819148c6 -r f06312a7432b extern/libdt/dt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extern/libdt/dt.h Tue Feb 07 14:30:33 2023 +0100 @@ -0,0 +1,168 @@ +/* + * dt.h -- minimalist C testing library + * + * Copyright (c) 2022-2023 David Demelier + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef DT_H +#define DT_H + +#include +#include +#include +#include +#include +#include + +static size_t dt_ntests; +static size_t dt_nchecks; +static size_t dt_nfailures; + +#ifndef DT_DOUBLE_TOLERANCE +#define DT_DOUBLE_TOLERANCE 0.001 +#endif + +#define DT_ASSERT(x) \ +do { \ + ++ dt_nchecks; \ + \ + if (!(x)) { \ + ++ dt_nfailures; \ + \ + printf("%s:%d: assertion '" #x "' failed\n", __FILE__, __LINE__); \ + } \ +} while (0) + +#define DT_EQ(x, y, type, f) \ +do { \ + const type tx = x; \ + const type ty = y; \ + \ + ++ dt_nchecks; \ + \ + if (tx != ty) { \ + ++ dt_nfailures; \ + \ + printf("%s:%d: assertion " #x " == " #y " failed (" f " != " f ")\n", \ + __FILE__, __LINE__, tx, ty); \ + } \ +} while (0) + +#define DT_EQ_PTR(x, y) \ +do { \ + const void *tx = x; \ + const void *ty = y; \ + \ + ++ dt_nchecks; \ + \ + if (tx != ty) { \ + ++ dt_nfailures; \ + \ + printf("%s:%d: assertion " #x " == " #y " failed (%p != %p)\n", \ + __FILE__, __LINE__, tx, ty); \ + } \ +} while (0) + +#define DT_EQ_STR(x, y) \ +do { \ + ++ dt_nchecks; \ + \ + if (strcmp(x, y) != 0) { \ + ++ dt_nfailures; \ + \ + printf("%s:%d: assertion " #x " == " #y " failed (%s != %s)\n", \ + __FILE__, __LINE__, (x), (y)); \ + } \ +} while (0) + +#define DT_EQ_DOUBLE(x, y) \ +do { \ + const double tx = x; \ + const double ty = y; \ + \ + ++ dt_nchecks; \ + \ + if (fabs(tx - ty) > DT_DOUBLE_TOLERANCE) { \ + ++ dt_nfailures; \ + \ + printf("%s:%d: assertion " #x " == " #y " failed (%f != %f)\n", \ + __FILE__, __LINE__, tx, ty); \ + } \ +} while (0) + +#define DT_RUN(f, ...) \ +do { \ + const size_t nchecks = dt_nchecks; \ + const size_t nfailures = dt_nfailures; \ + \ + ++ dt_ntests; \ + \ + printf("== test " #f " ==\n"); \ + f(__VA_ARGS__); \ + \ + printf("\n%zu checks, %zu failures\n\n", \ + dt_nchecks - nchecks, dt_nfailures - nfailures); \ +} while (0) + +#define DT_RUN_EX(f, init, fini, ...) \ +do { \ + const size_t nchecks = dt_nchecks; \ + const size_t nfailures = dt_nfailures; \ + \ + ++ dt_ntests; \ + \ + printf("== test " #f " ==\n"); \ + init(__VA_ARGS__); \ + f(__VA_ARGS__); \ + fini(__VA_ARGS__); \ + \ + printf("\n%zu checks, %zu failures\n\n", \ + dt_nchecks - nchecks, dt_nfailures - nfailures); \ +} while (0) + +#define DT_SUMMARY() \ +do { \ + printf("summary: %zu tests, %zu checks, %zu failures\n", \ + dt_ntests, dt_nchecks, dt_nfailures); \ +} while (0) + +#define DT_EXIT() (dt_nfailures != 0) + +/* Aliases for basic types. */ +#define DT_EQ_CHAR(x, y) DT_EQ(x, y, char, "%c") +#define DT_EQ_SHORT(x, y) DT_EQ(x, y, short, "%hd") +#define DT_EQ_USHORT(x, y) DT_EQ(x, y, unsigned short, "%hu") +#define DT_EQ_INT(x, y) DT_EQ(x, y, int, "%d") +#define DT_EQ_UINT(x, y) DT_EQ(x, y, unsigned int, "%u") +#define DT_EQ_LONG(x, y) DT_EQ(x, y, long, "%ld") +#define DT_EQ_ULONG(x, y) DT_EQ(x, y, unsigned long, "%lu") +#define DT_EQ_LLONG(x, y) DT_EQ(x, y, long long, "%lld") +#define DT_EQ_ULLONG(x, y) DT_EQ(x, y, unsigned long long, "%llu") +#define DT_EQ_INTMAX(x, y) DT_EQ(x, y, intmax_t, "%jd") +#define DT_EQ_UINTMAX(x, y) DT_EQ(x, y, uintmax_t, "%ju") +#define DT_EQ_SIZE(x, y) DT_EQ(x, y, size_t, "%zu") +#define DT_EQ_PTRDIFF(x, y) DT_EQ(x, y, ptrdiff_t, "%td") + +/* Aliases for fixed size integers. */ +#define DT_EQ_INT8(x, y) DT_EQ(x, y, int8_t, PRId8) +#define DT_EQ_UINT8(x, y) DT_EQ(x, y, uint8_t int, PRIu8) +#define DT_EQ_INT16(x, y) DT_EQ(x, y, int16_t, PRId16) +#define DT_EQ_UINT16(x, y) DT_EQ(x, y, uint16_t int, PRIu16) +#define DT_EQ_INT32(x, y) DT_EQ(x, y, int32_t, PRId32) +#define DT_EQ_UINT32(x, y) DT_EQ(x, y, uint32_t int, PRIu32) +#define DT_EQ_INT64(x, y) DT_EQ(x, y, int64_t, PRId64) +#define DT_EQ_UINT64(x, y) DT_EQ(x, y, uint64_t int, PRIu64) + +#endif /* !DT_H */ diff -r 4da5819148c6 -r f06312a7432b extern/librexo/rexo.h --- a/extern/librexo/rexo.h Wed Feb 01 13:07:04 2023 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6697 +0,0 @@ -/* - This is free and unencumbered software released into the public domain. - - Anyone is free to copy, modify, publish, use, compile, sell, or - distribute this software, either in source code form or as a compiled - binary, for any purpose, commercial or non-commercial, and by any - means. - - In jurisdictions that recognize copyright laws, the author or authors - of this software dedicate any and all copyright interest in the - software to the public domain. We make this dedication for the benefit - of the public at large and to the detriment of our heirs and - successors. We intend this dedication to be an overt act of - relinquishment in perpetuity of all present and future rights to this - software under copyright law. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - For more information, please refer to -*/ - -#ifndef REXO_REXO_H -#define REXO_REXO_H - -#define RX_MAJOR_VERSION 0 -#define RX_MINOR_VERSION 2 -#define RX_PATCH_VERSION 2 - -#define RX_VERSION \ - ((RX_MAJOR_VERSION << 20) | (RX_MINOR_VERSION << 10) | (RX_PATCH_VERSION)) - -/* - The environment macro represents whether the code is to be generated for a - 32-bit or 64-bit target platform. Some CPUs, such as the x86-64 processors, - allow running code in 32-bit mode if compiled using the -m32 or -mx32 - compiler switches, in which case `RX__ENVIRONMENT` is set to 32. -*/ -#if (!(defined(__x86_64__) || defined(_M_X64)) || defined(__ILP32__)) \ - && !(defined(__itanium__) || defined(_M_IA64)) \ - && !(defined(__powerpc64__) || defined(__ppc64__)) \ - && !defined(__aarch64__) - #define RX__ENVIRONMENT 32 -#else - #define RX__ENVIRONMENT 64 -#endif - -/* - The common data models, that is ILP32 (most recent 32-bit systems), - LP64 (Unix-like systems), and LLP64 (Windows), all have the `int` type set to - 32 bits, and the `long long` type to 64 bits. -*/ -#if defined(RX_UINT32_TYPE) - typedef RX_UINT32_TYPE rx_uint32; -#else - typedef unsigned int rx_uint32; -#endif -typedef char rx__invalid_uint32_type[sizeof(rx_uint32) == 4 ? 1 : -1]; - -#if defined(RX_UINT64_TYPE) - typedef RX_UINT64_TYPE rx_uint64; -#else - #if defined(__GNUC__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wlong-long" - #endif - /* - Even though the `long long` type is not part of the C89 and C++98 - standards, assume that it's defined by current compilers. - */ - typedef unsigned long long rx_uint64; - #if defined(__GNUC__) - #pragma GCC diagnostic pop - #endif -#endif -typedef char rx__invalid_uint64_type[sizeof(rx_uint64) == 8 ? 1 : -1]; - -/* - The C standard provides no guarantees about the size of the type `size_t`, - and some exotic platforms will in fact provide original values, but this - should cover most of the use cases. -*/ -#if defined(RX_SIZE_TYPE) - typedef RX_SIZE_TYPE rx_size; -#elif RX__ENVIRONMENT == 32 - typedef rx_uint32 rx_size; -#else - typedef rx_uint64 rx_size; -#endif - -#if defined(RX_ENABLE_EXTERNAL_LINKING) - #define RX__STORAGE extern -#else - #define RX__STORAGE static -#endif - -#if defined(__GNUC__) - #define RX__MAYBE_UNUSED __attribute__((unused)) -#else - #define RX__MAYBE_UNUSED -#endif - -#if defined(_MSC_VER) - #define RX__DEFINE_PARAMS(type) \ - _Pragma("warning(push)") \ - _Pragma("warning(disable : 4100)") \ - struct rx_context *RX_PARAM_CONTEXT RX__MAYBE_UNUSED, \ - type *RX_PARAM_DATA RX__MAYBE_UNUSED \ - _Pragma("warning(pop)") -#else - #define RX__DEFINE_PARAMS(type) \ - struct rx_context *RX_PARAM_CONTEXT RX__MAYBE_UNUSED, \ - type *RX_PARAM_DATA RX__MAYBE_UNUSED -#endif - -/* - Support compilers that checks printf-style functions. -*/ -#if defined(__GNUC__) - #define RX__PRINTF_CHECK(fmt, args) \ - __attribute__((format (printf, (fmt), (args)))) -#else - #define RX__PRINTF_CHECK(fmt, args) -#endif - -/* Public Interface O-(''Q) - -------------------------------------------------------------------------- */ - -#define RX_PARAM_CONTEXT rx__context -#define RX_PARAM_DATA rx__data - -#define RX_DATA RX_PARAM_DATA - -enum rx_status { - RX_SUCCESS = 0, - RX_ERROR = -1, - RX_ERROR_ABORTED = -2, - RX_ERROR_ALLOCATION = -3, - RX_ERROR_MAX_SIZE_EXCEEDED = -4 -}; - -enum rx_severity { RX_NONFATAL = 0, RX_FATAL = 1 }; - -enum rx_log_level { - RX_LOG_LEVEL_NONE = 0, - RX_LOG_LEVEL_FATAL = 1, - RX_LOG_LEVEL_ERROR = 3, - RX_LOG_LEVEL_WARNING = 4, - RX_LOG_LEVEL_INFO = 5, - RX_LOG_LEVEL_DEBUG = 6, - RX_LOG_LEVEL_ALL = RX_LOG_LEVEL_DEBUG -}; - -struct rx_context; - -typedef enum rx_status (*rx_set_up_fn)(RX__DEFINE_PARAMS(void)); -typedef void (*rx_tear_down_fn)(RX__DEFINE_PARAMS(void)); -typedef void (*rx_run_fn)(RX__DEFINE_PARAMS(void)); - -struct rx_fixture_config { - rx_set_up_fn set_up; - rx_tear_down_fn tear_down; -}; - -struct rx_fixture { - rx_size size; - struct rx_fixture_config config; -}; - -struct rx_test_case_config { - int skip; - struct rx_fixture fixture; -}; - -struct rx_test_case { - const char *suite_name; - const char *name; - rx_run_fn run; - struct rx_test_case_config config; -}; - -struct rx_failure { - const char *file; - int line; - enum rx_severity severity; - const char *msg; - const char *diagnostic_msg; -}; - -struct rx_summary { - const struct rx_test_case *test_case; - int skipped; - const char *error; - rx_size assessed_count; - rx_size failure_count; - struct rx_failure *failures; - rx_uint64 elapsed; -}; - -struct rx_summary_group { - rx_size count; - const struct rx_summary *array; -}; - -#if defined(__cplusplus) -extern "C" { -#endif - -RX__STORAGE void -rx_abort(struct rx_context *context); - -RX__STORAGE enum rx_status -rx_handle_test_result(struct rx_context *context, - int result, - const char *file, - int line, - enum rx_severity severity, - const char *failure_msg, - const char *diagnostic_msg); - -RX__STORAGE enum rx_status -rx_summary_initialize(struct rx_summary *summary, - const struct rx_test_case *test_case); - -RX__STORAGE void -rx_summary_terminate(struct rx_summary *summary); - -RX__STORAGE void -rx_summary_print(const struct rx_summary *summary); - -RX__STORAGE void -rx_sort_summaries_by_test_suite(struct rx_summary *summaries, - rx_size summary_count); - -RX__STORAGE void -rx_group_summaries_by_test_suite(rx_size *summary_group_count, - struct rx_summary_group *summary_groups, - rx_size summary_count, - const struct rx_summary *summaries); - -RX__STORAGE enum rx_status -rx_test_case_run(struct rx_summary *summary, - const struct rx_test_case *test_case); - -RX__STORAGE void -rx_enumerate_test_cases(rx_size *test_case_count, - struct rx_test_case *test_cases); - -RX__STORAGE enum rx_status -rx_run(rx_size test_case_count, const struct rx_test_case *test_cases); - -RX__STORAGE enum rx_status -rx_main(rx_size test_case_count, - const struct rx_test_case *test_cases, - int argc, - const char **argv); - -#if defined(__cplusplus) -} -#endif - -/* Helpers O-(''Q) - -------------------------------------------------------------------------- */ - -#define RX__LANG_C 0 -#define RX__LANG_CPP 1 - -#if defined(__cplusplus) - #define RX__LANG RX__LANG_CPP - #define RX__LANG_VERSION __cplusplus -#else - #define RX__LANG RX__LANG_C - #if defined(__STDC_VERSION__) - #define RX__LANG_VERSION __STDC_VERSION__ - #else - #define RX__LANG_VERSION 0L - #endif -#endif - -#if defined(RX_DISABLE_NPRINTF) \ - || (!defined(RX_ENABLE_NPRINTF) \ - && !defined(_MSC_VER) \ - && ((RX__LANG == RX__LANG_C && RX__LANG_VERSION < 199901L) \ - || (RX__LANG == RX__LANG_CPP && RX__LANG_VERSION < 201103L))) - #define RX__HAS_NPRINTF 0 -#else - #define RX__HAS_NPRINTF 1 -#endif - -#if defined(RX_DISABLE_VARIADIC_MACROS) \ - || (!defined(RX_ENABLE_VARIADIC_MACROS) \ - && !defined(_MSC_VER) \ - && ((RX__LANG == RX__LANG_C && RX__LANG_VERSION < 199901L) \ - || (RX__LANG == RX__LANG_CPP && RX__LANG_VERSION < 201103L))) - #define RX__HAS_VARIADIC_MACROS 0 -#else - #define RX__HAS_VARIADIC_MACROS 1 -#endif - -#define RX__FALSE ((int)0) -#define RX__TRUE ((int)1) - -/* Automatic Registration Framework O-(''Q) - -------------------------------------------------------------------------- */ - -#define RX_SET_UP(id) \ - static enum rx_status \ - id(RX__DEFINE_PARAMS(void)) - -#define RX_TEAR_DOWN(id) \ - static void \ - id(RX__DEFINE_PARAMS(void)) - -#if RX__HAS_VARIADIC_MACROS - #define RX_FIXTURE(...) \ - RX__EXPAND( \ - RX__CONCAT( \ - RX__FIXTURE_DISPATCH_, \ - RX__HAS_AT_LEAST_3_ARGS(__VA_ARGS__) \ - )(__VA_ARGS__)) \ - RX__REQUIRE_SEMICOLON - - #define RX__FIXTURE_DISPATCH_0(id, type) \ - RX__FIXTURE_0(id, sizeof(type)) - - #define RX__FIXTURE_DISPATCH_1(id, type, ...) \ - RX__FIXTURE_1(id, \ - sizeof(type), \ - RX__COUNT_ARGS(__VA_ARGS__), \ - (__VA_ARGS__)) -#else - #define RX_FIXTURE(id, type) \ - RX__FIXTURE_0(id, sizeof(type)) \ - RX__REQUIRE_SEMICOLON - - #define RX_FIXTURE_1(id, type, _0) \ - RX__FIXTURE_1(id, sizeof(type), 1, (_0)) \ - RX__REQUIRE_SEMICOLON - - #define RX_FIXTURE_2(id, type, _0, _1) \ - RX__FIXTURE_1(id, sizeof(type), 2, (_0, _1)) \ - RX__REQUIRE_SEMICOLON -#endif - -#if RX__HAS_VARIADIC_MACROS - #define RX_VOID_FIXTURE(...) \ - RX__EXPAND( \ - RX__CONCAT( \ - RX__VOID_FIXTURE_DISPATCH_, \ - RX__HAS_AT_LEAST_2_ARGS(__VA_ARGS__) \ - )(__VA_ARGS__)) \ - RX__REQUIRE_SEMICOLON - - #define RX__VOID_FIXTURE_DISPATCH_0(id) \ - RX__FIXTURE_0(id, 0) - - #define RX__VOID_FIXTURE_DISPATCH_1(id, ...) \ - RX__FIXTURE_1(id, \ - 0, \ - RX__COUNT_ARGS(__VA_ARGS__), \ - (__VA_ARGS__)) -#else - #define RX_VOID_FIXTURE(id) \ - RX__FIXTURE_0(id, 0) \ - RX__REQUIRE_SEMICOLON - - #define RX_VOID_FIXTURE_1(id, _0) \ - RX__FIXTURE_1(id, 0, 1, (_0)) \ - RX__REQUIRE_SEMICOLON - - #define RX_VOID_FIXTURE_2(id, _0, _1) \ - RX__FIXTURE_1(id, 0, 2, (_0, _1)) \ - RX__REQUIRE_SEMICOLON -#endif - -#if RX__HAS_VARIADIC_MACROS - #define RX_TEST_SUITE(...) \ - RX__EXPAND( \ - RX__CONCAT( \ - RX__TEST_SUITE_DISPATCH_, \ - RX__HAS_AT_LEAST_2_ARGS(__VA_ARGS__) \ - )(__VA_ARGS__)) \ - RX__REQUIRE_SEMICOLON - - #define RX__TEST_SUITE_DISPATCH_0(id) \ - RX__TEST_SUITE_0(id) - - #define RX__TEST_SUITE_DISPATCH_1(id, ...) \ - RX__TEST_SUITE_1(id, \ - RX__COUNT_ARGS(__VA_ARGS__), \ - (__VA_ARGS__)) -#else - #define RX_TEST_SUITE(id) \ - RX__TEST_SUITE_0(id) \ - RX__REQUIRE_SEMICOLON - - #define RX_TEST_SUITE_1(id, _0) \ - RX__TEST_SUITE_1(id, 1, (_0)) \ - RX__REQUIRE_SEMICOLON - - #define RX_TEST_SUITE_2(id, _0, _1) \ - RX__TEST_SUITE_1(id, 2, (_0, _1)) \ - RX__REQUIRE_SEMICOLON -#endif - -#if RX__HAS_VARIADIC_MACROS - #define RX_TEST_CASE(...) \ - RX__EXPAND( \ - RX__CONCAT( \ - RX__TEST_CASE_DISPATCH_, \ - RX__HAS_AT_LEAST_3_ARGS(__VA_ARGS__) \ - )(__VA_ARGS__)) - - #define RX__TEST_CASE_DISPATCH_0(suite_id, id) \ - RX__TEST_CASE_0(suite_id, id) - - #define RX__TEST_CASE_DISPATCH_1(suite_id, id, ...) \ - RX__TEST_CASE_1(suite_id, \ - id, \ - RX__COUNT_ARGS(__VA_ARGS__), \ - (__VA_ARGS__)) -#else - #define RX_TEST_CASE(suite_id, id) \ - RX__TEST_CASE_0(suite_id, id) - - #define RX_TEST_CASE_1(suite_id, id, _0) \ - RX__TEST_CASE_1(suite_id, id, 1, (_0)) - - #define RX_TEST_CASE_2(suite_id, id, _0, _1) \ - RX__TEST_CASE_1(suite_id, id, 2, (_0, _1)) -#endif - -/* Generic Assertions O-(''Q) - -------------------------------------------------------------------------- */ - -#if RX__HAS_VARIADIC_MACROS - #define RX__DEFINE_TEST(severity, expected, condition, ...) \ - rx__assess_value(RX_PARAM_CONTEXT, \ - !!(condition), \ - expected, \ - #condition, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__DEFINE_TEST(severity, expected, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__assess_value(RX_PARAM_CONTEXT, \ - !!(condition), \ - expected, \ - #condition, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_REQUIRE(condition) \ - RX_REQUIRE_MSG(condition, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REQUIRE_MSG(condition, ...) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, __VA_ARGS__) -#else - #define RX_REQUIRE_MSG(condition, msg) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REQUIRE_MSG_1(condition, msg, \ - _0) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REQUIRE_MSG_2(condition, msg, \ - _0, _1) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REQUIRE_MSG_3(condition, msg, \ - _0, _1, _2) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REQUIRE_MSG_4(condition, msg, \ - _0, _1, _2, _3) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REQUIRE_MSG_5(condition, msg, \ - _0, _1, _2, _3, _4) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REQUIRE_MSG_6(condition, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REQUIRE_MSG_7(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REQUIRE_MSG_8(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_CHECK(condition) \ - RX_CHECK_MSG(condition, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_CHECK_MSG(condition, ...) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, __VA_ARGS__) -#else - #define RX_CHECK_MSG(condition, msg) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_CHECK_MSG_1(condition, msg, \ - _0) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_CHECK_MSG_2(condition, msg, \ - _0, _1) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_CHECK_MSG_3(condition, msg, \ - _0, _1, _2) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_CHECK_MSG_4(condition, msg, \ - _0, _1, _2, _3) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_CHECK_MSG_5(condition, msg, \ - _0, _1, _2, _3, _4) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_CHECK_MSG_6(condition, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_CHECK_MSG_7(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_CHECK_MSG_8(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - - -/* Boolean Assertions O-(''Q) - -------------------------------------------------------------------------- */ - -#if RX__HAS_VARIADIC_MACROS - #define RX__BOOL_DEFINE_TEST(severity, expected, condition, ...) \ - rx__bool_assess_value(RX_PARAM_CONTEXT, \ - !!(condition), \ - expected, \ - #condition, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__BOOL_DEFINE_TEST(severity, expected, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__bool_assess_value(RX_PARAM_CONTEXT, \ - !!(condition), \ - expected, \ - #condition, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_BOOL_REQUIRE_TRUE(condition) \ - RX_BOOL_REQUIRE_TRUE_MSG(condition, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_BOOL_REQUIRE_TRUE_MSG(condition, ...) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, __VA_ARGS__) -#else - #define RX_BOOL_REQUIRE_TRUE_MSG(condition, msg) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_BOOL_REQUIRE_TRUE_MSG_1(condition, msg, \ - _0) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_TRUE_MSG_2(condition, msg, \ - _0, _1) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_TRUE_MSG_3(condition, msg, \ - _0, _1, _2) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_TRUE_MSG_4(condition, msg, \ - _0, _1, _2, _3) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_TRUE_MSG_5(condition, msg, \ - _0, _1, _2, _3, _4) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_TRUE_MSG_6(condition, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_BOOL_REQUIRE_TRUE_MSG_7(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_BOOL_REQUIRE_TRUE_MSG_8(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_BOOL_CHECK_TRUE(condition) \ - RX_BOOL_CHECK_TRUE_MSG(condition, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_BOOL_CHECK_TRUE_MSG(condition, ...) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, __VA_ARGS__) -#else - #define RX_BOOL_CHECK_TRUE_MSG(condition, msg) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_BOOL_CHECK_TRUE_MSG_1(condition, msg, \ - _0) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_TRUE_MSG_2(condition, msg, \ - _0, _1) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_TRUE_MSG_3(condition, msg, \ - _0, _1, _2) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_TRUE_MSG_4(condition, msg, \ - _0, _1, _2, _3) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_TRUE_MSG_5(condition, msg, \ - _0, _1, _2, _3, _4) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_TRUE_MSG_6(condition, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_BOOL_CHECK_TRUE_MSG_7(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_BOOL_CHECK_TRUE_MSG_8(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__TRUE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_BOOL_REQUIRE_FALSE(condition) \ - RX_BOOL_REQUIRE_FALSE_MSG(condition, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_BOOL_REQUIRE_FALSE_MSG(condition, ...) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, __VA_ARGS__) -#else - #define RX_BOOL_REQUIRE_FALSE_MSG(condition, msg) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_BOOL_REQUIRE_FALSE_MSG_1(condition, msg, \ - _0) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_FALSE_MSG_2(condition, msg, \ - _0, _1) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_FALSE_MSG_3(condition, msg, \ - _0, _1, _2) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_FALSE_MSG_4(condition, msg, \ - _0, _1, _2, _3) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_FALSE_MSG_5(condition, msg, \ - _0, _1, _2, _3, _4) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_BOOL_REQUIRE_FALSE_MSG_6(condition, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_BOOL_REQUIRE_FALSE_MSG_7(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_BOOL_REQUIRE_FALSE_MSG_8(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__BOOL_DEFINE_TEST(RX_FATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_BOOL_CHECK_FALSE(condition) \ - RX_BOOL_CHECK_FALSE_MSG(condition, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_BOOL_CHECK_FALSE_MSG(condition, ...) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, __VA_ARGS__) -#else - #define RX_BOOL_CHECK_FALSE_MSG(condition, msg) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_BOOL_CHECK_FALSE_MSG_1(condition, msg, \ - _0) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_FALSE_MSG_2(condition, msg, \ - _0, _1) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_FALSE_MSG_3(condition, msg, \ - _0, _1, _2) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_FALSE_MSG_4(condition, msg, \ - _0, _1, _2, _3) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_FALSE_MSG_5(condition, msg, \ - _0, _1, _2, _3, _4) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_BOOL_CHECK_FALSE_MSG_6(condition, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_BOOL_CHECK_FALSE_MSG_7(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_BOOL_CHECK_FALSE_MSG_8(condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__BOOL_DEFINE_TEST(RX_NONFATAL, RX__FALSE, condition, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -/* Integer Assertions O-(''Q) - -------------------------------------------------------------------------- */ - -#if RX__HAS_VARIADIC_MACROS - #define RX__INT_DEFINE_TEST(severity, op, x1, x2, ...) \ - rx__int_assess_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__INT_DEFINE_TEST(severity, op, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__int_assess_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_INT_REQUIRE_EQUAL(x1, x2) \ - RX_INT_REQUIRE_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_REQUIRE_EQUAL_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_INT_REQUIRE_EQUAL_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_REQUIRE_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_REQUIRE_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_REQUIRE_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_CHECK_EQUAL(x1, x2) \ - RX_INT_CHECK_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_CHECK_EQUAL_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_INT_CHECK_EQUAL_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_CHECK_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_CHECK_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_CHECK_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_CHECK_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_REQUIRE_NOT_EQUAL(x1, x2) \ - RX_INT_REQUIRE_NOT_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_REQUIRE_NOT_EQUAL_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_INT_REQUIRE_NOT_EQUAL_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_REQUIRE_NOT_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_NOT_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_NOT_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_NOT_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_NOT_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_NOT_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_REQUIRE_NOT_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_REQUIRE_NOT_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_CHECK_NOT_EQUAL(x1, x2) \ - RX_INT_CHECK_NOT_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_CHECK_NOT_EQUAL_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_INT_CHECK_NOT_EQUAL_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_CHECK_NOT_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_NOT_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_NOT_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_NOT_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_NOT_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_CHECK_NOT_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_CHECK_NOT_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_CHECK_NOT_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_REQUIRE_GREATER(x1, x2) \ - RX_INT_REQUIRE_GREATER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_REQUIRE_GREATER_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, __VA_ARGS__) -#else - #define RX_INT_REQUIRE_GREATER_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_REQUIRE_GREATER_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_REQUIRE_GREATER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_CHECK_GREATER(x1, x2) \ - RX_INT_CHECK_GREATER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_CHECK_GREATER_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, __VA_ARGS__) -#else - #define RX_INT_CHECK_GREATER_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_CHECK_GREATER_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_CHECK_GREATER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_CHECK_GREATER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_REQUIRE_LESSER(x1, x2) \ - RX_INT_REQUIRE_LESSER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_REQUIRE_LESSER_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, __VA_ARGS__) -#else - #define RX_INT_REQUIRE_LESSER_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_REQUIRE_LESSER_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_REQUIRE_LESSER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_CHECK_LESSER(x1, x2) \ - RX_INT_CHECK_LESSER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_CHECK_LESSER_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, __VA_ARGS__) -#else - #define RX_INT_CHECK_LESSER_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_CHECK_LESSER_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_CHECK_LESSER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_CHECK_LESSER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL(x1, x2) \ - RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_REQUIRE_GREATER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_CHECK_GREATER_OR_EQUAL(x1, x2) \ - RX_INT_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_INT_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_CHECK_GREATER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_CHECK_GREATER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_CHECK_GREATER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_CHECK_GREATER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL(x1, x2) \ - RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_REQUIRE_LESSER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_INT_CHECK_LESSER_OR_EQUAL(x1, x2) \ - RX_INT_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_INT_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_INT_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_INT_CHECK_LESSER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_INT_CHECK_LESSER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_INT_CHECK_LESSER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_INT_CHECK_LESSER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__INT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -/* Unsigned Integer Assertions O-(''Q) - -------------------------------------------------------------------------- */ - -#if RX__HAS_VARIADIC_MACROS - #define RX__UINT_DEFINE_TEST(severity, op, x1, x2, ...) \ - rx__uint_assess_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__UINT_DEFINE_TEST(severity, op, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__uint_assess_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_UINT_REQUIRE_EQUAL(x1, x2) \ - RX_UINT_REQUIRE_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_REQUIRE_EQUAL_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_UINT_REQUIRE_EQUAL_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_REQUIRE_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_REQUIRE_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_REQUIRE_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_CHECK_EQUAL(x1, x2) \ - RX_UINT_CHECK_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_CHECK_EQUAL_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_UINT_CHECK_EQUAL_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_CHECK_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_CHECK_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_CHECK_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_CHECK_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_REQUIRE_NOT_EQUAL(x1, x2) \ - RX_UINT_REQUIRE_NOT_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_REQUIRE_NOT_EQUAL_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_UINT_REQUIRE_NOT_EQUAL_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_REQUIRE_NOT_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_NOT_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_NOT_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_NOT_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_NOT_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_NOT_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_REQUIRE_NOT_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_REQUIRE_NOT_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_CHECK_NOT_EQUAL(x1, x2) \ - RX_UINT_CHECK_NOT_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_CHECK_NOT_EQUAL_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_UINT_CHECK_NOT_EQUAL_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_CHECK_NOT_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_NOT_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_NOT_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_NOT_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_NOT_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_CHECK_NOT_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_CHECK_NOT_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_CHECK_NOT_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_REQUIRE_GREATER(x1, x2) \ - RX_UINT_REQUIRE_GREATER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_REQUIRE_GREATER_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, __VA_ARGS__) -#else - #define RX_UINT_REQUIRE_GREATER_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_REQUIRE_GREATER_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_REQUIRE_GREATER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_CHECK_GREATER(x1, x2) \ - RX_UINT_CHECK_GREATER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_CHECK_GREATER_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, __VA_ARGS__) -#else - #define RX_UINT_CHECK_GREATER_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_CHECK_GREATER_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_CHECK_GREATER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_REQUIRE_LESSER(x1, x2) \ - RX_UINT_REQUIRE_LESSER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_REQUIRE_LESSER_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, __VA_ARGS__) -#else - #define RX_UINT_REQUIRE_LESSER_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_REQUIRE_LESSER_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_REQUIRE_LESSER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_CHECK_LESSER(x1, x2) \ - RX_UINT_CHECK_LESSER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_CHECK_LESSER_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, __VA_ARGS__) -#else - #define RX_UINT_CHECK_LESSER_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_CHECK_LESSER_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_CHECK_LESSER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL(x1, x2) \ - RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_REQUIRE_GREATER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_CHECK_GREATER_OR_EQUAL(x1, x2) \ - RX_UINT_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg,\ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_CHECK_GREATER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL(x1, x2) \ - RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_REQUIRE_LESSER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_UINT_CHECK_LESSER_OR_EQUAL(x1, x2) \ - RX_UINT_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_UINT_CHECK_LESSER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__UINT_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -/* Floating-Point Assertions O-(''Q) - -------------------------------------------------------------------------- */ - -#if RX__HAS_VARIADIC_MACROS - #define RX__REAL_DEFINE_TEST(severity, op, x1, x2, ...) \ - rx__real_assess_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__REAL_DEFINE_TEST(severity, op, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__real_assess_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_REAL_REQUIRE_EQUAL(x1, x2) \ - RX_REAL_REQUIRE_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_REQUIRE_EQUAL_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_REAL_REQUIRE_EQUAL_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_REQUIRE_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_REQUIRE_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_REQUIRE_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_CHECK_EQUAL(x1, x2) \ - RX_REAL_CHECK_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_CHECK_EQUAL_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_REAL_CHECK_EQUAL_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_CHECK_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_CHECK_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_CHECK_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_CHECK_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_REQUIRE_NOT_EQUAL(x1, x2) \ - RX_REAL_REQUIRE_NOT_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_REQUIRE_NOT_EQUAL_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_REAL_REQUIRE_NOT_EQUAL_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_REQUIRE_NOT_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_NOT_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_NOT_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_NOT_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_NOT_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_NOT_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_REQUIRE_NOT_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_REQUIRE_NOT_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_CHECK_NOT_EQUAL(x1, x2) \ - RX_REAL_CHECK_NOT_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_CHECK_NOT_EQUAL_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_REAL_CHECK_NOT_EQUAL_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_CHECK_NOT_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_NOT_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_NOT_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_NOT_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_NOT_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_CHECK_NOT_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_CHECK_NOT_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_CHECK_NOT_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_REQUIRE_GREATER(x1, x2) \ - RX_REAL_REQUIRE_GREATER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_REQUIRE_GREATER_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, __VA_ARGS__) -#else - #define RX_REAL_REQUIRE_GREATER_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_REQUIRE_GREATER_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_REQUIRE_GREATER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_CHECK_GREATER(x1, x2) \ - RX_REAL_CHECK_GREATER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_CHECK_GREATER_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, __VA_ARGS__) -#else - #define RX_REAL_CHECK_GREATER_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_CHECK_GREATER_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_CHECK_GREATER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_REQUIRE_LESSER(x1, x2) \ - RX_REAL_REQUIRE_LESSER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_REQUIRE_LESSER_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, __VA_ARGS__) -#else - #define RX_REAL_REQUIRE_LESSER_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_REQUIRE_LESSER_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_REQUIRE_LESSER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_CHECK_LESSER(x1, x2) \ - RX_REAL_CHECK_LESSER_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_CHECK_LESSER_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, __VA_ARGS__) -#else - #define RX_REAL_CHECK_LESSER_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_CHECK_LESSER_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_CHECK_LESSER_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL(x1, x2) \ - RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_REQUIRE_GREATER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_CHECK_GREATER_OR_EQUAL(x1, x2) \ - RX_REAL_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg,\ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_CHECK_GREATER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_GREATER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL(x1, x2) \ - RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_REQUIRE_LESSER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_FATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_CHECK_LESSER_OR_EQUAL(x1, x2) \ - RX_REAL_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, ...) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, \ - __VA_ARGS__) -#else - #define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG(x1, x2, msg) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_CHECK_LESSER_OR_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_TEST(RX_NONFATAL, RX__OP_LESSER_OR_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#if RX__HAS_VARIADIC_MACROS - #define RX__REAL_DEFINE_FUZZY_TEST(severity, op, x1, x2, tol, ...) \ - rx__real_assess_fuzzy_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - (tol), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__REAL_DEFINE_FUZZY_TEST(severity, op, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__real_assess_fuzzy_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - (tol), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_REAL_REQUIRE_FUZZY_EQUAL(x1, x2, tol) \ - RX_REAL_REQUIRE_FUZZY_EQUAL_MSG(x1, x2, tol, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG(x1, x2, tol, ...) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, \ - __VA_ARGS__) -#else - #define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG(x1, x2, tol, msg) \ - RX__REAL_DEFINE_FUZZY_TEST( \ - RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG_1(x1, x2, tol, msg, \ - _0) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG_2(x1, x2, tol, msg, \ - _0, _1) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG_3(x1, x2, tol, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG_4(x1, x2, tol, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG_5(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG_6(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG_7(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_REQUIRE_FUZZY_EQUAL_MSG_8(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_CHECK_FUZZY_EQUAL(x1, x2, tol) \ - RX_REAL_CHECK_FUZZY_EQUAL_MSG(x1, x2, tol, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_CHECK_FUZZY_EQUAL_MSG(x1, x2, tol, ...) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, \ - __VA_ARGS__) -#else - #define RX_REAL_CHECK_FUZZY_EQUAL_MSG(x1, x2, tol, msg) \ - RX__REAL_DEFINE_FUZZY_TEST( \ - RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_CHECK_FUZZY_EQUAL_MSG_1(x1, x2, tol, msg, \ - _0) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_EQUAL_MSG_2(x1, x2, tol, msg, \ - _0, _1) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_EQUAL_MSG_3(x1, x2, tol, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_EQUAL_MSG_4(x1, x2, tol, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_EQUAL_MSG_5(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_EQUAL_MSG_6(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_EQUAL_MSG_7(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_CHECK_FUZZY_EQUAL_MSG_8(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL(x1, x2, tol) \ - RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG(x1, x2, tol, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG(x1, x2, tol, ...) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, \ - __VA_ARGS__) -#else - #define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG(x1, x2, tol, msg) \ - RX__REAL_DEFINE_FUZZY_TEST( \ - RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG_1(x1, x2, tol, msg, \ - _0) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG_2(x1, x2, tol, msg, \ - _0, _1) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG_3(x1, x2, tol, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG_4(x1, x2, tol, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG_5(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG_6(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG_7(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_REQUIRE_FUZZY_NOT_EQUAL_MSG_8(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL(x1, x2, tol) \ - RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG(x1, x2, tol, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG(x1, x2, tol, ...) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, \ - __VA_ARGS__) -#else - #define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG(x1, x2, tol, msg) \ - RX__REAL_DEFINE_FUZZY_TEST( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG_1(x1, x2, tol, msg, \ - _0) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg,\ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG_2(x1, x2, tol, msg, \ - _0, _1) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg,\ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG_3(x1, x2, tol, msg, \ - _0, _1, _2) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg,\ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG_4(x1, x2, tol, msg, \ - _0, _1, _2, _3) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg,\ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG_5(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg,\ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG_6(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg,\ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG_7(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg,\ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_REAL_CHECK_FUZZY_NOT_EQUAL_MSG_8(x1, x2, tol, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__REAL_DEFINE_FUZZY_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, tol, msg,\ - _0, _1, _2, _3, _4, _5, _6, _7) - -/* String Assertions O-(''Q) - -------------------------------------------------------------------------- */ - -#if RX__HAS_VARIADIC_MACROS - #define RX__STR_TEST_DEFINE(severity, op, str_case, s1, s2, ...) \ - rx__str_assess_comparison(RX_PARAM_CONTEXT, \ - (s1), \ - (s2), \ - str_case, \ - op, \ - #s1, \ - #s2, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__STR_TEST_DEFINE(severity, op, str_case, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__str_assess_comparison(RX_PARAM_CONTEXT, \ - (s1), \ - (s2), \ - str_case, \ - op, \ - #s1, \ - #s2, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_STR_REQUIRE_EQUAL(s1, s2) \ - RX_STR_REQUIRE_EQUAL_MSG(s1, s2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_STR_REQUIRE_EQUAL_MSG(s1, s2, ...) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, __VA_ARGS__) -#else - #define RX_STR_REQUIRE_EQUAL_MSG(s1, s2, msg) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_STR_REQUIRE_EQUAL_MSG_1(s1, s2, msg, \ - _0) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_MSG_2(s1, s2, msg, \ - _0, _1) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_MSG_3(s1, s2, msg, \ - _0, _1, _2) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_MSG_4(s1, s2, msg, \ - _0, _1, _2, _3) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_MSG_5(s1, s2, msg, \ - _0, _1, _2, _3, _4) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_MSG_6(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_MSG_7(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_STR_REQUIRE_EQUAL_MSG_8(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_STR_CHECK_EQUAL(s1, s2) \ - RX_STR_CHECK_EQUAL_MSG(s1, s2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_STR_CHECK_EQUAL_MSG(s1, s2, ...) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, __VA_ARGS__) -#else - #define RX_STR_CHECK_EQUAL_MSG(s1, s2, msg) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_STR_CHECK_EQUAL_MSG_1(s1, s2, msg, \ - _0) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_MSG_2(s1, s2, msg, \ - _0, _1) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_MSG_3(s1, s2, msg, \ - _0, _1, _2) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_MSG_4(s1, s2, msg, \ - _0, _1, _2, _3) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_MSG_5(s1, s2, msg, \ - _0, _1, _2, _3, _4) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_MSG_6(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_MSG_7(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_STR_CHECK_EQUAL_MSG_8(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_STR_REQUIRE_NOT_EQUAL(s1, s2) \ - RX_STR_REQUIRE_NOT_EQUAL_MSG(s1, s2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_STR_REQUIRE_NOT_EQUAL_MSG(s1, s2, ...) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, \ - __VA_ARGS__) -#else - #define RX_STR_REQUIRE_NOT_EQUAL_MSG(s1, s2, msg) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_STR_REQUIRE_NOT_EQUAL_MSG_1(s1, s2, msg, \ - _0) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_MSG_2(s1, s2, msg, \ - _0, _1) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_MSG_3(s1, s2, msg, \ - _0, _1, _2) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_MSG_4(s1, s2, msg, \ - _0, _1, _2, _3) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_MSG_5(s1, s2, msg, \ - _0, _1, _2, _3, _4) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_MSG_6(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_MSG_7(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_MSG_8(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_STR_CHECK_NOT_EQUAL(s1, s2) \ - RX_STR_CHECK_NOT_EQUAL_MSG(s1, s2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_STR_CHECK_NOT_EQUAL_MSG(s1, s2, ...) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, \ - __VA_ARGS__) -#else - #define RX_STR_CHECK_NOT_EQUAL_MSG(s1, s2, msg) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_STR_CHECK_NOT_EQUAL_MSG_1(s1, s2, msg, \ - _0) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_MSG_2(s1, s2, msg, \ - _0, _1) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_MSG_3(s1, s2, msg, \ - _0, _1, _2) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_MSG_4(s1, s2, msg, \ - _0, _1, _2, _3) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_MSG_5(s1, s2, msg, \ - _0, _1, _2, _3, _4) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_MSG_6(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_MSG_7(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_MSG_8(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_OBEY, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_STR_REQUIRE_EQUAL_NO_CASE(s1, s2) \ - RX_STR_REQUIRE_EQUAL_NO_CASE_MSG(s1, s2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG(s1, s2, ...) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, __VA_ARGS__) -#else - #define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG(s1, s2, msg) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG_1(s1, s2, msg, \ - _0) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG_2(s1, s2, msg, \ - _0, _1) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG_3(s1, s2, msg, \ - _0, _1, _2) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG_4(s1, s2, msg, \ - _0, _1, _2, _3) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG_5(s1, s2, msg, \ - _0, _1, _2, _3, _4) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG_6(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG_7(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_STR_REQUIRE_EQUAL_NO_CASE_MSG_8(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_STR_CHECK_EQUAL_NO_CASE(s1, s2) \ - RX_STR_CHECK_EQUAL_NO_CASE_MSG(s1, s2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_STR_CHECK_EQUAL_NO_CASE_MSG(s1, s2, ...) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, __VA_ARGS__) -#else - #define RX_STR_CHECK_EQUAL_NO_CASE_MSG(s1, s2, msg) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_STR_CHECK_EQUAL_NO_CASE_MSG_1(s1, s2, msg, \ - _0) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_NO_CASE_MSG_2(s1, s2, msg, \ - _0, _1) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_NO_CASE_MSG_3(s1, s2, msg, \ - _0, _1, _2) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_NO_CASE_MSG_4(s1, s2, msg, \ - _0, _1, _2, _3) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_NO_CASE_MSG_5(s1, s2, msg, \ - _0, _1, _2, _3, _4) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_NO_CASE_MSG_6(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_STR_CHECK_EQUAL_NO_CASE_MSG_7(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_STR_CHECK_EQUAL_NO_CASE_MSG_8(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE(s1, s2) \ - RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG(s1, s2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG(s1, s2, ...) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, \ - __VA_ARGS__) -#else - #define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG(s1, s2, msg) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG_1(s1, s2, msg, \ - _0) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG_2(s1, s2, msg, \ - _0, _1) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG_3(s1, s2, msg, \ - _0, _1, _2) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG_4(s1, s2, msg, \ - _0, _1, _2, _3) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG_5(s1, s2, msg, \ - _0, _1, _2, _3, _4) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG_6(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG_7(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_STR_REQUIRE_NOT_EQUAL_NO_CASE_MSG_8(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STR_TEST_DEFINE( \ - RX_FATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE(s1, s2) \ - RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG(s1, s2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG(s1, s2, ...) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, \ - __VA_ARGS__) -#else - #define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG(s1, s2, msg) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG_1(s1, s2, msg, \ - _0) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG_2(s1, s2, msg, \ - _0, _1) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG_3(s1, s2, msg, \ - _0, _1, _2) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG_4(s1, s2, msg, \ - _0, _1, _2, _3) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG_5(s1, s2, msg, \ - _0, _1, _2, _3, _4) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG_6(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG_7(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_STR_CHECK_NOT_EQUAL_NO_CASE_MSG_8(s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STR_TEST_DEFINE( \ - RX_NONFATAL, RX__OP_NOT_EQUAL, RX__STR_CASE_IGNORE, s1, s2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -/* Pointer Assertions O-(''Q) - -------------------------------------------------------------------------- */ - -#if RX__HAS_VARIADIC_MACROS - #define RX__PTR_DEFINE_TEST(severity, op, x1, x2, ...) \ - rx__ptr_assess_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__PTR_DEFINE_TEST(severity, op, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__ptr_assess_comparison(RX_PARAM_CONTEXT, \ - (x1), \ - (x2), \ - op, \ - #x1, \ - #x2, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_PTR_REQUIRE_EQUAL(x1, x2) \ - RX_PTR_REQUIRE_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_PTR_REQUIRE_EQUAL_MSG(x1, x2, ...) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_PTR_REQUIRE_EQUAL_MSG(x1, x2, msg) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_PTR_REQUIRE_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_PTR_REQUIRE_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_PTR_REQUIRE_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_PTR_CHECK_EQUAL(x1, x2) \ - RX_PTR_CHECK_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_PTR_CHECK_EQUAL_MSG(x1, x2, ...) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_PTR_CHECK_EQUAL_MSG(x1, x2, msg) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_PTR_CHECK_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_PTR_CHECK_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_PTR_CHECK_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_PTR_CHECK_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_PTR_REQUIRE_NOT_EQUAL(x1, x2) \ - RX_PTR_REQUIRE_NOT_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_PTR_REQUIRE_NOT_EQUAL_MSG(x1, x2, ...) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_PTR_REQUIRE_NOT_EQUAL_MSG(x1, x2, msg) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_PTR_REQUIRE_NOT_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_NOT_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_NOT_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_NOT_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_NOT_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_NOT_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_PTR_REQUIRE_NOT_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_PTR_REQUIRE_NOT_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__PTR_DEFINE_TEST(RX_FATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_PTR_CHECK_NOT_EQUAL(x1, x2) \ - RX_PTR_CHECK_NOT_EQUAL_MSG(x1, x2, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_PTR_CHECK_NOT_EQUAL_MSG(x1, x2, ...) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, __VA_ARGS__) -#else - #define RX_PTR_CHECK_NOT_EQUAL_MSG(x1, x2, msg) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_PTR_CHECK_NOT_EQUAL_MSG_1(x1, x2, msg, \ - _0) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_NOT_EQUAL_MSG_2(x1, x2, msg, \ - _0, _1) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_NOT_EQUAL_MSG_3(x1, x2, msg, \ - _0, _1, _2) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_NOT_EQUAL_MSG_4(x1, x2, msg, \ - _0, _1, _2, _3) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_NOT_EQUAL_MSG_5(x1, x2, msg, \ - _0, _1, _2, _3, _4) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_PTR_CHECK_NOT_EQUAL_MSG_6(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_PTR_CHECK_NOT_EQUAL_MSG_7(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_PTR_CHECK_NOT_EQUAL_MSG_8(x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__PTR_DEFINE_TEST(RX_NONFATAL, RX__OP_NOT_EQUAL, x1, x2, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#if RX__HAS_VARIADIC_MACROS - #define RX__PTR_DEFINE_ALIGNMENT_TEST(severity, x, alignment, ...) \ - rx__ptr_assess_alignment(RX_PARAM_CONTEXT, \ - (x), \ - (alignment), \ - #x, \ - __FILE__, \ - __LINE__, \ - severity, \ - __VA_ARGS__) -#else - #define RX__PTR_DEFINE_ALIGNMENT_TEST(severity, x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - rx__ptr_assess_alignment(RX_PARAM_CONTEXT, \ - (x), \ - (alignment), \ - #x, \ - __FILE__, \ - __LINE__, \ - severity, \ - msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) -#endif - -#define RX_PTR_REQUIRE_ALIGNED(x, alignment) \ - RX_PTR_REQUIRE_ALIGNED_MSG(x, alignment, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_PTR_REQUIRE_ALIGNED_MSG(x, alignment, ...) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, __VA_ARGS__) -#else - #define RX_PTR_REQUIRE_ALIGNED_MSG(x, alignment, msg) \ - RX__PTR_DEFINE_ALIGNMENT_TEST( \ - RX_FATAL, x, alignment, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_PTR_REQUIRE_ALIGNED_MSG_1(x, alignment, msg, \ - _0) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_ALIGNED_MSG_2(x, alignment, msg, \ - _0, _1) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_ALIGNED_MSG_3(x, alignment, msg, \ - _0, _1, _2) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_ALIGNED_MSG_4(x, alignment, msg, \ - _0, _1, _2, _3) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_ALIGNED_MSG_5(x, alignment, msg, \ - _0, _1, _2, _3, _4) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_PTR_REQUIRE_ALIGNED_MSG_6(x, alignment, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_PTR_REQUIRE_ALIGNED_MSG_7(x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_PTR_REQUIRE_ALIGNED_MSG_8(x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_FATAL, x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -#define RX_PTR_CHECK_ALIGNED(x, alignment) \ - RX_PTR_CHECK_ALIGNED_MSG(x, alignment, NULL) - -#if RX__HAS_VARIADIC_MACROS - #define RX_PTR_CHECK_ALIGNED_MSG(x, alignment, ...) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, __VA_ARGS__) -#else - #define RX_PTR_CHECK_ALIGNED_MSG(x, alignment, msg) \ - RX__PTR_DEFINE_ALIGNMENT_TEST( \ - RX_NONFATAL, x, alignment, msg, \ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) -#endif - -#define RX_PTR_CHECK_ALIGNED_MSG_1(x, alignment, msg, \ - _0) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, msg, \ - _0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_ALIGNED_MSG_2(x, alignment, msg, \ - _0, _1) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, msg, \ - _0, _1, NULL, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_ALIGNED_MSG_3(x, alignment, msg, \ - _0, _1, _2) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, msg, \ - _0, _1, _2, NULL, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_ALIGNED_MSG_4(x, alignment, msg, \ - _0, _1, _2, _3) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, msg, \ - _0, _1, _2, _3, NULL, NULL, NULL, NULL) - -#define RX_PTR_CHECK_ALIGNED_MSG_5(x, alignment, msg, \ - _0, _1, _2, _3, _4) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, msg, \ - _0, _1, _2, _3, _4, NULL, NULL, NULL) - -#define RX_PTR_CHECK_ALIGNED_MSG_6(x, alignment, msg, \ - _0, _1, _2, _3, _4, _5) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, NULL, NULL) - -#define RX_PTR_CHECK_ALIGNED_MSG_7(x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6, NULL) - -#define RX_PTR_CHECK_ALIGNED_MSG_8(x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) \ - RX__PTR_DEFINE_ALIGNMENT_TEST(RX_NONFATAL, x, alignment, msg, \ - _0, _1, _2, _3, _4, _5, _6, _7) - -/* Implementation: Helpers O-(''Q) - -------------------------------------------------------------------------- */ - -#if defined(RX_ENABLE_DEBUGGING) \ - || (!defined(RX_DISABLE_DEBUGGING) && (defined(DEBUG) || !defined(NDEBUG))) - #define RX__DEBUGGING 1 -#else - #define RX__DEBUGGING 0 -#endif - -#if defined(_WIN32) - #define RX__PLATFORM_WINDOWS -#elif defined(__unix__) || defined(__APPLE__) - #define RX__PLATFORM_UNIX - #if defined(__APPLE__) - #define RX__PLATFORM_DARWIN - #elif defined(__linux__) - #define RX__PLATFORM_LINUX - #endif -#endif - -#include -#include -#include -#include -#include -#include -#include - -#ifndef RX_ASSERT - #include - #define RX_ASSERT assert -#endif - -#ifndef RX_MALLOC - #include - #define RX_MALLOC malloc -#endif - -#ifndef RX_REALLOC - #include - #define RX_REALLOC realloc -#endif - -#ifndef RX_FREE - #include - #define RX_FREE free -#endif - -#if defined(RX__PLATFORM_WINDOWS) - #include - #define RX__ISATTY _isatty - #define RX__FILENO _fileno -#else - #include - #define RX__ISATTY isatty - #define RX__FILENO fileno -#endif - -typedef char rx__invalid_size_type[sizeof(rx_size) == sizeof(size_t) ? 1 : -1]; - -#define RX__UNUSED(x) (void)(x) - -#define RX__REQUIRE_SEMICOLON void rx__dummy(void) - -#define RX__STRINGIFY(x) #x - -#define RX__EXPAND(x) x - -#define RX__CONCAT_(a, b) a##b -#define RX__CONCAT(a, b) RX__CONCAT_(a, b) - -#define RX__STRUCT_SET_MEMBER(x) (*obj) x; - -#define RX__STRUCT_UPDATE_0() - -#define RX__STRUCT_UPDATE_1(_0) \ - RX__STRUCT_SET_MEMBER(_0) - -#define RX__STRUCT_UPDATE_2(_0, _1) \ - RX__STRUCT_SET_MEMBER(_0) \ - RX__STRUCT_UPDATE_1(_1) - -#define RX__STRUCT_UPDATE_3(_0, _1, _2) \ - RX__STRUCT_SET_MEMBER(_0) \ - RX__STRUCT_UPDATE_2(_1, _2) - -#define RX__STRUCT_UPDATE_4(_0, _1, _2, _3) \ - RX__STRUCT_SET_MEMBER(_0) \ - RX__STRUCT_UPDATE_3(_1, _2, _3) - -#define RX__STRUCT_UPDATE_5(_0, _1, _2, _3, _4) \ - RX__STRUCT_SET_MEMBER(_0) \ - RX__STRUCT_UPDATE_4(_1, _2, _3, _4) - -#define RX__STRUCT_UPDATE_6(_0, _1, _2, _3, _4, _5) \ - RX__STRUCT_SET_MEMBER(_0) \ - RX__STRUCT_UPDATE_5(_1, _2, _3, _4, _5) - -#define RX__STRUCT_UPDATE_7(_0, _1, _2, _3, _4, _5, _6) \ - RX__STRUCT_SET_MEMBER(_0) \ - RX__STRUCT_UPDATE_6(_1, _2, _3, _4, _5, _6) - -#define RX__STRUCT_UPDATE_8(_0, _1, _2, _3, _4, _5, _6, _7) \ - RX__STRUCT_SET_MEMBER(_0) \ - RX__STRUCT_UPDATE_7(_1, _2, _3, _4, _5, _6, _7) - -#define RX__STRUCT_DEFINE_UPDATE_FN(id, type, arg_count, args) \ - static void \ - id(type *obj) \ - { \ - RX__UNUSED(obj); \ - RX__EXPAND(RX__CONCAT(RX__STRUCT_UPDATE_, arg_count) args) \ - } - -#if RX__HAS_VARIADIC_MACROS - #define RX__ARG( \ - _0, _1, _2, _3, _4, _5, _6, _7, \ - _8, ...) _8 - - #define RX__HAS_AT_LEAST_2_ARGS(...) \ - RX__EXPAND(RX__ARG( \ - __VA_ARGS__, \ - 1, 1, 1, 1, 1, 1, 1, 0,)) - - #define RX__HAS_AT_LEAST_3_ARGS(...) \ - RX__EXPAND(RX__ARG( \ - __VA_ARGS__, \ - 1, 1, 1, 1, 1, 1, 0, 0,)) - - #define RX__COUNT_ARGS(...) \ - RX__EXPAND(RX__ARG( \ - __VA_ARGS__, \ - 8, 7, 6, 5, 4, 3, 2, 1, \ - 0,)) -#endif - -#define RX__FIXTURE_DESC_GET_ID(id) \ - rx__fixture_desc_##id -#define RX__FIXTURE_GET_UPDATE_FN_ID(id) \ - rx__fixture_update_fn_##id - -#define RX__TEST_SUITE_DESC_GET_ID(id) \ - rx__test_suite_desc_##id -#define RX__TEST_SUITE_DESC_PTR_GET_ID(id) \ - rx__test_suite_desc_ptr_##id - -#define RX__TEST_CASE_DESC_GET_ID(suite_id, id) \ - rx__test_case_desc_##suite_id##_##id -#define RX__TEST_CASE_DESC_PTR_GET_ID(suite_id, id) \ - rx__test_case_desc_ptr_##suite_id##_##id - -#define RX__TEST_CASE_CONFIG_DESC_GET_ID(id) \ - rx__test_case_config_desc_##id -#define RX__TEST_CASE_CONFIG_BLUEPRINT_GET_UPDATE_FN_ID(id) \ - rx__test_case_config_blueprint_update_fn_##id - -typedef intmax_t rx__int; -typedef uintmax_t rx__uint; -typedef long double rx__real; - -struct rx_context { - jmp_buf env; - struct rx_summary *summary; -}; - -/* Implementation: Logger O-(''Q) - -------------------------------------------------------------------------- */ - -#if !defined(RX_DISABLE_LOG_STYLING) \ - && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 1 - #define RX__LOG_STYLING 1 -#else - #define RX__LOG_STYLING 0 -#endif - -#if defined(RX_SET_LOGGING_LEVEL_ALL) - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_ALL -#elif defined(RX_SET_LOGGING_LEVEL_DEBUG) - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_DEBUG -#elif defined(RX_SET_LOGGING_LEVEL_INFO) - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_INFO -#elif defined(RX_SET_LOGGING_LEVEL_WARNING) - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_WARNING -#elif defined(RX_SET_LOGGING_LEVEL_ERROR) - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_ERROR -#elif defined(RX_SET_LOGGING_LEVEL_FATAL) - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_FATAL -#elif defined(RX_SET_LOGGING_LEVEL_NONDE) - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_NONE -#elif RX__DEBUGGING - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_DEBUG -#else - #define RX__LOGGING_LEVEL RX_LOG_LEVEL_WARNING -#endif - -#if defined(RX_DISABLE_LOGGING) - #define RX__LOGGING 0 -#else - #define RX__LOGGING 1 -#endif - -#ifndef RX_LOG - #define RX_LOG rx__log -#endif - -#if defined(_MSC_VER) - #define RX__LOG(level, args) \ - do { \ - _Pragma("warning(push)") \ - _Pragma("warning(disable : 4127)") \ - if (RX__LOGGING && (level) <= RX__LOGGING_LEVEL) { \ - RX_LOG args; \ - } \ - _Pragma("warning(pop)") \ - } while (0) -#elif defined(__GNUC__) - #define RX__LOG(level, args) \ - do { \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wtautological-compare\"") \ - if (RX__LOGGING && (level) <= RX__LOGGING_LEVEL) { \ - RX_LOG args; \ - } \ - _Pragma("GCC diagnostic pop") \ - } while (0) -#else - #define RX__LOG(level, args) \ - do { \ - if (RX__LOGGING && (level) <= RX__LOGGING_LEVEL) { \ - RX_LOG args; \ - } \ - } while (0) -#endif - -#define RX__LOG_DEBUG(msg) \ - RX__LOG(RX_LOG_LEVEL_DEBUG, \ - (RX_LOG_LEVEL_DEBUG, __FILE__, __LINE__, msg)) -#define RX__LOG_DEBUG_1(fmt, _0) \ - RX__LOG(RX_LOG_LEVEL_DEBUG, \ - (RX_LOG_LEVEL_DEBUG, __FILE__, __LINE__, fmt, _0)) -#define RX__LOG_DEBUG_2(fmt, _0, _1) \ - RX__LOG(RX_LOG_LEVEL_DEBUG, \ - (RX_LOG_LEVEL_DEBUG, __FILE__, __LINE__, fmt, _0, _1)) - -#define RX__LOG_INFO(msg) \ - RX__LOG(RX_LOG_LEVEL_INFO, \ - (RX_LOG_LEVEL_INFO, __FILE__, __LINE__, msg)) -#define RX__LOG_INFO_1(fmt, _0) \ - RX__LOG(RX_LOG_LEVEL_INFO, \ - (RX_LOG_LEVEL_INFO, __FILE__, __LINE__, fmt, _0)) -#define RX__LOG_INFO_2(fmt, _0, _1) \ - RX__LOG(RX_LOG_LEVEL_INFO, \ - (RX_LOG_LEVEL_INFO, __FILE__, __LINE__, fmt, _0, _1)) - -#define RX__LOG_WARNING(msg) \ - RX__LOG(RX_LOG_LEVEL_WARNING, \ - (RX_LOG_LEVEL_WARNING, __FILE__, __LINE__, msg)) -#define RX__LOG_WARNING_1(fmt, _0) \ - RX__LOG(RX_LOG_LEVEL_WARNING, \ - (RX_LOG_LEVEL_WARNING, __FILE__, __LINE__, fmt, _0)) -#define RX__LOG_WARNING_2(fmt, _0, _1) \ - RX__LOG(RX_LOG_LEVEL_WARNING, \ - (RX_LOG_LEVEL_WARNING, __FILE__, __LINE__, fmt, _0, _1)) - -#define RX__LOG_ERROR(msg) \ - RX__LOG(RX_LOG_LEVEL_ERROR, \ - (RX_LOG_LEVEL_ERROR, __FILE__, __LINE__, msg)) -#define RX__LOG_ERROR_1(fmt, _0) \ - RX__LOG(RX_LOG_LEVEL_ERROR, \ - (RX_LOG_LEVEL_ERROR, __FILE__, __LINE__, fmt, _0)) -#define RX__LOG_ERROR_2(fmt, _0, _1) \ - RX__LOG(RX_LOG_LEVEL_ERROR, \ - (RX_LOG_LEVEL_ERROR, __FILE__, __LINE__, fmt, _0, _1)) - -#define RX__LOG_FATAL(msg) \ - RX__LOG(RX_LOG_LEVEL_FATAL, \ - (RX_LOG_LEVEL_FATAL, __FILE__, __LINE__, msg)) -#define RX__LOG_FATAL_1(fmt, _0) \ - RX__LOG(RX_LOG_LEVEL_FATAL, \ - (RX_LOG_LEVEL_FATAL, __FILE__, __LINE__, fmt, _0)) -#define RX__LOG_FATAL_2(fmt, _0, _1) \ - RX__LOG(RX_LOG_LEVEL_FATAL, \ - (RX_LOG_LEVEL_FATAL, __FILE__, __LINE__, fmt, _0, _1)) - -#if RX__LOG_STYLING -enum rx__log_style { - RX__LOG_STYLE_RESET = 0, - RX__LOG_STYLE_BLACK = 1, - RX__LOG_STYLE_RED = 2, - RX__LOG_STYLE_GREEN = 3, - RX__LOG_STYLE_YELLOW = 4, - RX__LOG_STYLE_BLUE = 5, - RX__LOG_STYLE_MAGENTA = 6, - RX__LOG_STYLE_CYAN = 7, - RX__LOG_STYLE_BRIGHT_BLACK = 8, - RX__LOG_STYLE_BRIGHT_RED = 9, - RX__LOG_STYLE_BRIGHT_GREEN = 10, - RX__LOG_STYLE_BRIGHT_YELLOW = 11, - RX__LOG_STYLE_BRIGHT_BLUE = 12, - RX__LOG_STYLE_BRIGHT_MAGENTA = 13, - RX__LOG_STYLE_BRIGHT_CYAN = 14 -}; -#endif - -static void -rx__log_level_get_name(const char **name, enum rx_log_level level) -{ - RX_ASSERT(name != NULL); - - switch (level) { - case RX_LOG_LEVEL_FATAL: - *name = "fatal"; - return; - case RX_LOG_LEVEL_ERROR: - *name = "error"; - return; - case RX_LOG_LEVEL_WARNING: - *name = "warning"; - return; - case RX_LOG_LEVEL_INFO: - *name = "info"; - return; - case RX_LOG_LEVEL_DEBUG: - *name = "debug"; - return; - default: - RX_ASSERT(0); - } -} - -#if RX__LOG_STYLING -static void -rx__log_level_get_style(enum rx__log_style *style, enum rx_log_level level) -{ - RX_ASSERT(style != NULL); - - switch (level) { - case RX_LOG_LEVEL_FATAL: - *style = RX__LOG_STYLE_BRIGHT_MAGENTA; - return; - case RX_LOG_LEVEL_ERROR: - *style = RX__LOG_STYLE_BRIGHT_RED; - return; - case RX_LOG_LEVEL_WARNING: - *style = RX__LOG_STYLE_BRIGHT_YELLOW; - return; - case RX_LOG_LEVEL_INFO: - *style = RX__LOG_STYLE_BRIGHT_GREEN; - return; - case RX_LOG_LEVEL_DEBUG: - *style = RX__LOG_STYLE_BRIGHT_CYAN; - return; - default: - RX_ASSERT(0); - }; -} - -static void -rx__log_style_get_ansi_code(const char **code, enum rx__log_style style) -{ - RX_ASSERT(code != NULL); - - switch (style) { - case RX__LOG_STYLE_RESET: - *code = "\x1b[0m"; - return; - case RX__LOG_STYLE_BLACK: - *code = "\x1b[30m"; - return; - case RX__LOG_STYLE_RED: - *code = "\x1b[31m"; - return; - case RX__LOG_STYLE_GREEN: - *code = "\x1b[32m"; - return; - case RX__LOG_STYLE_YELLOW: - *code = "\x1b[33m"; - return; - case RX__LOG_STYLE_BLUE: - *code = "\x1b[34m"; - return; - case RX__LOG_STYLE_MAGENTA: - *code = "\x1b[35m"; - return; - case RX__LOG_STYLE_CYAN: - *code = "\x1b[36m"; - return; - case RX__LOG_STYLE_BRIGHT_BLACK: - *code = "\x1b[1;30m"; - return; - case RX__LOG_STYLE_BRIGHT_RED: - *code = "\x1b[1;31m"; - return; - case RX__LOG_STYLE_BRIGHT_GREEN: - *code = "\x1b[1;32m"; - return; - case RX__LOG_STYLE_BRIGHT_YELLOW: - *code = "\x1b[1;33m"; - return; - case RX__LOG_STYLE_BRIGHT_BLUE: - *code = "\x1b[1;34m"; - return; - case RX__LOG_STYLE_BRIGHT_MAGENTA: - *code = "\x1b[1;35m"; - return; - case RX__LOG_STYLE_BRIGHT_CYAN: - *code = "\x1b[1;36m"; - return; - default: - RX_ASSERT(0); - } -} -#endif /* RX__LOG_STYLING */ - -RX__PRINTF_CHECK(4, 5) -static void -rx__log(enum rx_log_level level, - const char *file, - int line, - const char *fmt, - ...) -{ - const char *level_name; - const char *level_style_begin; - const char *level_style_end; - va_list args; - - RX_ASSERT(file != NULL); - RX_ASSERT(fmt != NULL); - - rx__log_level_get_name(&level_name, level); - -#if RX__LOG_STYLING - if (RX__ISATTY(RX__FILENO(stderr))) { - enum rx__log_style level_style; - - rx__log_level_get_style(&level_style, level); - rx__log_style_get_ansi_code(&level_style_begin, level_style); - rx__log_style_get_ansi_code(&level_style_end, RX__LOG_STYLE_RESET); - } else { - level_style_begin = level_style_end = ""; - } -#else - level_style_begin = level_style_end = ""; -#endif - - va_start(args, fmt); - fprintf(stderr, - "%s:%d: %s%s%s: ", - file, - line, - level_style_begin, - level_name, - level_style_end); - vfprintf(stderr, fmt, args); - va_end(args); -} - -/* Implementation: Timer O-(''Q) - -------------------------------------------------------------------------- */ - -#define RX__TICKS_PER_SECOND 1000000000ul -#define RX__TICKS_PER_MICROSECOND 1000ul - -#if defined(RX__PLATFORM_WINDOWS) - #define WIN32_LEAN_AND_MEAN - #include -#elif defined(RX__PLATFORM_DARWIN) - #include - #include -#elif defined(RX__PLATFORM_UNIX) - #include - #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L - #include - #define RX__USE_CLOCK_GETTIME - #if defined(CLOCK_MONOTONIC_RAW) - #define RX__CLOCK_ID CLOCK_MONOTONIC_RAW - #elif defined(CLOCK_MONOTONIC) - #define RX__CLOCK_ID CLOCK_MONOTONIC - #else - #define RX__CLOCK_ID CLOCK_REALTIME - #endif - #else - #include - #endif -#else - typedef char rx__unsupported_platform[-1]; -#endif - -static enum rx_status -rx__get_real_time(uint64_t *time) -{ - RX_ASSERT(time != NULL); - -#if defined(RX__PLATFORM_WINDOWS) - { - static double time_to_nano; - LARGE_INTEGER counter; - - if (time_to_nano == 0.0) { - LARGE_INTEGER frequency; - - if (!QueryPerformanceFrequency(&frequency)) { - RX__LOG_DEBUG("failed to retrieve the timer's frequency\n"); - return RX_ERROR; - } - - time_to_nano = (double)RX__TICKS_PER_SECOND / frequency.QuadPart; - } - - if (!QueryPerformanceCounter(&counter)) { - RX__LOG_DEBUG("failed to retrieve the current time\n"); - return RX_ERROR; - } - - *time = (uint64_t)(counter.QuadPart * time_to_nano); - return RX_SUCCESS; - } -#elif defined(RX__PLATFORM_DARWIN) - /* - Since Darwin 5.2, `clock_gettime()` can return high resolution times - with the `CLOCK_UPTIME_RAW` clock but it internally only calls - `mach_absolute_time()` with the overhead of converting the result into - the `timespec` format. - */ - { - static uint64_t time_to_nano; - - if (time_to_nano == 0) { - mach_timebase_info_data_t info; - - if (mach_timebase_info(&info) != KERN_SUCCESS) { - RX__LOG_DEBUG("failed to retrieve the current time\n"); - return RX_ERROR; - } - - time_to_nano = info.numer / info.denom; - } - - *time = mach_absolute_time() * time_to_nano; - return RX_SUCCESS; - } -#elif defined(RX__PLATFORM_UNIX) - #if defined(RX__USE_CLOCK_GETTIME) - { - struct timespec t; - - if (clock_gettime(RX__CLOCK_ID, &t) != 0) { - RX__LOG_DEBUG("failed to retrieve the current time\n"); - return RX_ERROR; - } - - *time = (uint64_t)t.tv_sec * RX__TICKS_PER_SECOND + (uint64_t)t.tv_nsec; - return RX_SUCCESS; - } - #else - { - struct timeval t; - - if (gettimeofday(&t, NULL) != 0) { - RX__LOG_DEBUG("failed to retrieve the current time\n"); - return RX_ERROR; - } - - *time = (uint64_t)t.tv_sec * RX__TICKS_PER_SECOND - + (uint64_t)t.tv_usec * RX__TICKS_PER_MICROSECOND; - return RX_SUCCESS; - } - #endif -#else - RX__LOG_DEBUG("platform not supported\n"); - return RX_ERROR; -#endif -} - -/* Implementation: Test Failure Array O-(''Q) - -------------------------------------------------------------------------- */ - -/* - Simple implementation for dynamic arrays that can grow and stretch at - runtime. The object returned to the user is a standard pointer to a C array - but the implementation also allocates a header to keep track of the size - and the capacity. - - The memory layout is better represented by the diagram below. - - block user pointer - / / - +--------+--------+ - | header | buffer | - +--------+--------+ - - The block points to the whole memory being allocated while the buffer - represents the actual array exposed to the user. -*/ - -#define RX__DYN_ARRAY_GET_BLOCK(buf) \ - ((void *)&((struct rx__dyn_array_header *)(buf))[-1]) -#define RX__DYN_ARRAY_GET_HEADER(block) \ - ((struct rx__dyn_array_header *)(block)) -#define RX__DYN_ARRAY_GET_BUFFER(block) \ - ((void *)&((struct rx__dyn_array_header *)(block))[1]) -#define RX__DYN_ARRAY_GET_CONST_BLOCK(buf) \ - ((const void *)&((const struct rx__dyn_array_header *)(buf))[-1]) -#define RX__DYN_ARRAY_GET_CONST_HEADER(block) \ - ((const struct rx__dyn_array_header *)(block)) - -struct rx__dyn_array_header { - size_t size; - size_t capacity; -}; - -static const size_t rx__test_failure_array_max_capacity - = (((size_t)-1 - sizeof(struct rx__dyn_array_header)) - / sizeof(struct rx_failure)); - -static void -rx__dyn_array_get_new_capacity(size_t *capacity, - size_t current, - size_t requested, - size_t max) -{ - *capacity = current + current / 2 + 1; - if (*capacity < current) { - *capacity = max; - return; - } - - if (*capacity < requested) { - *capacity = requested; - } -} - -static enum rx_status -rx__dyn_array_ensure_has_enough_capacity(void **block, - size_t current_capacity, - size_t requested_capacity, - size_t max_capacity, - size_t element_size) -{ - void *buf; - size_t new_capacity; - - RX_ASSERT(block != NULL); - RX_ASSERT(element_size > 0); - - if (requested_capacity > max_capacity) { - RX__LOG_DEBUG("the requested capacity is too large\n"); - return RX_ERROR_MAX_SIZE_EXCEEDED; - } - - if (*block != NULL && current_capacity >= requested_capacity) { - return RX_SUCCESS; - } - - rx__dyn_array_get_new_capacity( - &new_capacity, current_capacity, requested_capacity, max_capacity); - RX_ASSERT(new_capacity >= requested_capacity); - RX_ASSERT(new_capacity <= max_capacity); - - buf = RX_REALLOC( - *block, - sizeof(struct rx__dyn_array_header) + element_size * new_capacity); - if (buf == NULL) { - RX__LOG_DEBUG("failed to reallocate the block\n"); - return RX_ERROR_ALLOCATION; - } - - RX__DYN_ARRAY_GET_HEADER(buf)->capacity = new_capacity; - *block = buf; - return RX_SUCCESS; -} - -static enum rx_status -rx__test_failure_array_create(struct rx_failure **array, size_t size) -{ - void *block; - size_t capacity; - - RX_ASSERT(array != NULL); - - rx__dyn_array_get_new_capacity( - &capacity, 0, size, rx__test_failure_array_max_capacity); - RX_ASSERT(capacity >= size); - RX_ASSERT(capacity <= rx__test_failure_array_max_capacity); - - block = RX_MALLOC(sizeof(struct rx__dyn_array_header) - + sizeof(struct rx_failure) * capacity); - if (block == NULL) { - RX__LOG_DEBUG_1("failed to reserve a large enough capacity for " - "the test failure array (requested capacity: %lu)\n", - (unsigned long)size); - return RX_ERROR_ALLOCATION; - } - - RX__DYN_ARRAY_GET_HEADER(block)->size = size; - RX__DYN_ARRAY_GET_HEADER(block)->capacity = capacity; - *array = (struct rx_failure *)RX__DYN_ARRAY_GET_BUFFER(block); - return RX_SUCCESS; -} - -static void -rx__test_failure_array_destroy(struct rx_failure *array) -{ - RX_FREE(RX__DYN_ARRAY_GET_BLOCK(array)); -} - -static void -rx__test_failure_array_get_size(size_t *size, const struct rx_failure *array) -{ - RX_ASSERT(array != NULL); - - *size = RX__DYN_ARRAY_GET_CONST_HEADER(RX__DYN_ARRAY_GET_CONST_BLOCK(array)) - ->size; -} - -static enum rx_status -rx__test_failure_array_extend_back(struct rx_failure **slice, - struct rx_failure **array, - size_t size) -{ - enum rx_status status; - void *block; - size_t pos; - - RX_ASSERT(array != NULL); - RX_ASSERT(*array != NULL); - - block = RX__DYN_ARRAY_GET_BLOCK(*array); - status = rx__dyn_array_ensure_has_enough_capacity( - &block, - RX__DYN_ARRAY_GET_HEADER(block)->capacity, - RX__DYN_ARRAY_GET_HEADER(block)->size + size, - rx__test_failure_array_max_capacity, - sizeof(struct rx_failure)); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_1( - "failed to reserve a large enough capacity for " - "the test failure array (requested capacity: %lu)\n", - (unsigned long)RX__DYN_ARRAY_GET_HEADER(block)->size + size); - return status; - } - - RX_ASSERT(block != NULL); - - *array = (struct rx_failure *)RX__DYN_ARRAY_GET_BUFFER(block); - - pos = RX__DYN_ARRAY_GET_HEADER(block)->size; - memmove(&(*array)[pos + size], - &(*array)[pos], - sizeof(struct rx_failure) - * (RX__DYN_ARRAY_GET_HEADER(block)->size - pos)); - - if (slice != NULL) { - *slice = &(*array)[pos]; - } - - RX__DYN_ARRAY_GET_HEADER(block)->size += size; - return RX_SUCCESS; -} - -/* Implementation: Memory Sections O-(''Q) - -------------------------------------------------------------------------- */ - -/* - Compiler-specific code that allows grouping objects into specific - data sections, thus enabling automatic discovery by iterating over - anything registered in these sections. -*/ - -#if defined(_MSC_VER) - __pragma(section("rxsuite$a", read)) - __pragma(section("rxsuite$b", read)) - __pragma(section("rxsuite$c", read)) - - __declspec(allocate("rxsuite$a")) - const struct rx__test_suite_desc * const rx__test_suite_section_begin - = NULL; - - __declspec(allocate("rxsuite$c")) - const struct rx__test_suite_desc * const rx__test_suite_section_end - = NULL; - - #define RX__TEST_SUITE_REGISTER(name) \ - __declspec(allocate("rxsuite$b")) \ - const struct rx__test_suite_desc * const \ - RX__TEST_SUITE_DESC_PTR_GET_ID(name) \ - = &RX__TEST_SUITE_DESC_GET_ID(name) - - #define RX__TEST_SUITE_SECTION_BEGIN (&rx__test_suite_section_begin + 1) - #define RX__TEST_SUITE_SECTION_END (&rx__test_suite_section_end) -#else - #if defined(RX__PLATFORM_DARWIN) - extern const struct rx__test_suite_desc * const __start_rxsuite \ - __asm("section$start$__DATA$rxsuite"); - extern const struct rx__test_suite_desc * const __stop_rxsuite \ - __asm("section$end$__DATA$rxsuite"); - - #define RX__TEST_SUITE_SECTION \ - __attribute__((used,section("__DATA,rxsuite"))) - #else - extern const struct rx__test_suite_desc * const __start_rxsuite; - extern const struct rx__test_suite_desc * const __stop_rxsuite; - - #define RX__TEST_SUITE_SECTION \ - __attribute__((used,section("rxsuite"))) - #endif - - RX__TEST_SUITE_SECTION - static const struct rx__test_suite_desc * const rx__dummy_suite = NULL; - - #define RX__TEST_SUITE_REGISTER(name) \ - RX__TEST_SUITE_SECTION \ - const struct rx__test_suite_desc * const \ - RX__TEST_SUITE_DESC_PTR_GET_ID(name) \ - = &RX__TEST_SUITE_DESC_GET_ID(name) - - #define RX__TEST_SUITE_SECTION_BEGIN (&__start_rxsuite) - #define RX__TEST_SUITE_SECTION_END (&__stop_rxsuite) -#endif - -#if defined(_MSC_VER) - __pragma(section("rxcase$a", read)) - __pragma(section("rxcase$b", read)) - __pragma(section("rxcase$c", read)) - - __declspec(allocate("rxcase$a")) - const struct rx__test_case_desc * const rx__test_case_section_begin - = NULL; - - __declspec(allocate("rxcase$c")) - const struct rx__test_case_desc * const rx__test_case_section_end - = NULL; - - #define RX__TEST_CASE_REGISTER(suite_name, name) \ - __declspec(allocate("rxcase$b")) \ - const struct rx__test_case_desc * const \ - RX__TEST_CASE_DESC_PTR_GET_ID(suite_name, name) \ - = &RX__TEST_CASE_DESC_GET_ID(suite_name, name) - - #define RX__TEST_CASE_SECTION_BEGIN (&rx__test_case_section_begin + 1) - #define RX__TEST_CASE_SECTION_END (&rx__test_case_section_end) -#else - #if defined(RX__PLATFORM_DARWIN) - extern const struct rx__test_case_desc * const __start_rxcase \ - __asm("section$start$__DATA$rxcase"); - extern const struct rx__test_case_desc * const __stop_rxcase \ - __asm("section$end$__DATA$rxcase"); - - #define RX__TEST_CASE_SECTION \ - __attribute__((used,section("__DATA,rxcase"))) - #else - extern const struct rx__test_case_desc * const __start_rxcase; - extern const struct rx__test_case_desc * const __stop_rxcase; - - #define RX__TEST_CASE_SECTION \ - __attribute__((used,section("rxcase"))) - #endif - - RX__TEST_CASE_SECTION - static const struct rx__test_case_desc * const rx__dummy_case = NULL; - - #define RX__TEST_CASE_REGISTER(suite_name, name) \ - RX__TEST_CASE_SECTION \ - const struct rx__test_case_desc * const \ - RX__TEST_CASE_DESC_PTR_GET_ID(suite_name, name) \ - = &RX__TEST_CASE_DESC_GET_ID(suite_name, name) - - #define RX__TEST_CASE_SECTION_BEGIN (&__start_rxcase) - #define RX__TEST_CASE_SECTION_END (&__stop_rxcase) -#endif - -/* Implementation: Fixture O-(''Q) - -------------------------------------------------------------------------- */ - -typedef void (*rx__fixture_config_update_fn)( - struct rx_fixture_config *); - -struct rx__fixture_desc { - rx_size size; - const rx__fixture_config_update_fn update; -}; - -#define RX__FIXTURE_(id, size, update_fn) \ - static const struct rx__fixture_desc \ - RX__FIXTURE_DESC_GET_ID(id) \ - = {size, update_fn}; \ - \ - static const struct rx__fixture_desc \ - *id = &RX__FIXTURE_DESC_GET_ID(id); - -#define RX__FIXTURE_0(id, size) \ - RX__FIXTURE_(id, size, NULL) - -#define RX__FIXTURE_1(id, size, arg_count, args) \ - RX__STRUCT_DEFINE_UPDATE_FN( \ - RX__FIXTURE_GET_UPDATE_FN_ID(id), \ - struct rx_fixture_config, \ - arg_count, \ - args) \ - \ - RX__FIXTURE_(id, size, &RX__FIXTURE_GET_UPDATE_FN_ID(id)) - -/* Implementation: Test Case Config O-(''Q) - -------------------------------------------------------------------------- */ - -struct rx__test_case_config_blueprint { - int skip; - const struct rx__fixture_desc *fixture; -}; - -typedef void (*rx__test_case_config_blueprint_update_fn)( - struct rx__test_case_config_blueprint *); - -struct rx__test_case_config_desc { - const rx__test_case_config_blueprint_update_fn update; -}; - -#define RX__TEST_CASE_CONFIG(id, arg_count, args) \ - RX__STRUCT_DEFINE_UPDATE_FN( \ - RX__TEST_CASE_CONFIG_BLUEPRINT_GET_UPDATE_FN_ID(id), \ - struct rx__test_case_config_blueprint, \ - arg_count, \ - args) \ - \ - static const struct rx__test_case_config_desc \ - RX__TEST_CASE_CONFIG_DESC_GET_ID(id) \ - = {RX__TEST_CASE_CONFIG_BLUEPRINT_GET_UPDATE_FN_ID(id)}; - -/* Implementation: Test Suite O-(''Q) - -------------------------------------------------------------------------- */ - -struct rx__test_suite_desc { - const char *name; - const struct rx__test_case_config_desc *config_desc; -}; - -#define RX__TEST_SUITE_(id, config_desc) \ - static const struct rx__test_suite_desc \ - RX__TEST_SUITE_DESC_GET_ID(id) \ - = {#id, config_desc}; \ - \ - RX__TEST_SUITE_REGISTER(id) - -#define RX__TEST_SUITE_0(id) \ - RX__TEST_SUITE_(id, NULL); - -#define RX__TEST_SUITE_1(id, arg_count, args) \ - RX__TEST_CASE_CONFIG(id, arg_count, args) \ - RX__TEST_SUITE_(id, &RX__TEST_CASE_CONFIG_DESC_GET_ID(id)); - -/* Implementation: Test Case O-(''Q) - -------------------------------------------------------------------------- */ - -struct rx__test_case_desc { - const char *suite_name; - const char *name; - rx_run_fn run; - const struct rx__test_case_config_desc *config_desc; -}; - -#define RX__TEST_CASE_(suite_id, id, config_desc) \ - static void \ - suite_id##_##id(RX__DEFINE_PARAMS(void)); \ - \ - static const struct rx__test_case_desc \ - RX__TEST_CASE_DESC_GET_ID(suite_id, id) \ - = {#suite_id, \ - #id, \ - suite_id##_##id, \ - config_desc}; \ - \ - RX__TEST_CASE_REGISTER(suite_id, id); \ - \ - static void \ - suite_id##_##id(RX__DEFINE_PARAMS(void)) - -#define RX__TEST_CASE_0(suite_id, id) \ - RX__TEST_CASE_(suite_id, \ - id, \ - NULL) - -#define RX__TEST_CASE_1(suite_id, id, arg_count, args) \ - RX__TEST_CASE_CONFIG(suite_id##_##id, arg_count, args) \ - RX__TEST_CASE_(suite_id, \ - id, \ - &RX__TEST_CASE_CONFIG_DESC_GET_ID(suite_id##_##id)) - -/* Implementation: Operators O-(''Q) - -------------------------------------------------------------------------- */ - -enum rx__op { - RX__OP_EQUAL = 0, - RX__OP_NOT_EQUAL = 1, - RX__OP_GREATER = 2, - RX__OP_LESSER = 3, - RX__OP_GREATER_OR_EQUAL = 4, - RX__OP_LESSER_OR_EQUAL = 5 -}; - -static void -rx__op_get_symbol(const char **symbol, enum rx__op op) -{ - RX_ASSERT(symbol != NULL); - - switch (op) { - case RX__OP_EQUAL: - *symbol = "=="; - return; - case RX__OP_NOT_EQUAL: - *symbol = "!="; - return; - case RX__OP_GREATER: - *symbol = ">"; - return; - case RX__OP_LESSER: - *symbol = "<"; - return; - case RX__OP_GREATER_OR_EQUAL: - *symbol = ">="; - return; - case RX__OP_LESSER_OR_EQUAL: - *symbol = "<="; - return; - default: - RX_ASSERT(0); - } -} - -static void -rx__op_get_name(const char **name, enum rx__op op) -{ - RX_ASSERT(name != NULL); - - switch (op) { - case RX__OP_EQUAL: - *name = "equal to"; - return; - case RX__OP_NOT_EQUAL: - *name = "not equal to"; - return; - case RX__OP_GREATER: - *name = "greater than"; - return; - case RX__OP_LESSER: - *name = "less than"; - return; - case RX__OP_GREATER_OR_EQUAL: - *name = "greater than or equal to"; - return; - case RX__OP_LESSER_OR_EQUAL: - *name = "less than or equal to"; - return; - default: - RX_ASSERT(0); - } -} - -/* Implementation: String O-(''Q) - -------------------------------------------------------------------------- */ - -#define RX__STR_LENGTH_ID rx__length - -#define RX__STR_CREATE_VA_LIST(status, s, fmt) \ - do { \ - va_list args; \ - size_t RX__STR_LENGTH_ID; \ - \ - (s) = NULL; \ - \ - va_start(args, fmt); \ - (status) \ - = rx__str_initialize_va_list(&RX__STR_LENGTH_ID, s, fmt, args); \ - va_end(args); \ - \ - if ((status) == RX_SUCCESS) { \ - (s) = (char *)RX_MALLOC(sizeof *(s) * RX__STR_LENGTH_ID); \ - if ((s) == NULL) { \ - RX__LOG_DEBUG_1( \ - "failed to allocate the string (%lu bytes)\n", \ - (unsigned long)sizeof *(s) * RX__STR_LENGTH_ID); \ - (status) = RX_ERROR_ALLOCATION; \ - } else { \ - va_start(args, fmt); \ - (status) = rx__str_initialize_va_list( \ - &RX__STR_LENGTH_ID, s, fmt, args); \ - va_end(args); \ - if ((status) != RX_SUCCESS) { \ - RX_FREE(s); \ - } \ - } \ - } \ - } while (0) - -#define RX__STR_CREATE_(status, s, args) \ - do { \ - size_t RX__STR_LENGTH_ID; \ - \ - (s) = NULL; \ - (status) = rx__str_initialize args; \ - if ((status) == RX_SUCCESS) { \ - (s) = (char *)RX_MALLOC(sizeof *(s) * RX__STR_LENGTH_ID); \ - if ((s) == NULL) { \ - RX__LOG_DEBUG_1( \ - "failed to allocate the string (%lu bytes)\n", \ - (unsigned long)sizeof *(s) * RX__STR_LENGTH_ID); \ - (status) = RX_ERROR_ALLOCATION; \ - } else { \ - (status) = rx__str_initialize args; \ - if ((status) != RX_SUCCESS) { \ - RX_FREE(s); \ - } \ - } \ - } \ - } while (0) - -#define RX__STR_CREATE(status, s, msg) \ - RX__STR_CREATE_(status, s, (&RX__STR_LENGTH_ID, s, msg)) - -#define RX__STR_CREATE_1(status, s, fmt, _0) \ - RX__STR_CREATE_(status, s, (&RX__STR_LENGTH_ID, s, fmt, _0)) - -#define RX__STR_CREATE_2(status, s, fmt, _0, _1) \ - RX__STR_CREATE_(status, s, (&RX__STR_LENGTH_ID, s, fmt, _0, _1)) - -#define RX__STR_CREATE_3(status, s, fmt, _0, _1, _2) \ - RX__STR_CREATE_(status, s, (&RX__STR_LENGTH_ID, s, fmt, _0, _1, _2)) - -#define RX__STR_CREATE_4(status, s, fmt, _0, _1, _2, _3) \ - RX__STR_CREATE_(status, s, (&RX__STR_LENGTH_ID, s, fmt, _0, _1, _2, _3)) - -enum rx__str_case { RX__STR_CASE_OBEY = 0, RX__STR_CASE_IGNORE = 1 }; - -static void -rx__str_case_get_type(const char **type, enum rx__str_case str_case) -{ - RX_ASSERT(type != NULL); - - switch (str_case) { - case RX__STR_CASE_OBEY: - *type = "obey"; - return; - case RX__STR_CASE_IGNORE: - *type = "ignore"; - return; - default: - RX_ASSERT(0); - } -} - -RX__PRINTF_CHECK(3, 0) -static enum rx_status -rx__str_initialize_va_list(size_t *count, - char *s, - const char *fmt, - va_list args) -{ - int size; - - RX_ASSERT(count != NULL); - - if (s == NULL) { -#if defined(RX__PLATFORM_WINDOWS) - size = _vscprintf(fmt, args); -#elif RX__HAS_NPRINTF - size = vsnprintf(NULL, 0, fmt, args); -#else - { - FILE *file; - - file = fopen("/dev/null", "w"); - if (file == NULL) { - RX__LOG_DEBUG("could not open `/dev/null`\n"); - return RX_ERROR; - } - - size = vfprintf(file, fmt, args); - fclose(file); - } -#endif - - if (size < 0) { - RX__LOG_DEBUG("invalid string formatting\n"); - return RX_ERROR; - } - - *count = (size_t)size + 1; - return RX_SUCCESS; - } - -#if defined(_MSC_VER) - #pragma warning(push) - #pragma warning(disable : 4996) -#endif - size = vsprintf(s, fmt, args); -#if defined(_MSC_VER) - #pragma warning(pop) -#endif - if (size < 0) { - RX__LOG_DEBUG("unexpected string formatting error\n"); - return RX_ERROR; - } - - *count = (size_t)size + 1; - return RX_SUCCESS; -} - -RX__PRINTF_CHECK(3, 4) -static enum rx_status -rx__str_initialize(size_t *count, char *s, const char *fmt, ...) -{ - enum rx_status out; - va_list args; - - RX_ASSERT(count != NULL); - - va_start(args, fmt); - out = rx__str_initialize_va_list(count, s, fmt, args); - va_end(args); - - return out; -} - -static enum rx_status -rx__str_copy(char **s, const char *original) -{ - size_t size; - - size = strlen(original) + 1; - - *s = (char *)RX_MALLOC(sizeof **s * size); - if (*s == NULL) { - RX__LOG_DEBUG_1("failed to allocate the string (%lu bytes)\n", - (unsigned long)sizeof **s * size); - return RX_ERROR_ALLOCATION; - } - - memcpy(*s, original, size); - return RX_SUCCESS; -} - -/* Implementation: Helpers O-(''Q) - -------------------------------------------------------------------------- */ - -static int -rx__compare_test_cases(const void *a, const void *b) -{ - int out; - const struct rx_test_case *aa; - const struct rx_test_case *bb; - - aa = (const struct rx_test_case *)a; - bb = (const struct rx_test_case *)b; - - out = strcmp(aa->suite_name, bb->suite_name); - if (out != 0) { - return out; - } - - return strcmp(aa->name, bb->name); -} - -static int -rx__compare_summaries_by_test_suite(const void *a, const void *b) -{ - const struct rx_summary *aa; - const struct rx_summary *bb; - - aa = (const struct rx_summary *)a; - bb = (const struct rx_summary *)b; - return strcmp(aa->test_case->suite_name, bb->test_case->suite_name); -} - -static void -rx__real_are_equal_fuzzy(int *result, rx__real a, rx__real b, rx__real tol) -{ - rx__real diff; - rx__real abs_a; - rx__real abs_b; - - diff = a > b ? a - b : b - a; - if (diff <= tol) { - *result = 1; - return; - } - - abs_a = a < 0 ? -a : a; - abs_b = b < 0 ? -b : b; - *result = diff <= (abs_a > abs_b ? abs_a : abs_b) * tol; -} - -static void -rx__str_are_equal(int *result, const char *a, const char *b) -{ - while (*a != '\0') { - if (*a != *b) { - *result = 0; - return; - } - - ++a; - ++b; - } - - *result = *a == *b; -} - -static void -rx__str_are_equal_no_case(int *result, const char *a, const char *b) -{ - while (*a != '\0') { - if (tolower(*a) != tolower(*b)) { - *result = 0; - return; - } - - ++a; - ++b; - } - - *result = tolower(*a) == tolower(*b); -} - -RX__MAYBE_UNUSED static enum rx_status -rx__run_test_cases(size_t test_case_count, - const struct rx_test_case *test_cases) -{ - size_t i; - enum rx_status status; - struct rx_summary *summaries; - - if (test_case_count == 0) { - RX__LOG_INFO("nothing to run\n"); - return RX_SUCCESS; - } - - RX_ASSERT(test_cases != NULL); - - summaries = (struct rx_summary *)RX_MALLOC(sizeof *summaries - * test_case_count); - if (summaries == NULL) { - RX__LOG_DEBUG("failed to allocate the summaries\n"); - return RX_ERROR_ALLOCATION; - } - - status = RX_SUCCESS; - - for (i = 0; i < test_case_count;) { - const struct rx_test_case *test_case; - struct rx_summary *summary; - - test_case = &test_cases[i]; - summary = &summaries[i]; - - RX_ASSERT(test_case->suite_name != NULL); - RX_ASSERT(test_case->name != NULL); - - status = rx_summary_initialize(summary, test_case); - if (status != RX_SUCCESS) { - RX__LOG_ERROR_2("failed to initialize the summary " - "(suite: \"%s\", case: \"%s\")\n", - test_case->suite_name, - test_case->name); - goto summaries_cleanup; - } - - ++i; - - status = rx_test_case_run(summary, test_case); - if (status != RX_SUCCESS) { - RX__LOG_ERROR_2("failed to run a test case " - "(suite: \"%s\", case: \"%s\")\n", - test_case->suite_name, - test_case->name); - goto summaries_cleanup; - } - - rx_summary_print(summary); - } - - if (status == RX_SUCCESS) { - size_t j; - - for (j = 0; j < test_case_count; ++j) { - size_t k; - struct rx_summary *summary; - - summary = &summaries[j]; - - for (k = 0; k < summary->failure_count; ++k) { - const struct rx_failure *failure; - - failure = &summary->failures[k]; - if (failure->severity == RX_FATAL) { - status = RX_ERROR_ABORTED; - goto summaries_cleanup; - } - } - } - } - -summaries_cleanup: - while (i-- > 0) { - rx_summary_terminate(&summaries[i]); - } - - RX_FREE(summaries); - - return status; -} - -RX__MAYBE_UNUSED static enum rx_status -rx__run_registered_test_cases(void) -{ - enum rx_status out; - rx_size test_case_count; - struct rx_test_case *test_cases; - - rx_enumerate_test_cases(&test_case_count, NULL); - if (test_case_count == 0) { - return rx__run_test_cases(0, NULL); - } - - test_cases = (struct rx_test_case *)RX_MALLOC(sizeof *test_cases - * test_case_count); - if (test_cases == NULL) { - RX__LOG_ERROR("failed to allocate the test cases\n"); - return RX_ERROR_ALLOCATION; - } - - rx_enumerate_test_cases(&test_case_count, test_cases); - out = rx__run_test_cases(test_case_count, test_cases); - RX_FREE(test_cases); - return out; -} - -/* Implementation: Test Assessments O-(''Q) - -------------------------------------------------------------------------- */ - -RX__PRINTF_CHECK(8, 0) -RX__MAYBE_UNUSED static void -rx__assess_value(struct rx_context *context, - int x, - int expected, - const char *expr, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(file != NULL); - - result = ((x && expected) || (!x && !expected)); - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - - if (failure_fmt == NULL) { - RX__STR_CREATE_1(status, - failure_msg, - "`%s` is expected to evaluate to true", - expr); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the test located at %s:%d\n", - file, - line); - failure_msg = NULL; - } - - RX__STR_CREATE_1(status, diagnostic_msg, "%d", x); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the test located at %s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the test " - "located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -RX__PRINTF_CHECK(8, 0) -RX__MAYBE_UNUSED static void -rx__bool_assess_value(struct rx_context *context, - int x, - int expected, - const char *expr, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(expr != NULL); - RX_ASSERT(file != NULL); - - result = ((x && expected) || (!x && !expected)); - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - - if (failure_fmt == NULL) { - RX__STR_CREATE_2(status, - failure_msg, - "`%s` is expected to be %s", - expr, - expected ? "true" : "false"); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the boolean test located at %s:%d\n", - file, - line); - failure_msg = NULL; - } - - RX__STR_CREATE_2(status, diagnostic_msg, "%d == %d", x, expected); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the boolean test located at %s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the boolean test " - "located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -RX__PRINTF_CHECK(10, 0) -RX__MAYBE_UNUSED static void -rx__int_assess_comparison(struct rx_context *context, - rx__int x1, - rx__int x2, - enum rx__op op, - const char *expr1, - const char *expr2, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(expr1 != NULL); - RX_ASSERT(expr2 != NULL); - RX_ASSERT(file != NULL); - - switch (op) { - case RX__OP_EQUAL: - result = x1 == x2; - break; - case RX__OP_NOT_EQUAL: - result = x1 != x2; - break; - case RX__OP_GREATER: - result = x1 > x2; - break; - case RX__OP_LESSER: - result = x1 < x2; - break; - case RX__OP_GREATER_OR_EQUAL: - result = x1 >= x2; - break; - case RX__OP_LESSER_OR_EQUAL: - result = x1 <= x2; - break; - default: - RX_ASSERT(0); - result = 0; - break; - } - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - const char *op_symbol; - - if (failure_fmt == NULL) { - const char *op_name; - - rx__op_get_name(&op_name, op); - RX__STR_CREATE_3(status, - failure_msg, - "`%s` is expected to be %s `%s`", - expr1, - op_name, - expr2); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the integer comparison test located at %s:%d\n", - file, - line); - failure_msg = NULL; - } - - rx__op_get_symbol(&op_symbol, op); - RX__STR_CREATE_3(status, - diagnostic_msg, - "%ld %s %ld", - (long)x1, - op_symbol, - (long)x2); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the integer comparison test located at %s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the integer " - "comparison test located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -RX__PRINTF_CHECK(10, 0) -RX__MAYBE_UNUSED static void -rx__uint_assess_comparison(struct rx_context *context, - rx__uint x1, - rx__uint x2, - enum rx__op op, - const char *expr1, - const char *expr2, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(expr1 != NULL); - RX_ASSERT(expr2 != NULL); - RX_ASSERT(file != NULL); - - switch (op) { - case RX__OP_EQUAL: - result = x1 == x2; - break; - case RX__OP_NOT_EQUAL: - result = x1 != x2; - break; - case RX__OP_GREATER: - result = x1 > x2; - break; - case RX__OP_LESSER: - result = x1 < x2; - break; - case RX__OP_GREATER_OR_EQUAL: - result = x1 >= x2; - break; - case RX__OP_LESSER_OR_EQUAL: - result = x1 <= x2; - break; - default: - RX_ASSERT(0); - result = 0; - break; - } - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - const char *op_symbol; - - if (failure_fmt == NULL) { - const char *op_name; - - rx__op_get_name(&op_name, op); - RX__STR_CREATE_3(status, - failure_msg, - "`%s` is expected to be %s `%s`", - expr1, - op_name, - expr2); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the unsigned integer comparison test located at " - "%s:%d\n", - file, - line); - failure_msg = NULL; - } - - rx__op_get_symbol(&op_symbol, op); - RX__STR_CREATE_3(status, - diagnostic_msg, - "%lu %s %lu", - (unsigned long)x1, - op_symbol, - (unsigned long)x2); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the unsigned integer comparison test located at " - "%s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the unsigned " - "integer comparison test located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -RX__PRINTF_CHECK(10, 0) -RX__MAYBE_UNUSED static void -rx__real_assess_comparison(struct rx_context *context, - rx__real x1, - rx__real x2, - enum rx__op op, - const char *expr1, - const char *expr2, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(expr1 != NULL); - RX_ASSERT(expr2 != NULL); - RX_ASSERT(file != NULL); - - switch (op) { -#if defined(__GNUC__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wfloat-equal" -#endif - case RX__OP_EQUAL: - result = x1 == x2; - break; - case RX__OP_NOT_EQUAL: - result = x1 != x2; - break; -#if defined(__GNUC__) - #pragma GCC diagnostic pop -#endif - case RX__OP_GREATER: - result = x1 > x2; - break; - case RX__OP_LESSER: - result = x1 < x2; - break; - case RX__OP_GREATER_OR_EQUAL: - result = x1 >= x2; - break; - case RX__OP_LESSER_OR_EQUAL: - result = x1 <= x2; - break; - default: - RX_ASSERT(0); - result = 0; - break; - } - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - const char *op_symbol; - - if (failure_fmt == NULL) { - const char *op_name; - - rx__op_get_name(&op_name, op); - RX__STR_CREATE_3(status, - failure_msg, - "`%s` is expected to be %s `%s`", - expr1, - op_name, - expr2); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the real comparison test located at %s:%d\n", - file, - line); - failure_msg = NULL; - } - - rx__op_get_symbol(&op_symbol, op); - RX__STR_CREATE_3( - status, diagnostic_msg, "%Lf %s %Lf", x1, op_symbol, x2); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the real comparison test located at %s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the real " - "comparison test located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -RX__PRINTF_CHECK(11, 0) -RX__MAYBE_UNUSED static void -rx__real_assess_fuzzy_comparison(struct rx_context *context, - rx__real x1, - rx__real x2, - rx__real tol, - enum rx__op op, - const char *expr1, - const char *expr2, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(expr1 != NULL); - RX_ASSERT(expr2 != NULL); - RX_ASSERT(file != NULL); - - switch (op) { - case RX__OP_EQUAL: - rx__real_are_equal_fuzzy(&result, x1, x2, tol); - break; - case RX__OP_NOT_EQUAL: - rx__real_are_equal_fuzzy(&result, x1, x2, tol); - result = !result; - break; - default: - RX_ASSERT(0); - result = 0; - break; - } - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - const char *op_symbol; - - if (failure_fmt == NULL) { - const char *op_name; - - rx__op_get_name(&op_name, op); - RX__STR_CREATE_4(status, - failure_msg, - "`%s` is expected to be almost %s `%s` " - "(tolerance: %Lf)", - expr1, - op_name, - expr2, - tol); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the real almost equal test located at %s:%d\n", - file, - line); - failure_msg = NULL; - } - - rx__op_get_symbol(&op_symbol, op); - RX__STR_CREATE_3( - status, diagnostic_msg, "%Lf %s %Lf", x1, op_symbol, x2); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the real almost equal test located at %s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the real " - "almost equal test located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -RX__PRINTF_CHECK(11, 0) -RX__MAYBE_UNUSED static void -rx__str_assess_comparison(struct rx_context *context, - const char *s1, - const char *s2, - enum rx__str_case str_case, - enum rx__op op, - const char *expr1, - const char *expr2, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(s1 != NULL); - RX_ASSERT(s2 != NULL); - RX_ASSERT(expr1 != NULL); - RX_ASSERT(expr2 != NULL); - RX_ASSERT(file != NULL); - - switch (op) { - case RX__OP_EQUAL: - str_case == RX__STR_CASE_OBEY - ? rx__str_are_equal(&result, s1, s2) - : rx__str_are_equal_no_case(&result, s1, s2); - break; - case RX__OP_NOT_EQUAL: - str_case == RX__STR_CASE_OBEY - ? rx__str_are_equal(&result, s1, s2) - : rx__str_are_equal_no_case(&result, s1, s2); - result = !result; - break; - default: - RX_ASSERT(0); - result = 0; - break; - } - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - const char *op_symbol; - - if (failure_fmt == NULL) { - const char *str_case_type; - const char *op_name; - - rx__str_case_get_type(&str_case_type, str_case); - rx__op_get_name(&op_name, op); - RX__STR_CREATE_4(status, - failure_msg, - "`%s` is expected to be %s `%s` (case: %s)", - expr1, - op_name, - expr2, - str_case_type); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the string comparison test located at %s:%d\n", - file, - line); - failure_msg = NULL; - } - - rx__op_get_symbol(&op_symbol, op); - RX__STR_CREATE_3( - status, diagnostic_msg, "\"%s\" %s \"%s\"", s1, op_symbol, s2); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the string comparison test located at %s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the string " - "comparison test located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -RX__PRINTF_CHECK(10, 0) -RX__MAYBE_UNUSED static void -rx__ptr_assess_comparison(struct rx_context *context, - void *x1, - void *x2, - enum rx__op op, - const char *expr1, - const char *expr2, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(expr1 != NULL); - RX_ASSERT(expr2 != NULL); - RX_ASSERT(file != NULL); - - switch (op) { - case RX__OP_EQUAL: - result = x1 == x2; - break; - case RX__OP_NOT_EQUAL: - result = x1 != x2; - break; - default: - RX_ASSERT(0); - result = 0; - break; - } - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - const char *op_symbol; - - if (failure_fmt == NULL) { - const char *op_name; - - rx__op_get_name(&op_name, op); - RX__STR_CREATE_3(status, - failure_msg, - "`%s` is expected to be %s `%s`", - expr1, - op_name, - expr2); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the pointer comparison test located at " - "%s:%d\n", - file, - line); - failure_msg = NULL; - } - - rx__op_get_symbol(&op_symbol, op); - RX__STR_CREATE_3(status, - diagnostic_msg, - "0x%08lx %s 0x%08lx", - (uintptr_t)x1, - op_symbol, - (uintptr_t)x2); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the pointer comparison test located at " - "%s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the pointer " - "comparison test located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -RX__PRINTF_CHECK(8, 0) -RX__MAYBE_UNUSED static void -rx__ptr_assess_alignment(struct rx_context *context, - void *x, - size_t alignment, - const char *expr, - const char *file, - int line, - enum rx_severity severity, - const char *failure_fmt, - ...) -{ - int result; - char *failure_msg; - char *diagnostic_msg; - - RX_ASSERT(context != NULL); - RX_ASSERT(expr != NULL); - RX_ASSERT(file != NULL); - - result = (uintptr_t)x % alignment == 0; - - if (result) { - failure_msg = NULL; - diagnostic_msg = NULL; - } else { - enum rx_status status; - - if (failure_fmt == NULL) { - RX__STR_CREATE_2(status, - failure_msg, - "`%s` is expected to have an %lu-byte alignment", - expr, - (unsigned long)alignment); - } else { - RX__STR_CREATE_VA_LIST(status, failure_msg, failure_fmt); - } - - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the failure message for " - "the pointer alignment test located at " - "%s:%d\n", - file, - line); - failure_msg = NULL; - } - - RX__STR_CREATE_2(status, - diagnostic_msg, - "0x%08lx %% %lu != 0", - (uintptr_t)x, - (unsigned long)alignment); - if (status != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to create the diagnostic message for " - "the pointer alignment test located at " - "%s:%d\n", - file, - line); - diagnostic_msg = NULL; - } - } - - if (rx_handle_test_result( - context, result, file, line, severity, failure_msg, diagnostic_msg) - != RX_SUCCESS) { - RX__LOG_DEBUG_2("failed to handle the test result for the pointer " - "alignment test located at %s:%d\n", - file, - line); - } - - RX_FREE(failure_msg); - RX_FREE(diagnostic_msg); - - if (!result && severity == RX_FATAL) { - rx_abort(context); - } -} - -/* Implementation: Public API O-(''Q) - -------------------------------------------------------------------------- */ - -RX__MAYBE_UNUSED RX__STORAGE void -rx_abort(struct rx_context *context) -{ - longjmp(context->env, 1); -} - -RX__MAYBE_UNUSED RX__STORAGE enum rx_status -rx_handle_test_result(struct rx_context *context, - int result, - const char *file, - int line, - enum rx_severity severity, - const char *failure_msg, - const char *diagnostic_msg) -{ - enum rx_status status; - struct rx_summary *summary; - struct rx_failure *failure; - size_t failure_count; - - RX_ASSERT(context != NULL); - RX_ASSERT(context->summary != NULL); - RX_ASSERT(context->summary->failures != NULL); - RX_ASSERT(file != NULL); - - summary = context->summary; - - ++summary->assessed_count; - - if (result) { - return RX_SUCCESS; - } - - status - = rx__test_failure_array_extend_back(&failure, &summary->failures, 1); - if (status != RX_SUCCESS) { - summary->error = "failed to extend the test failure array\0"; - RX__LOG_ERROR_2("failed to extend the test failure array for the test " - "located at %s:%d\n", - file, - line); - return status; - } - - rx__test_failure_array_get_size(&failure_count, summary->failures); - summary->failure_count = failure_count; - - { - char *buf; - - status = rx__str_copy(&buf, file); - if (status != RX_SUCCESS) { - RX__LOG_ERROR_2("failed to allocate the file name for the test " - "located at %s:%d\n", - file, - line); - failure->file = NULL; - } else { - failure->file = buf; - } - } - - failure->line = line; - failure->severity = severity; - - if (failure_msg == NULL) { - failure->msg = NULL; - } else { - char *buf; - - status = rx__str_copy(&buf, failure_msg); - if (status != RX_SUCCESS) { - RX__LOG_ERROR_2("failed to allocate the failure message for " - "the test located at %s:%d\n", - file, - line); - failure->msg = NULL; - } else { - failure->msg = buf; - } - } - - if (diagnostic_msg == NULL) { - failure->diagnostic_msg = NULL; - } else { - char *buf; - - status = rx__str_copy(&buf, diagnostic_msg); - if (status != RX_SUCCESS) { - RX__LOG_ERROR_2("failed to allocate the diagnostic message for " - "the test located at %s:%d\n", - file, - line); - failure->diagnostic_msg = NULL; - } else { - failure->diagnostic_msg = buf; - } - } - - return RX_SUCCESS; -} - -RX__MAYBE_UNUSED RX__STORAGE enum rx_status -rx_summary_initialize(struct rx_summary *summary, - const struct rx_test_case *test_case) -{ - enum rx_status status; - - RX_ASSERT(summary != NULL); - RX_ASSERT(test_case != NULL); - - memset(summary, 0, sizeof *summary); - - status = rx__test_failure_array_create(&summary->failures, 0); - if (status != RX_SUCCESS) { - RX__LOG_ERROR_2("failed to create the test failure array " - "(suite: \"%s\", case: \"%s\")\n", - test_case->suite_name, - test_case->name); - return status; - } - - summary->test_case = test_case; - return RX_SUCCESS; -} - -RX__MAYBE_UNUSED RX__STORAGE void -rx_summary_terminate(struct rx_summary *summary) -{ - size_t i; - - RX_ASSERT(summary != NULL); - RX_ASSERT(summary->failures != NULL); - - for (i = 0; i < summary->failure_count; ++i) { - const struct rx_failure *failure; - - failure = &summary->failures[i]; - - RX_FREE((void *)(uintptr_t)failure->file); - RX_FREE((void *)(uintptr_t)failure->msg); - RX_FREE((void *)(uintptr_t)failure->diagnostic_msg); - } - - rx__test_failure_array_destroy(summary->failures); -} - -RX__MAYBE_UNUSED RX__STORAGE void -rx_summary_print(const struct rx_summary *summary) -{ - size_t i; - int passed; - const char *style_begin; - const char *style_end; - - RX_ASSERT(summary != NULL); - RX_ASSERT(summary->test_case != NULL); - RX_ASSERT(summary->test_case->suite_name != NULL); - RX_ASSERT(summary->test_case->name != NULL); - RX_ASSERT(summary->failures != NULL); - - passed = summary->failure_count == 0; - -#if RX__LOG_STYLING - if (RX__ISATTY(RX__FILENO(stderr))) { - rx__log_style_get_ansi_code( - &style_begin, - passed ? RX__LOG_STYLE_BRIGHT_GREEN : RX__LOG_STYLE_BRIGHT_RED); - rx__log_style_get_ansi_code(&style_end, RX__LOG_STYLE_RESET); - } else { - style_begin = style_end = ""; - } -#else - style_begin = style_end = ""; -#endif - - fprintf(stderr, - "[%s%s%s] \"%s\" / \"%s\" (%f ms)\n", - style_begin, - passed ? "PASSED" : "FAILED", - style_end, - summary->test_case->suite_name, - summary->test_case->name, - (double)summary->elapsed * (1000.0 / RX__TICKS_PER_SECOND)); - - for (i = 0; i < summary->failure_count; ++i) { - const struct rx_failure *failure; - const char *failure_msg; - - failure = &summary->failures[i]; - failure_msg = failure->msg == NULL ? "" : failure->msg; - - if (failure->diagnostic_msg != NULL) { - fprintf(stderr, - "%s:%d: %s test failure: %s\n%s\n", - failure->file, - failure->line, - failure->severity == RX_FATAL ? "fatal" : "nonfatal", - failure_msg, - failure->diagnostic_msg); - } else { - fprintf(stderr, - "%s:%d: %s test failure: %s\n", - failure->file, - failure->line, - failure->severity == RX_FATAL ? "fatal" : "nonfatal", - failure_msg); - } - } -} - -RX__MAYBE_UNUSED RX__STORAGE void -rx_sort_summaries_by_test_suite(struct rx_summary *summaries, - rx_size summary_count) -{ - qsort(summaries, - summary_count, - sizeof *summaries, - rx__compare_summaries_by_test_suite); -} - -RX__MAYBE_UNUSED RX__STORAGE void -rx_group_summaries_by_test_suite(rx_size *summary_group_count, - struct rx_summary_group *summary_groups, - rx_size summary_count, - const struct rx_summary *summaries) -{ - size_t i; - struct rx_summary_group *it; - - RX_ASSERT(summary_group_count != NULL); - - if (summary_count == 0) { - *summary_group_count = 0; - return; - } - - RX_ASSERT(summaries != NULL); - - if (summary_groups == NULL) { - *summary_group_count = 1; - for (i = 0; i < summary_count - 1; ++i) { - *summary_group_count += (rx_size)( - rx__compare_summaries_by_test_suite(&summaries[i], - &summaries[i + 1]) - != 0); - } - - return; - } - - it = summary_groups; - it->count = 0; - it->array = summaries; - for (i = 0; i < summary_count - 1; ++i) { - ++it->count; - - if (rx__compare_summaries_by_test_suite(&summaries[i], - &summaries[i + 1]) - != 0) { - ++it; - it->count = 0; - it->array = &summaries[i + 1]; - } - } - - ++it->count; -} - -RX__MAYBE_UNUSED RX__STORAGE enum rx_status -rx_test_case_run(struct rx_summary *summary, - const struct rx_test_case *test_case) -{ - enum rx_status status; - struct rx_context context; - void *data; - uint64_t time_begin; - uint64_t time_end; - - RX_ASSERT(summary != NULL); - RX_ASSERT(test_case != NULL); - RX_ASSERT(test_case->suite_name != NULL); - RX_ASSERT(test_case->name != NULL); - RX_ASSERT(test_case->run != NULL); - - if (test_case->config.skip) { - summary->skipped = 1; - return RX_SUCCESS; - } - - status = RX_SUCCESS; - context.summary = summary; - - if (test_case->config.fixture.size > 0) { - data = RX_MALLOC(test_case->config.fixture.size); - if (data == NULL) { - summary->error = "failed to allocate the data\0"; - RX__LOG_ERROR_2("failed to allocate the data" - "(suite: \"%s\", case: \"%s\")\n", - test_case->suite_name, - test_case->name); - return RX_ERROR_ALLOCATION; - } - } else { - data = NULL; - } - - if (test_case->config.fixture.config.set_up != NULL) { - status = test_case->config.fixture.config.set_up(&context, data); - if (status != RX_SUCCESS) { - summary->error = "failed to set-up the fixture\0"; - RX__LOG_ERROR_2("failed to set-up the fixture " - "(suite: \"%s\", case: \"%s\")\n", - test_case->suite_name, - test_case->name); - goto data_cleanup; - } - } - - if (rx__get_real_time(&time_begin) != RX_SUCCESS) { - time_begin = (uint64_t)-1; - } - - if (setjmp(context.env) == 0) { - test_case->run(&context, data); - } - - if (time_begin == (uint64_t)-1 - || rx__get_real_time(&time_end) != RX_SUCCESS) { - RX__LOG_ERROR_2("failed to measure the time elapsed " - "(suite: \"%s\", case: \"%s\")\n", - test_case->suite_name, - test_case->name); - summary->elapsed = 0; - } else { - RX_ASSERT(time_end >= time_begin); - summary->elapsed = (rx_uint64)(time_end - time_begin); - } - - if (test_case->config.fixture.config.tear_down != NULL) { - test_case->config.fixture.config.tear_down(&context, data); - } - -data_cleanup: - RX_FREE(data); - return status; -} - -RX__MAYBE_UNUSED RX__STORAGE void -rx_enumerate_test_cases(rx_size *test_case_count, - struct rx_test_case *test_cases) -{ - size_t i; - const struct rx__test_case_desc * const *c_it; - - RX_ASSERT(test_case_count != NULL); - - if (test_cases == NULL) { - *test_case_count = 0; - for (c_it = RX__TEST_CASE_SECTION_BEGIN; - c_it != RX__TEST_CASE_SECTION_END; - ++c_it) { - *test_case_count += (rx_size)(*c_it != NULL); - } - - return; - } - - i = 0; - for (c_it = RX__TEST_CASE_SECTION_BEGIN; - c_it != RX__TEST_CASE_SECTION_END; - ++c_it) { - const struct rx__test_suite_desc * const *s_it; - struct rx__test_case_config_blueprint config_blueprint; - struct rx_test_case *test_case; - - if (*c_it == NULL) { - continue; - } - - /* Find the corresponding test suite description, if any. */ - for (s_it = RX__TEST_SUITE_SECTION_BEGIN; - s_it != RX__TEST_SUITE_SECTION_END; - ++s_it) { - if (*s_it == NULL) { - continue; - } - - if (strcmp((*s_it)->name, (*c_it)->suite_name) == 0) { - break; - } - } - - memset(&config_blueprint, 0, sizeof config_blueprint); - - if (s_it != RX__TEST_SUITE_SECTION_END - && (*s_it)->config_desc != NULL) { - /* Inherit the config from the test suite's description. */ - (*s_it)->config_desc->update(&config_blueprint); - } - - if ((*c_it)->config_desc != NULL) { - /* Inherit the config from the test case's description. */ - (*c_it)->config_desc->update(&config_blueprint); - } - - test_case = &test_cases[i]; - - test_case->suite_name = (*c_it)->suite_name; - test_case->name = (*c_it)->name; - test_case->run = (*c_it)->run; - - test_case->config.skip = config_blueprint.skip; - - memset(&test_case->config.fixture, 0, sizeof test_case->config.fixture); - - if (config_blueprint.fixture != NULL) { - test_case->config.fixture.size = config_blueprint.fixture->size; - - if (config_blueprint.fixture->update != NULL) { - config_blueprint.fixture->update( - &test_case->config.fixture.config); - } - } - - ++i; - } - - RX_ASSERT(i == *test_case_count); - - /* Objects that are defined in a custom memory section can only be retrieved - in an undefined order, so these need to be manually sorted afterwards - in a sensible way. */ - qsort(test_cases, - *test_case_count, - sizeof *test_cases, - rx__compare_test_cases); -} - -RX__MAYBE_UNUSED RX__STORAGE enum rx_status -rx_run(rx_size test_case_count, const struct rx_test_case *test_cases) -{ - if (test_cases != NULL) { - return rx__run_test_cases(test_case_count, test_cases); - } - - /* If no test cases are explicitly passed, fallback to discovering the - ones defined through the automatic registration framework. */ - return rx__run_registered_test_cases(); -} - -RX__MAYBE_UNUSED RX__STORAGE enum rx_status -rx_main(rx_size test_case_count, - const struct rx_test_case *test_cases, - int argc, - const char **argv) -{ - RX__UNUSED(argc); - RX__UNUSED(argv); - - return rx_run(test_case_count, test_cases); -} - -#endif /* REXO_REXO_H */ diff -r 4da5819148c6 -r f06312a7432b gen/UnicodeData.txt --- a/gen/UnicodeData.txt Wed Feb 01 13:07:04 2023 +0100 +++ b/gen/UnicodeData.txt Tue Feb 07 14:30:33 2023 +0100 @@ -2975,6 +2975,7 @@ 0CEF;KANNADA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 0CF1;KANNADA SIGN JIHVAMULIYA;Lo;0;L;;;;;N;;;;; 0CF2;KANNADA SIGN UPADHMANIYA;Lo;0;L;;;;;N;;;;; +0CF3;KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT;Mc;0;L;;;;;N;;;;; 0D00;MALAYALAM SIGN COMBINING ANUSVARA ABOVE;Mn;0;NSM;;;;;N;;;;; 0D01;MALAYALAM SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; 0D02;MALAYALAM SIGN ANUSVARA;Mc;0;L;;;;;N;;;;; @@ -3339,6 +3340,7 @@ 0ECB;LAO TONE MAI CATAWA;Mn;122;NSM;;;;;N;;;;; 0ECC;LAO CANCELLATION MARK;Mn;0;NSM;;;;;N;;;;; 0ECD;LAO NIGGAHITA;Mn;0;NSM;;;;;N;;;;; +0ECE;LAO YAMAKKAN;Mn;0;NSM;;;;;N;;;;; 0ED0;LAO DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; 0ED1;LAO DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; 0ED2;LAO DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; @@ -19393,6 +19395,9 @@ 10EAD;YEZIDI HYPHENATION MARK;Pd;0;R;;;;;N;;;;; 10EB0;YEZIDI LETTER LAM WITH DOT ABOVE;Lo;0;R;;;;;N;;;;; 10EB1;YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE;Lo;0;R;;;;;N;;;;; +10EFD;ARABIC SMALL LOW WORD SAKTA;Mn;220;NSM;;;;;N;;;;; +10EFE;ARABIC SMALL LOW WORD QASR;Mn;220;NSM;;;;;N;;;;; +10EFF;ARABIC SMALL LOW WORD MADDA;Mn;220;NSM;;;;;N;;;;; 10F00;OLD SOGDIAN LETTER ALEPH;Lo;0;R;;;;;N;;;;; 10F01;OLD SOGDIAN LETTER FINAL ALEPH;Lo;0;R;;;;;N;;;;; 10F02;OLD SOGDIAN LETTER BETH;Lo;0;R;;;;;N;;;;; @@ -20058,6 +20063,9 @@ 1123C;KHOJKI DOUBLE SECTION MARK;Po;0;L;;;;;N;;;;; 1123D;KHOJKI ABBREVIATION SIGN;Po;0;L;;;;;N;;;;; 1123E;KHOJKI SIGN SUKUN;Mn;0;NSM;;;;;N;;;;; +1123F;KHOJKI LETTER QA;Lo;0;L;;;;;N;;;;; +11240;KHOJKI LETTER SHORT I;Lo;0;L;;;;;N;;;;; +11241;KHOJKI VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; 11280;MULTANI LETTER A;Lo;0;L;;;;;N;;;;; 11281;MULTANI LETTER I;Lo;0;L;;;;;N;;;;; 11282;MULTANI LETTER U;Lo;0;L;;;;;N;;;;; @@ -21256,6 +21264,16 @@ 11AF6;PAU CIN HAU LOW-FALLING TONE LONG FINAL;Lo;0;L;;;;;N;;;;; 11AF7;PAU CIN HAU LOW-FALLING TONE FINAL;Lo;0;L;;;;;N;;;;; 11AF8;PAU CIN HAU GLOTTAL STOP FINAL;Lo;0;L;;;;;N;;;;; +11B00;DEVANAGARI HEAD MARK;Po;0;L;;;;;N;;;;; +11B01;DEVANAGARI HEAD MARK WITH HEADSTROKE;Po;0;L;;;;;N;;;;; +11B02;DEVANAGARI SIGN BHALE;Po;0;L;;;;;N;;;;; +11B03;DEVANAGARI SIGN BHALE WITH HOOK;Po;0;L;;;;;N;;;;; +11B04;DEVANAGARI SIGN EXTENDED BHALE;Po;0;L;;;;;N;;;;; +11B05;DEVANAGARI SIGN EXTENDED BHALE WITH HOOK;Po;0;L;;;;;N;;;;; +11B06;DEVANAGARI SIGN WESTERN FIVE-LIKE BHALE;Po;0;L;;;;;N;;;;; +11B07;DEVANAGARI SIGN WESTERN NINE-LIKE BHALE;Po;0;L;;;;;N;;;;; +11B08;DEVANAGARI SIGN REVERSED NINE-LIKE BHALE;Po;0;L;;;;;N;;;;; +11B09;DEVANAGARI SIGN MINDU;Po;0;L;;;;;N;;;;; 11C00;BHAIKSUKI LETTER A;Lo;0;L;;;;;N;;;;; 11C01;BHAIKSUKI LETTER AA;Lo;0;L;;;;;N;;;;; 11C02;BHAIKSUKI LETTER I;Lo;0;L;;;;;N;;;;; @@ -21584,6 +21602,92 @@ 11EF6;MAKASAR VOWEL SIGN O;Mc;0;L;;;;;N;;;;; 11EF7;MAKASAR PASSIMBANG;Po;0;L;;;;;N;;;;; 11EF8;MAKASAR END OF SECTION;Po;0;L;;;;;N;;;;; +11F00;KAWI SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;; +11F01;KAWI SIGN ANUSVARA;Mn;0;NSM;;;;;N;;;;; +11F02;KAWI SIGN REPHA;Lo;0;L;;;;;N;;;;; +11F03;KAWI SIGN VISARGA;Mc;0;L;;;;;N;;;;; +11F04;KAWI LETTER A;Lo;0;L;;;;;N;;;;; +11F05;KAWI LETTER AA;Lo;0;L;;;;;N;;;;; +11F06;KAWI LETTER I;Lo;0;L;;;;;N;;;;; +11F07;KAWI LETTER II;Lo;0;L;;;;;N;;;;; +11F08;KAWI LETTER U;Lo;0;L;;;;;N;;;;; +11F09;KAWI LETTER UU;Lo;0;L;;;;;N;;;;; +11F0A;KAWI LETTER VOCALIC R;Lo;0;L;;;;;N;;;;; +11F0B;KAWI LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; +11F0C;KAWI LETTER VOCALIC L;Lo;0;L;;;;;N;;;;; +11F0D;KAWI LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; +11F0E;KAWI LETTER E;Lo;0;L;;;;;N;;;;; +11F0F;KAWI LETTER AI;Lo;0;L;;;;;N;;;;; +11F10;KAWI LETTER O;Lo;0;L;;;;;N;;;;; +11F12;KAWI LETTER KA;Lo;0;L;;;;;N;;;;; +11F13;KAWI LETTER KHA;Lo;0;L;;;;;N;;;;; +11F14;KAWI LETTER GA;Lo;0;L;;;;;N;;;;; +11F15;KAWI LETTER GHA;Lo;0;L;;;;;N;;;;; +11F16;KAWI LETTER NGA;Lo;0;L;;;;;N;;;;; +11F17;KAWI LETTER CA;Lo;0;L;;;;;N;;;;; +11F18;KAWI LETTER CHA;Lo;0;L;;;;;N;;;;; +11F19;KAWI LETTER JA;Lo;0;L;;;;;N;;;;; +11F1A;KAWI LETTER JHA;Lo;0;L;;;;;N;;;;; +11F1B;KAWI LETTER NYA;Lo;0;L;;;;;N;;;;; +11F1C;KAWI LETTER TTA;Lo;0;L;;;;;N;;;;; +11F1D;KAWI LETTER TTHA;Lo;0;L;;;;;N;;;;; +11F1E;KAWI LETTER DDA;Lo;0;L;;;;;N;;;;; +11F1F;KAWI LETTER DDHA;Lo;0;L;;;;;N;;;;; +11F20;KAWI LETTER NNA;Lo;0;L;;;;;N;;;;; +11F21;KAWI LETTER TA;Lo;0;L;;;;;N;;;;; +11F22;KAWI LETTER THA;Lo;0;L;;;;;N;;;;; +11F23;KAWI LETTER DA;Lo;0;L;;;;;N;;;;; +11F24;KAWI LETTER DHA;Lo;0;L;;;;;N;;;;; +11F25;KAWI LETTER NA;Lo;0;L;;;;;N;;;;; +11F26;KAWI LETTER PA;Lo;0;L;;;;;N;;;;; +11F27;KAWI LETTER PHA;Lo;0;L;;;;;N;;;;; +11F28;KAWI LETTER BA;Lo;0;L;;;;;N;;;;; +11F29;KAWI LETTER BHA;Lo;0;L;;;;;N;;;;; +11F2A;KAWI LETTER MA;Lo;0;L;;;;;N;;;;; +11F2B;KAWI LETTER YA;Lo;0;L;;;;;N;;;;; +11F2C;KAWI LETTER RA;Lo;0;L;;;;;N;;;;; +11F2D;KAWI LETTER LA;Lo;0;L;;;;;N;;;;; +11F2E;KAWI LETTER WA;Lo;0;L;;;;;N;;;;; +11F2F;KAWI LETTER SHA;Lo;0;L;;;;;N;;;;; +11F30;KAWI LETTER SSA;Lo;0;L;;;;;N;;;;; +11F31;KAWI LETTER SA;Lo;0;L;;;;;N;;;;; +11F32;KAWI LETTER HA;Lo;0;L;;;;;N;;;;; +11F33;KAWI LETTER JNYA;Lo;0;L;;;;;N;;;;; +11F34;KAWI VOWEL SIGN AA;Mc;0;L;;;;;N;;;;; +11F35;KAWI VOWEL SIGN ALTERNATE AA;Mc;0;L;;;;;N;;;;; +11F36;KAWI VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;; +11F37;KAWI VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;; +11F38;KAWI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;; +11F39;KAWI VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;; +11F3A;KAWI VOWEL SIGN VOCALIC R;Mn;0;NSM;;;;;N;;;;; +11F3E;KAWI VOWEL SIGN E;Mc;0;L;;;;;N;;;;; +11F3F;KAWI VOWEL SIGN AI;Mc;0;L;;;;;N;;;;; +11F40;KAWI VOWEL SIGN EU;Mn;0;NSM;;;;;N;;;;; +11F41;KAWI SIGN KILLER;Mc;9;L;;;;;N;;;;; +11F42;KAWI CONJOINER;Mn;9;NSM;;;;;N;;;;; +11F43;KAWI DANDA;Po;0;L;;;;;N;;;;; +11F44;KAWI DOUBLE DANDA;Po;0;L;;;;;N;;;;; +11F45;KAWI PUNCTUATION SECTION MARKER;Po;0;L;;;;;N;;;;; +11F46;KAWI PUNCTUATION ALTERNATE SECTION MARKER;Po;0;L;;;;;N;;;;; +11F47;KAWI PUNCTUATION FLOWER;Po;0;L;;;;;N;;;;; +11F48;KAWI PUNCTUATION SPACE FILLER;Po;0;L;;;;;N;;;;; +11F49;KAWI PUNCTUATION DOT;Po;0;L;;;;;N;;;;; +11F4A;KAWI PUNCTUATION DOUBLE DOT;Po;0;L;;;;;N;;;;; +11F4B;KAWI PUNCTUATION TRIPLE DOT;Po;0;L;;;;;N;;;;; +11F4C;KAWI PUNCTUATION CIRCLE;Po;0;L;;;;;N;;;;; +11F4D;KAWI PUNCTUATION FILLED CIRCLE;Po;0;L;;;;;N;;;;; +11F4E;KAWI PUNCTUATION SPIRAL;Po;0;L;;;;;N;;;;; +11F4F;KAWI PUNCTUATION CLOSING SPIRAL;Po;0;L;;;;;N;;;;; +11F50;KAWI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; +11F51;KAWI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; +11F52;KAWI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; +11F53;KAWI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; +11F54;KAWI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; +11F55;KAWI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; +11F56;KAWI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; +11F57;KAWI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; +11F58;KAWI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; +11F59;KAWI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 11FB0;LISU LETTER YHA;Lo;0;L;;;;;N;;;;; 11FC0;TAMIL FRACTION ONE THREE-HUNDRED-AND-TWENTIETH;No;0;L;;;;1/320;N;;;;; 11FC1;TAMIL FRACTION ONE ONE-HUNDRED-AND-SIXTIETH;No;0;L;;;;1/160;N;;;;; @@ -24040,6 +24144,7 @@ 1342C;EGYPTIAN HIEROGLYPH AA030;Lo;0;L;;;;;N;;;;; 1342D;EGYPTIAN HIEROGLYPH AA031;Lo;0;L;;;;;N;;;;; 1342E;EGYPTIAN HIEROGLYPH AA032;Lo;0;L;;;;;N;;;;; +1342F;EGYPTIAN HIEROGLYPH V011D;Lo;0;L;;;;;N;;;;; 13430;EGYPTIAN HIEROGLYPH VERTICAL JOINER;Cf;0;L;;;;;N;;;;; 13431;EGYPTIAN HIEROGLYPH HORIZONTAL JOINER;Cf;0;L;;;;;N;;;;; 13432;EGYPTIAN HIEROGLYPH INSERT AT TOP START;Cf;0;L;;;;;N;;;;; @@ -24049,6 +24154,35 @@ 13436;EGYPTIAN HIEROGLYPH OVERLAY MIDDLE;Cf;0;L;;;;;N;;;;; 13437;EGYPTIAN HIEROGLYPH BEGIN SEGMENT;Cf;0;L;;;;;N;;;;; 13438;EGYPTIAN HIEROGLYPH END SEGMENT;Cf;0;L;;;;;N;;;;; +13439;EGYPTIAN HIEROGLYPH INSERT AT MIDDLE;Cf;0;L;;;;;N;;;;; +1343A;EGYPTIAN HIEROGLYPH INSERT AT TOP;Cf;0;L;;;;;N;;;;; +1343B;EGYPTIAN HIEROGLYPH INSERT AT BOTTOM;Cf;0;L;;;;;N;;;;; +1343C;EGYPTIAN HIEROGLYPH BEGIN ENCLOSURE;Cf;0;L;;;;;N;;;;; +1343D;EGYPTIAN HIEROGLYPH END ENCLOSURE;Cf;0;L;;;;;N;;;;; +1343E;EGYPTIAN HIEROGLYPH BEGIN WALLED ENCLOSURE;Cf;0;L;;;;;N;;;;; +1343F;EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE;Cf;0;L;;;;;N;;;;; +13440;EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY;Mn;0;NSM;;;;;N;;;;; +13441;EGYPTIAN HIEROGLYPH FULL BLANK;Lo;0;L;;;;;N;;;;; +13442;EGYPTIAN HIEROGLYPH HALF BLANK;Lo;0;L;;;;;N;;;;; +13443;EGYPTIAN HIEROGLYPH LOST SIGN;Lo;0;L;;;;;N;;;;; +13444;EGYPTIAN HIEROGLYPH HALF LOST SIGN;Lo;0;L;;;;;N;;;;; +13445;EGYPTIAN HIEROGLYPH TALL LOST SIGN;Lo;0;L;;;;;N;;;;; +13446;EGYPTIAN HIEROGLYPH WIDE LOST SIGN;Lo;0;L;;;;;N;;;;; +13447;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START;Mn;0;NSM;;;;;N;;;;; +13448;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM START;Mn;0;NSM;;;;;N;;;;; +13449;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT START;Mn;0;NSM;;;;;N;;;;; +1344A;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP END;Mn;0;NSM;;;;;N;;;;; +1344B;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP;Mn;0;NSM;;;;;N;;;;; +1344C;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM START AND TOP END;Mn;0;NSM;;;;;N;;;;; +1344D;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT START AND TOP;Mn;0;NSM;;;;;N;;;;; +1344E;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM END;Mn;0;NSM;;;;;N;;;;; +1344F;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START AND BOTTOM END;Mn;0;NSM;;;;;N;;;;; +13450;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM;Mn;0;NSM;;;;;N;;;;; +13451;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT START AND BOTTOM;Mn;0;NSM;;;;;N;;;;; +13452;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT END;Mn;0;NSM;;;;;N;;;;; +13453;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP AND END;Mn;0;NSM;;;;;N;;;;; +13454;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM AND END;Mn;0;NSM;;;;;N;;;;; +13455;EGYPTIAN HIEROGLYPH MODIFIER DAMAGED;Mn;0;NSM;;;;;N;;;;; 14400;ANATOLIAN HIEROGLYPH A001;Lo;0;L;;;;;N;;;;; 14401;ANATOLIAN HIEROGLYPH A002;Lo;0;L;;;;;N;;;;; 14402;ANATOLIAN HIEROGLYPH A003;Lo;0;L;;;;;N;;;;; @@ -27289,9 +27423,11 @@ 1B120;KATAKANA LETTER ARCHAIC YI;Lo;0;L;;;;;N;;;;; 1B121;KATAKANA LETTER ARCHAIC YE;Lo;0;L;;;;;N;;;;; 1B122;KATAKANA LETTER ARCHAIC WU;Lo;0;L;;;;;N;;;;; +1B132;HIRAGANA LETTER SMALL KO;Lo;0;L;;;;;N;;;;; 1B150;HIRAGANA LETTER SMALL WI;Lo;0;L;;;;;N;;;;; 1B151;HIRAGANA LETTER SMALL WE;Lo;0;L;;;;;N;;;;; 1B152;HIRAGANA LETTER SMALL WO;Lo;0;L;;;;;N;;;;; +1B155;KATAKANA LETTER SMALL KO;Lo;0;L;;;;;N;;;;; 1B164;KATAKANA LETTER SMALL WI;Lo;0;L;;;;;N;;;;; 1B165;KATAKANA LETTER SMALL WE;Lo;0;L;;;;;N;;;;; 1B166;KATAKANA LETTER SMALL WO;Lo;0;L;;;;;N;;;;; @@ -28573,6 +28709,26 @@ 1D243;COMBINING GREEK MUSICAL TETRASEME;Mn;230;NSM;;;;;N;;;;; 1D244;COMBINING GREEK MUSICAL PENTASEME;Mn;230;NSM;;;;;N;;;;; 1D245;GREEK MUSICAL LEIMMA;So;0;ON;;;;;N;;;;; +1D2C0;KAKTOVIK NUMERAL ZERO;No;0;L;;;;0;N;;;;; +1D2C1;KAKTOVIK NUMERAL ONE;No;0;L;;;;1;N;;;;; +1D2C2;KAKTOVIK NUMERAL TWO;No;0;L;;;;2;N;;;;; +1D2C3;KAKTOVIK NUMERAL THREE;No;0;L;;;;3;N;;;;; +1D2C4;KAKTOVIK NUMERAL FOUR;No;0;L;;;;4;N;;;;; +1D2C5;KAKTOVIK NUMERAL FIVE;No;0;L;;;;5;N;;;;; +1D2C6;KAKTOVIK NUMERAL SIX;No;0;L;;;;6;N;;;;; +1D2C7;KAKTOVIK NUMERAL SEVEN;No;0;L;;;;7;N;;;;; +1D2C8;KAKTOVIK NUMERAL EIGHT;No;0;L;;;;8;N;;;;; +1D2C9;KAKTOVIK NUMERAL NINE;No;0;L;;;;9;N;;;;; +1D2CA;KAKTOVIK NUMERAL TEN;No;0;L;;;;10;N;;;;; +1D2CB;KAKTOVIK NUMERAL ELEVEN;No;0;L;;;;11;N;;;;; +1D2CC;KAKTOVIK NUMERAL TWELVE;No;0;L;;;;12;N;;;;; +1D2CD;KAKTOVIK NUMERAL THIRTEEN;No;0;L;;;;13;N;;;;; +1D2CE;KAKTOVIK NUMERAL FOURTEEN;No;0;L;;;;14;N;;;;; +1D2CF;KAKTOVIK NUMERAL FIFTEEN;No;0;L;;;;15;N;;;;; +1D2D0;KAKTOVIK NUMERAL SIXTEEN;No;0;L;;;;16;N;;;;; +1D2D1;KAKTOVIK NUMERAL SEVENTEEN;No;0;L;;;;17;N;;;;; +1D2D2;KAKTOVIK NUMERAL EIGHTEEN;No;0;L;;;;18;N;;;;; +1D2D3;KAKTOVIK NUMERAL NINETEEN;No;0;L;;;;19;N;;;;; 1D2E0;MAYAN NUMERAL ZERO;No;0;L;;;;0;N;;;;; 1D2E1;MAYAN NUMERAL ONE;No;0;L;;;;1;N;;;;; 1D2E2;MAYAN NUMERAL TWO;No;0;L;;;;2;N;;;;; @@ -30404,6 +30560,12 @@ 1DF1C;LATIN SMALL LETTER TESH DIGRAPH WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1DF1D;LATIN SMALL LETTER C WITH RETROFLEX HOOK;Ll;0;L;;;;;N;;;;; 1DF1E;LATIN SMALL LETTER S WITH CURL;Ll;0;L;;;;;N;;;;; +1DF25;LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK;Ll;0;L;;;;;N;;;;; +1DF26;LATIN SMALL LETTER L WITH MID-HEIGHT LEFT HOOK;Ll;0;L;;;;;N;;;;; +1DF27;LATIN SMALL LETTER N WITH MID-HEIGHT LEFT HOOK;Ll;0;L;;;;;N;;;;; +1DF28;LATIN SMALL LETTER R WITH MID-HEIGHT LEFT HOOK;Ll;0;L;;;;;N;;;;; +1DF29;LATIN SMALL LETTER S WITH MID-HEIGHT LEFT HOOK;Ll;0;L;;;;;N;;;;; +1DF2A;LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK;Ll;0;L;;;;;N;;;;; 1E000;COMBINING GLAGOLITIC LETTER AZU;Mn;230;NSM;;;;;N;;;;; 1E001;COMBINING GLAGOLITIC LETTER BUKY;Mn;230;NSM;;;;;N;;;;; 1E002;COMBINING GLAGOLITIC LETTER VEDE;Mn;230;NSM;;;;;N;;;;; @@ -30442,6 +30604,69 @@ 1E028;COMBINING GLAGOLITIC LETTER BIG YUS;Mn;230;NSM;;;;;N;;;;; 1E029;COMBINING GLAGOLITIC LETTER IOTATED BIG YUS;Mn;230;NSM;;;;;N;;;;; 1E02A;COMBINING GLAGOLITIC LETTER FITA;Mn;230;NSM;;;;;N;;;;; +1E030;MODIFIER LETTER CYRILLIC SMALL A;Lm;0;L; 0430;;;;N;;;;; +1E031;MODIFIER LETTER CYRILLIC SMALL BE;Lm;0;L; 0431;;;;N;;;;; +1E032;MODIFIER LETTER CYRILLIC SMALL VE;Lm;0;L; 0432;;;;N;;;;; +1E033;MODIFIER LETTER CYRILLIC SMALL GHE;Lm;0;L; 0433;;;;N;;;;; +1E034;MODIFIER LETTER CYRILLIC SMALL DE;Lm;0;L; 0434;;;;N;;;;; +1E035;MODIFIER LETTER CYRILLIC SMALL IE;Lm;0;L; 0435;;;;N;;;;; +1E036;MODIFIER LETTER CYRILLIC SMALL ZHE;Lm;0;L; 0436;;;;N;;;;; +1E037;MODIFIER LETTER CYRILLIC SMALL ZE;Lm;0;L; 0437;;;;N;;;;; +1E038;MODIFIER LETTER CYRILLIC SMALL I;Lm;0;L; 0438;;;;N;;;;; +1E039;MODIFIER LETTER CYRILLIC SMALL KA;Lm;0;L; 043A;;;;N;;;;; +1E03A;MODIFIER LETTER CYRILLIC SMALL EL;Lm;0;L; 043B;;;;N;;;;; +1E03B;MODIFIER LETTER CYRILLIC SMALL EM;Lm;0;L; 043C;;;;N;;;;; +1E03C;MODIFIER LETTER CYRILLIC SMALL O;Lm;0;L; 043E;;;;N;;;;; +1E03D;MODIFIER LETTER CYRILLIC SMALL PE;Lm;0;L; 043F;;;;N;;;;; +1E03E;MODIFIER LETTER CYRILLIC SMALL ER;Lm;0;L; 0440;;;;N;;;;; +1E03F;MODIFIER LETTER CYRILLIC SMALL ES;Lm;0;L; 0441;;;;N;;;;; +1E040;MODIFIER LETTER CYRILLIC SMALL TE;Lm;0;L; 0442;;;;N;;;;; +1E041;MODIFIER LETTER CYRILLIC SMALL U;Lm;0;L; 0443;;;;N;;;;; +1E042;MODIFIER LETTER CYRILLIC SMALL EF;Lm;0;L; 0444;;;;N;;;;; +1E043;MODIFIER LETTER CYRILLIC SMALL HA;Lm;0;L; 0445;;;;N;;;;; +1E044;MODIFIER LETTER CYRILLIC SMALL TSE;Lm;0;L; 0446;;;;N;;;;; +1E045;MODIFIER LETTER CYRILLIC SMALL CHE;Lm;0;L; 0447;;;;N;;;;; +1E046;MODIFIER LETTER CYRILLIC SMALL SHA;Lm;0;L; 0448;;;;N;;;;; +1E047;MODIFIER LETTER CYRILLIC SMALL YERU;Lm;0;L; 044B;;;;N;;;;; +1E048;MODIFIER LETTER CYRILLIC SMALL E;Lm;0;L; 044D;;;;N;;;;; +1E049;MODIFIER LETTER CYRILLIC SMALL YU;Lm;0;L; 044E;;;;N;;;;; +1E04A;MODIFIER LETTER CYRILLIC SMALL DZZE;Lm;0;L; A689;;;;N;;;;; +1E04B;MODIFIER LETTER CYRILLIC SMALL SCHWA;Lm;0;L; 04D9;;;;N;;;;; +1E04C;MODIFIER LETTER CYRILLIC SMALL BYELORUSSIAN-UKRAINIAN I;Lm;0;L; 0456;;;;N;;;;; +1E04D;MODIFIER LETTER CYRILLIC SMALL JE;Lm;0;L; 0458;;;;N;;;;; +1E04E;MODIFIER LETTER CYRILLIC SMALL BARRED O;Lm;0;L; 04E9;;;;N;;;;; +1E04F;MODIFIER LETTER CYRILLIC SMALL STRAIGHT U;Lm;0;L; 04AF;;;;N;;;;; +1E050;MODIFIER LETTER CYRILLIC SMALL PALOCHKA;Lm;0;L; 04CF;;;;N;;;;; +1E051;CYRILLIC SUBSCRIPT SMALL LETTER A;Lm;0;L; 0430;;;;N;;;;; +1E052;CYRILLIC SUBSCRIPT SMALL LETTER BE;Lm;0;L; 0431;;;;N;;;;; +1E053;CYRILLIC SUBSCRIPT SMALL LETTER VE;Lm;0;L; 0432;;;;N;;;;; +1E054;CYRILLIC SUBSCRIPT SMALL LETTER GHE;Lm;0;L; 0433;;;;N;;;;; +1E055;CYRILLIC SUBSCRIPT SMALL LETTER DE;Lm;0;L; 0434;;;;N;;;;; +1E056;CYRILLIC SUBSCRIPT SMALL LETTER IE;Lm;0;L; 0435;;;;N;;;;; +1E057;CYRILLIC SUBSCRIPT SMALL LETTER ZHE;Lm;0;L; 0436;;;;N;;;;; +1E058;CYRILLIC SUBSCRIPT SMALL LETTER ZE;Lm;0;L; 0437;;;;N;;;;; +1E059;CYRILLIC SUBSCRIPT SMALL LETTER I;Lm;0;L; 0438;;;;N;;;;; +1E05A;CYRILLIC SUBSCRIPT SMALL LETTER KA;Lm;0;L; 043A;;;;N;;;;; +1E05B;CYRILLIC SUBSCRIPT SMALL LETTER EL;Lm;0;L; 043B;;;;N;;;;; +1E05C;CYRILLIC SUBSCRIPT SMALL LETTER O;Lm;0;L; 043E;;;;N;;;;; +1E05D;CYRILLIC SUBSCRIPT SMALL LETTER PE;Lm;0;L; 043F;;;;N;;;;; +1E05E;CYRILLIC SUBSCRIPT SMALL LETTER ES;Lm;0;L; 0441;;;;N;;;;; +1E05F;CYRILLIC SUBSCRIPT SMALL LETTER U;Lm;0;L; 0443;;;;N;;;;; +1E060;CYRILLIC SUBSCRIPT SMALL LETTER EF;Lm;0;L; 0444;;;;N;;;;; +1E061;CYRILLIC SUBSCRIPT SMALL LETTER HA;Lm;0;L; 0445;;;;N;;;;; +1E062;CYRILLIC SUBSCRIPT SMALL LETTER TSE;Lm;0;L; 0446;;;;N;;;;; +1E063;CYRILLIC SUBSCRIPT SMALL LETTER CHE;Lm;0;L; 0447;;;;N;;;;; +1E064;CYRILLIC SUBSCRIPT SMALL LETTER SHA;Lm;0;L; 0448;;;;N;;;;; +1E065;CYRILLIC SUBSCRIPT SMALL LETTER HARD SIGN;Lm;0;L; 044A;;;;N;;;;; +1E066;CYRILLIC SUBSCRIPT SMALL LETTER YERU;Lm;0;L; 044B;;;;N;;;;; +1E067;CYRILLIC SUBSCRIPT SMALL LETTER GHE WITH UPTURN;Lm;0;L; 0491;;;;N;;;;; +1E068;CYRILLIC SUBSCRIPT SMALL LETTER BYELORUSSIAN-UKRAINIAN I;Lm;0;L; 0456;;;;N;;;;; +1E069;CYRILLIC SUBSCRIPT SMALL LETTER DZE;Lm;0;L; 0455;;;;N;;;;; +1E06A;CYRILLIC SUBSCRIPT SMALL LETTER DZHE;Lm;0;L; 045F;;;;N;;;;; +1E06B;MODIFIER LETTER CYRILLIC SMALL ES WITH DESCENDER;Lm;0;L; 04AB;;;;N;;;;; +1E06C;MODIFIER LETTER CYRILLIC SMALL YERU WITH BACK YER;Lm;0;L; A651;;;;N;;;;; +1E06D;MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE;Lm;0;L; 04B1;;;;N;;;;; +1E08F;COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I;Mn;230;NSM;;;;;N;;;;; 1E100;NYIAKENG PUACHUE HMONG LETTER MA;Lo;0;L;;;;;N;;;;; 1E101;NYIAKENG PUACHUE HMONG LETTER TSA;Lo;0;L;;;;;N;;;;; 1E102;NYIAKENG PUACHUE HMONG LETTER NTA;Lo;0;L;;;;;N;;;;; @@ -30603,6 +30828,48 @@ 1E2F8;WANCHO DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1E2F9;WANCHO DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1E2FF;WANCHO NGUN SIGN;Sc;0;ET;;;;;N;;;;; +1E4D0;NAG MUNDARI LETTER O;Lo;0;L;;;;;N;;;;; +1E4D1;NAG MUNDARI LETTER OP;Lo;0;L;;;;;N;;;;; +1E4D2;NAG MUNDARI LETTER OL;Lo;0;L;;;;;N;;;;; +1E4D3;NAG MUNDARI LETTER OY;Lo;0;L;;;;;N;;;;; +1E4D4;NAG MUNDARI LETTER ONG;Lo;0;L;;;;;N;;;;; +1E4D5;NAG MUNDARI LETTER A;Lo;0;L;;;;;N;;;;; +1E4D6;NAG MUNDARI LETTER AJ;Lo;0;L;;;;;N;;;;; +1E4D7;NAG MUNDARI LETTER AB;Lo;0;L;;;;;N;;;;; +1E4D8;NAG MUNDARI LETTER ANY;Lo;0;L;;;;;N;;;;; +1E4D9;NAG MUNDARI LETTER AH;Lo;0;L;;;;;N;;;;; +1E4DA;NAG MUNDARI LETTER I;Lo;0;L;;;;;N;;;;; +1E4DB;NAG MUNDARI LETTER IS;Lo;0;L;;;;;N;;;;; +1E4DC;NAG MUNDARI LETTER IDD;Lo;0;L;;;;;N;;;;; +1E4DD;NAG MUNDARI LETTER IT;Lo;0;L;;;;;N;;;;; +1E4DE;NAG MUNDARI LETTER IH;Lo;0;L;;;;;N;;;;; +1E4DF;NAG MUNDARI LETTER U;Lo;0;L;;;;;N;;;;; +1E4E0;NAG MUNDARI LETTER UC;Lo;0;L;;;;;N;;;;; +1E4E1;NAG MUNDARI LETTER UD;Lo;0;L;;;;;N;;;;; +1E4E2;NAG MUNDARI LETTER UK;Lo;0;L;;;;;N;;;;; +1E4E3;NAG MUNDARI LETTER UR;Lo;0;L;;;;;N;;;;; +1E4E4;NAG MUNDARI LETTER E;Lo;0;L;;;;;N;;;;; +1E4E5;NAG MUNDARI LETTER ENN;Lo;0;L;;;;;N;;;;; +1E4E6;NAG MUNDARI LETTER EG;Lo;0;L;;;;;N;;;;; +1E4E7;NAG MUNDARI LETTER EM;Lo;0;L;;;;;N;;;;; +1E4E8;NAG MUNDARI LETTER EN;Lo;0;L;;;;;N;;;;; +1E4E9;NAG MUNDARI LETTER ETT;Lo;0;L;;;;;N;;;;; +1E4EA;NAG MUNDARI LETTER ELL;Lo;0;L;;;;;N;;;;; +1E4EB;NAG MUNDARI SIGN OJOD;Lm;0;L;;;;;N;;;;; +1E4EC;NAG MUNDARI SIGN MUHOR;Mn;232;NSM;;;;;N;;;;; +1E4ED;NAG MUNDARI SIGN TOYOR;Mn;232;NSM;;;;;N;;;;; +1E4EE;NAG MUNDARI SIGN IKIR;Mn;220;NSM;;;;;N;;;;; +1E4EF;NAG MUNDARI SIGN SUTUH;Mn;230;NSM;;;;;N;;;;; +1E4F0;NAG MUNDARI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; +1E4F1;NAG MUNDARI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; +1E4F2;NAG MUNDARI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; +1E4F3;NAG MUNDARI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; +1E4F4;NAG MUNDARI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; +1E4F5;NAG MUNDARI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; +1E4F6;NAG MUNDARI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; +1E4F7;NAG MUNDARI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; +1E4F8;NAG MUNDARI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; +1E4F9;NAG MUNDARI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1E7E0;ETHIOPIC SYLLABLE HHYA;Lo;0;L;;;;;N;;;;; 1E7E1;ETHIOPIC SYLLABLE HHYU;Lo;0;L;;;;;N;;;;; 1E7E2;ETHIOPIC SYLLABLE HHYI;Lo;0;L;;;;;N;;;;; @@ -32678,6 +32945,7 @@ 1F6D5;HINDU TEMPLE;So;0;ON;;;;;N;;;;; 1F6D6;HUT;So;0;ON;;;;;N;;;;; 1F6D7;ELEVATOR;So;0;ON;;;;;N;;;;; +1F6DC;WIRELESS;So;0;ON;;;;;N;;;;; 1F6DD;PLAYGROUND SLIDE;So;0;ON;;;;;N;;;;; 1F6DE;WHEEL;So;0;ON;;;;;N;;;;; 1F6DF;RING BUOY;So;0;ON;;;;;N;;;;; @@ -32823,6 +33091,14 @@ 1F771;ALCHEMICAL SYMBOL FOR MONTH;So;0;ON;;;;;N;;;;; 1F772;ALCHEMICAL SYMBOL FOR HALF DRAM;So;0;ON;;;;;N;;;;; 1F773;ALCHEMICAL SYMBOL FOR HALF OUNCE;So;0;ON;;;;;N;;;;; +1F774;LOT OF FORTUNE;So;0;ON;;;;;N;;;;; +1F775;OCCULTATION;So;0;ON;;;;;N;;;;; +1F776;LUNAR ECLIPSE;So;0;ON;;;;;N;;;;; +1F77B;HAUMEA;So;0;ON;;;;;N;;;;; +1F77C;MAKEMAKE;So;0;ON;;;;;N;;;;; +1F77D;GONGGONG;So;0;ON;;;;;N;;;;; +1F77E;QUAOAR;So;0;ON;;;;;N;;;;; +1F77F;ORCUS;So;0;ON;;;;;N;;;;; 1F780;BLACK LEFT-POINTING ISOSCELES RIGHT TRIANGLE;So;0;ON;;;;;N;;;;; 1F781;BLACK UP-POINTING ISOSCELES RIGHT TRIANGLE;So;0;ON;;;;;N;;;;; 1F782;BLACK RIGHT-POINTING ISOSCELES RIGHT TRIANGLE;So;0;ON;;;;;N;;;;; @@ -32912,6 +33188,7 @@ 1F7D6;NEGATIVE CIRCLED TRIANGLE;So;0;ON;;;;;N;;;;; 1F7D7;CIRCLED SQUARE;So;0;ON;;;;;N;;;;; 1F7D8;NEGATIVE CIRCLED SQUARE;So;0;ON;;;;;N;;;;; +1F7D9;NINE POINTED WHITE STAR;So;0;ON;;;;;N;;;;; 1F7E0;LARGE ORANGE CIRCLE;So;0;ON;;;;;N;;;;; 1F7E1;LARGE YELLOW CIRCLE;So;0;ON;;;;;N;;;;; 1F7E2;LARGE GREEN CIRCLE;So;0;ON;;;;;N;;;;; @@ -33434,6 +33711,9 @@ 1FA72;BRIEFS;So;0;ON;;;;;N;;;;; 1FA73;SHORTS;So;0;ON;;;;;N;;;;; 1FA74;THONG SANDAL;So;0;ON;;;;;N;;;;; +1FA75;LIGHT BLUE HEART;So;0;ON;;;;;N;;;;; +1FA76;GREY HEART;So;0;ON;;;;;N;;;;; +1FA77;PINK HEART;So;0;ON;;;;;N;;;;; 1FA78;DROP OF BLOOD;So;0;ON;;;;;N;;;;; 1FA79;ADHESIVE BANDAGE;So;0;ON;;;;;N;;;;; 1FA7A;STETHOSCOPE;So;0;ON;;;;;N;;;;; @@ -33446,6 +33726,8 @@ 1FA84;MAGIC WAND;So;0;ON;;;;;N;;;;; 1FA85;PINATA;So;0;ON;;;;;N;;;;; 1FA86;NESTING DOLLS;So;0;ON;;;;;N;;;;; +1FA87;MARACAS;So;0;ON;;;;;N;;;;; +1FA88;FLUTE;So;0;ON;;;;;N;;;;; 1FA90;RINGED PLANET;So;0;ON;;;;;N;;;;; 1FA91;CHAIR;So;0;ON;;;;;N;;;;; 1FA92;RAZOR;So;0;ON;;;;;N;;;;; @@ -33475,6 +33757,9 @@ 1FAAA;IDENTIFICATION CARD;So;0;ON;;;;;N;;;;; 1FAAB;LOW BATTERY;So;0;ON;;;;;N;;;;; 1FAAC;HAMSA;So;0;ON;;;;;N;;;;; +1FAAD;FOLDING HAND FAN;So;0;ON;;;;;N;;;;; +1FAAE;HAIR PICK;So;0;ON;;;;;N;;;;; +1FAAF;KHANDA;So;0;ON;;;;;N;;;;; 1FAB0;FLY;So;0;ON;;;;;N;;;;; 1FAB1;WORM;So;0;ON;;;;;N;;;;; 1FAB2;BEETLE;So;0;ON;;;;;N;;;;; @@ -33486,12 +33771,18 @@ 1FAB8;CORAL;So;0;ON;;;;;N;;;;; 1FAB9;EMPTY NEST;So;0;ON;;;;;N;;;;; 1FABA;NEST WITH EGGS;So;0;ON;;;;;N;;;;; +1FABB;HYACINTH;So;0;ON;;;;;N;;;;; +1FABC;JELLYFISH;So;0;ON;;;;;N;;;;; +1FABD;WING;So;0;ON;;;;;N;;;;; +1FABF;GOOSE;So;0;ON;;;;;N;;;;; 1FAC0;ANATOMICAL HEART;So;0;ON;;;;;N;;;;; 1FAC1;LUNGS;So;0;ON;;;;;N;;;;; 1FAC2;PEOPLE HUGGING;So;0;ON;;;;;N;;;;; 1FAC3;PREGNANT MAN;So;0;ON;;;;;N;;;;; 1FAC4;PREGNANT PERSON;So;0;ON;;;;;N;;;;; 1FAC5;PERSON WITH CROWN;So;0;ON;;;;;N;;;;; +1FACE;MOOSE;So;0;ON;;;;;N;;;;; +1FACF;DONKEY;So;0;ON;;;;;N;;;;; 1FAD0;BLUEBERRIES;So;0;ON;;;;;N;;;;; 1FAD1;BELL PEPPER;So;0;ON;;;;;N;;;;; 1FAD2;OLIVE;So;0;ON;;;;;N;;;;; @@ -33502,6 +33793,8 @@ 1FAD7;POURING LIQUID;So;0;ON;;;;;N;;;;; 1FAD8;BEANS;So;0;ON;;;;;N;;;;; 1FAD9;JAR;So;0;ON;;;;;N;;;;; +1FADA;GINGER ROOT;So;0;ON;;;;;N;;;;; +1FADB;PEA POD;So;0;ON;;;;;N;;;;; 1FAE0;MELTING FACE;So;0;ON;;;;;N;;;;; 1FAE1;SALUTING FACE;So;0;ON;;;;;N;;;;; 1FAE2;FACE WITH OPEN EYES AND HAND OVER MOUTH;So;0;ON;;;;;N;;;;; @@ -33510,6 +33803,7 @@ 1FAE5;DOTTED LINE FACE;So;0;ON;;;;;N;;;;; 1FAE6;BITING LIP;So;0;ON;;;;;N;;;;; 1FAE7;BUBBLES;So;0;ON;;;;;N;;;;; +1FAE8;SHAKING FACE;So;0;ON;;;;;N;;;;; 1FAF0;HAND WITH INDEX FINGER AND THUMB CROSSED;So;0;ON;;;;;N;;;;; 1FAF1;RIGHTWARDS HAND;So;0;ON;;;;;N;;;;; 1FAF2;LEFTWARDS HAND;So;0;ON;;;;;N;;;;; @@ -33517,6 +33811,8 @@ 1FAF4;PALM UP HAND;So;0;ON;;;;;N;;;;; 1FAF5;INDEX POINTING AT THE VIEWER;So;0;ON;;;;;N;;;;; 1FAF6;HEART HANDS;So;0;ON;;;;;N;;;;; +1FAF7;LEFTWARDS PUSHING HAND;So;0;ON;;;;;N;;;;; +1FAF8;RIGHTWARDS PUSHING HAND;So;0;ON;;;;;N;;;;; 1FB00;BLOCK SEXTANT-1;So;0;ON;;;;;N;;;;; 1FB01;BLOCK SEXTANT-2;So;0;ON;;;;;N;;;;; 1FB02;BLOCK SEXTANT-12;So;0;ON;;;;;N;;;;; @@ -33732,7 +34028,7 @@ 20000;;Lo;0;L;;;;;N;;;;; 2A6DF;;Lo;0;L;;;;;N;;;;; 2A700;;Lo;0;L;;;;;N;;;;; -2B738;;Lo;0;L;;;;;N;;;;; +2B739;;Lo;0;L;;;;;N;;;;; 2B740;;Lo;0;L;;;;;N;;;;; 2B81D;;Lo;0;L;;;;;N;;;;; 2B820;;Lo;0;L;;;;;N;;;;; @@ -34283,6 +34579,8 @@ 2FA1D;CJK COMPATIBILITY IDEOGRAPH-2FA1D;Lo;0;L;2A600;;;;N;;;;; 30000;;Lo;0;L;;;;;N;;;;; 3134A;;Lo;0;L;;;;;N;;;;; +31350;;Lo;0;L;;;;;N;;;;; +323AF;;Lo;0;L;;;;;N;;;;; E0001;LANGUAGE TAG;Cf;0;BN;;;;;N;;;;; E0020;TAG SPACE;Cf;0;BN;;;;;N;;;;; E0021;TAG EXCLAMATION MARK;Cf;0;BN;;;;;N;;;;; diff -r 4da5819148c6 -r f06312a7432b tests/test-unicode.c --- a/tests/test-unicode.c Wed Feb 01 13:07:04 2023 +0100 +++ b/tests/test-unicode.c Tue Feb 07 14:30:33 2023 +0100 @@ -18,7 +18,7 @@ #include -#include +#include #include "unicode.h" @@ -46,7 +46,8 @@ return l1 == l2 && memcmp(s1, s2, l1) == 0; } -RX_TEST_CASE(uni8_encode, simple) +static void +uni8_encode_simple(void) { size_t r; @@ -55,8 +56,8 @@ uint8_t buffer[5] = { 0 }; r = uni8_encode(buffer, sizeof (buffer), U'a'); - RX_INT_REQUIRE_EQUAL(r, 1); - RX_STR_REQUIRE_EQUAL((const char *)buffer, (const char *)u8"a"); + DT_EQ_INT(r, 1); + DT_EQ_STR((const char *)buffer, (const char *)u8"a"); } /* é -> 2 bytes. */ @@ -64,32 +65,35 @@ uint8_t buffer[5] = { 0 }; r = uni8_encode(buffer, sizeof (buffer), U'é'); - RX_INT_REQUIRE_EQUAL(r, 2); - RX_STR_REQUIRE_EQUAL((const char *)buffer, (const char *)u8"é"); + DT_EQ_INT(r, 2); + DT_EQ_STR((const char *)buffer, (const char *)u8"é"); } } -RX_TEST_CASE(uni8_encode, invalid) +static void +uni8_encode_invalid(void) { size_t r; uint8_t buffer[5] = { 0 }; r = uni8_encode(buffer, sizeof (buffer), 0xffffffff); - RX_UINT_REQUIRE_EQUAL(r, (size_t)-1); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE(r, (size_t)-1); + DT_EQ_INT(errno, EILSEQ); } -RX_TEST_CASE(uni8_encode, toosmall) +static void +uni8_encode_toosmall(void) { size_t r; uint8_t buffer[1] = { 0 }; r = uni8_encode(buffer, sizeof (buffer), U'é'); - RX_UINT_REQUIRE_EQUAL(r, (size_t)-1); - RX_INT_REQUIRE_EQUAL(errno, ERANGE); + DT_EQ_SIZE(r, (size_t)-1); + DT_EQ_INT(errno, ERANGE); } -RX_TEST_CASE(unit8_decode, simple) +static void +uni8_decode_simple(void) { size_t r; @@ -98,8 +102,8 @@ uint32_t code = -1; r = uni8_decode((const uint8_t *)u8"a", &code); - RX_UINT_REQUIRE_EQUAL(r, 1U); - RX_INT_REQUIRE_EQUAL(code, 'a'); + DT_EQ_SIZE(r, 1U); + DT_EQ_INT(code, 'a'); } /* é -> 2 bytes. */ @@ -107,12 +111,13 @@ uint32_t code = -1; r = uni8_decode((const uint8_t *)u8"é", &code); - RX_UINT_REQUIRE_EQUAL(r, 2U); - RX_INT_REQUIRE_EQUAL(code, U'é'); + DT_EQ_SIZE(r, 2U); + DT_EQ_INT(code, U'é'); } } -RX_TEST_CASE(uni8_decode, invalid) +static void +uni8_decode_invalid(void) { size_t r; @@ -121,9 +126,9 @@ uint32_t code = -1; r = uni8_decode((const uint8_t *)u8"\xff""a", &code); - RX_UINT_REQUIRE_EQUAL(r, (size_t)-1); - RX_UINT_REQUIRE_EQUAL(code, (uint32_t)-1); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE(r, (size_t)-1); + DT_EQ_SIZE(code, (uint32_t)-1); + DT_EQ_INT(errno, EILSEQ); } /* Valid "€" but unfinished sequence. */ @@ -131,39 +136,44 @@ uint32_t code = -1; r = uni8_decode((const uint8_t []){ -30, 0 }, &code); - RX_UINT_REQUIRE_EQUAL(r, (size_t)-1); - RX_UINT_REQUIRE_EQUAL(code, (uint32_t)-1); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE(r, (size_t)-1); + DT_EQ_SIZE(code, (uint32_t)-1); + DT_EQ_INT(errno, EILSEQ); } } -RX_TEST_CASE(uni8_sizeof, simple) +static void +uni8_sizeof_simple(void) { - RX_INT_REQUIRE_EQUAL(uni8_sizeof(u8"a"[0]), 1U); - RX_INT_REQUIRE_EQUAL(uni8_sizeof(u8"é"[0]), 2U); - RX_INT_REQUIRE_EQUAL(uni8_sizeof(u8"€"[0]), 3U); - RX_INT_REQUIRE_EQUAL(uni8_sizeof(u8"𐍈"[0]), 4U); + DT_EQ_INT(uni8_sizeof(u8"a"[0]), 1U); + DT_EQ_INT(uni8_sizeof(u8"é"[0]), 2U); + DT_EQ_INT(uni8_sizeof(u8"€"[0]), 3U); + DT_EQ_INT(uni8_sizeof(u8"𐍈"[0]), 4U); } -RX_TEST_CASE(uni8_sizeof, invalid) +static void +uni8_sizeof_invalid(void) { - RX_UINT_REQUIRE_EQUAL((size_t)-1, uni8_sizeof(u8"\xff"[0])); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE((size_t)-1, uni8_sizeof(u8"\xff"[0])); + DT_EQ_INT(errno, EILSEQ); } -RX_TEST_CASE(uni8_length, simple) +static void +uni8_length_simple(void) { - RX_UINT_REQUIRE_EQUAL(uni8_length((const uint8_t *)"abc"), 3U); - RX_UINT_REQUIRE_EQUAL(uni8_length((const uint8_t *)"5€"), 2U); + DT_EQ_SIZE(uni8_length((const uint8_t *)"abc"), 3U); + DT_EQ_SIZE(uni8_length((const uint8_t *)"5€"), 2U); } -RX_TEST_CASE(uni8_length, invalid) +static void +uni8_length_invalid(void) { - RX_UINT_REQUIRE_EQUAL((size_t)-1, uni8_length((const uint8_t *)"a""\xff""b")); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE((size_t)-1, uni8_length((const uint8_t *)"a""\xff""b")); + DT_EQ_INT(errno, EILSEQ); } -RX_TEST_CASE(uni8_to32, simple) +static void +uni8_to32_simple(void) { size_t r; @@ -172,8 +182,8 @@ uint32_t expected[] = { U'a', U'b', U'c', 0 }; r = uni8_to32((const uint8_t *)"abc", buffer, 10); - RX_UINT_REQUIRE_EQUAL(r, 3U); - RX_REQUIRE(u32cmp(buffer, expected)); + DT_EQ_SIZE(r, 3U); + DT_ASSERT(u32cmp(buffer, expected)); } { @@ -181,69 +191,77 @@ uint32_t expected[] = { U'a', U'é', U'c', 0 }; r = uni8_to32((const uint8_t *)"aéc", buffer, 10); - RX_UINT_REQUIRE_EQUAL(r, 3); - RX_REQUIRE(u32cmp(buffer, expected)); + DT_EQ_SIZE(r, 3); + DT_ASSERT(u32cmp(buffer, expected)); } } -RX_TEST_CASE(uni8_to32, invalid) +static void +uni8_to32_invalid(void) { size_t r; uint32_t buffer[10] = { 0 }; /* Invalid UTF-8 sequence. */ r = uni8_to32((const uint8_t *)u8"\xff""a", buffer, 10); - RX_UINT_REQUIRE_EQUAL(r, (size_t)-1); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE(r, (size_t)-1); + DT_EQ_INT(errno, EILSEQ); /* Valid "€" but unfinished sequence. */ r = uni8_to32((const uint8_t []){ -30, 0 }, buffer, 10); - RX_UINT_REQUIRE_EQUAL(r, (size_t)-1); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE(r, (size_t)-1); + DT_EQ_INT(errno, EILSEQ); } -RX_TEST_CASE(uni8_to32, toosmall) +static void +uni8_to32_toosmall(void) { size_t r; uint32_t buffer[4] = { 0 }; r = uni8_to32((const uint8_t *)u8"bonjour à tous", buffer, 1); - RX_UINT_REQUIRE_EQUAL(r, (size_t)-1); - RX_INT_REQUIRE_EQUAL(errno, ERANGE); + DT_EQ_SIZE(r, (size_t)-1); + DT_EQ_INT(errno, ERANGE); } -RX_TEST_CASE(uni32_sizeof, simple) +static void +uni32_sizeof_simple(void) { - RX_UINT_REQUIRE_EQUAL(uni32_sizeof(U'a'), 1); - RX_UINT_REQUIRE_EQUAL(uni32_sizeof(U'é'), 2); - RX_UINT_REQUIRE_EQUAL(uni32_sizeof(U'€'), 3); - RX_UINT_REQUIRE_EQUAL(uni32_sizeof(U'𐍈'), 4); + DT_EQ_SIZE(uni32_sizeof(U'a'), 1); + DT_EQ_SIZE(uni32_sizeof(U'é'), 2); + DT_EQ_SIZE(uni32_sizeof(U'€'), 3); + DT_EQ_SIZE(uni32_sizeof(U'𐍈'), 4); } -RX_TEST_CASE(uni32_sizeof, invalid) +static void +uni32_sizeof_invalid(void) { - RX_UINT_REQUIRE_EQUAL((size_t)-1, uni32_sizeof(0xffffffff)); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE((size_t)-1, uni32_sizeof(0xffffffff)); + DT_EQ_INT(errno, EILSEQ); } -RX_TEST_CASE(uni32_length, simple) +static void +uni32_length_simple(void) { - RX_UINT_REQUIRE_EQUAL(uni32_length((const uint32_t []){ U'a', U'é', U'c', 0 }), 3U); + DT_EQ_SIZE(uni32_length((const uint32_t []){ U'a', U'é', U'c', 0 }), 3U); } -RX_TEST_CASE(uni32_requires, simple) +static void +uni32_requires_simple(void) { - RX_UINT_REQUIRE_EQUAL(uni32_requires(U"abc"), 3U); - RX_UINT_REQUIRE_EQUAL(uni32_requires(U"é€𐍈"), 9U); + DT_EQ_SIZE(uni32_requires(U"abc"), 3U); + DT_EQ_SIZE(uni32_requires(U"é€𐍈"), 9U); } -RX_TEST_CASE(uni32_requires, invalid) +static void +uni32_requires_invalid(void) { - RX_UINT_REQUIRE_EQUAL((size_t)-1, uni32_requires(U"\xffffffff")); - RX_INT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE((size_t)-1, uni32_requires(U"\xffffffff")); + DT_EQ_INT(errno, EILSEQ); } -RX_TEST_CASE(uni32_to8, simple) +static void +uni32_to8_simple(void) { size_t r; @@ -251,79 +269,113 @@ uint8_t buffer[10] = { 0 }; r = uni32_to8(U"abc", buffer, sizeof (buffer)); - RX_UINT_REQUIRE_EQUAL(r, 3U); - RX_STR_REQUIRE_EQUAL((const char *)buffer, (const char *)u8"abc"); + DT_EQ_SIZE(r, 3U); + DT_EQ_STR((const char *)buffer, (const char *)u8"abc"); } { uint8_t buffer[20] = { 0 }; r = uni32_to8(U"ça va, 5€ ?", buffer, sizeof (buffer)); - RX_UINT_REQUIRE_EQUAL(r, 14U); - RX_STR_REQUIRE_EQUAL((const char *)buffer, (const char *)u8"ça va, 5€ ?"); + DT_EQ_SIZE(r, 14U); + DT_EQ_STR((const char *)buffer, (const char *)u8"ça va, 5€ ?"); } } -RX_TEST_CASE(uni32_to8, invalid) +static void +uni32_to8_invalid(void) { uint8_t buffer[10] = { 0 }; - RX_INT_REQUIRE_EQUAL(uni32_to8(U"\xffffffff", buffer, sizeof (buffer)), (size_t)-1); - RX_UINT_REQUIRE_EQUAL(errno, EILSEQ); + DT_EQ_SIZE(uni32_to8(U"\xffffffff", buffer, sizeof (buffer)), (size_t)-1); + DT_EQ_INT(errno, EILSEQ); } -RX_TEST_CASE(uni32_to8, toosmall) +static void +uni32_to8_toosmall(void) { size_t r; uint8_t buffer[3] = { 0 }; r = uni32_to8(U"ça va ?", buffer, sizeof (buffer)); - RX_UINT_REQUIRE_EQUAL(r, (size_t)-1); - RX_INT_REQUIRE_EQUAL(errno, ERANGE); + DT_EQ_SIZE(r, (size_t)-1); + DT_EQ_INT(errno, ERANGE); } -RX_TEST_CASE(misc, isalpha) +static void +misc_isalpha(void) { - RX_REQUIRE(uni_isalpha(U'é')); - RX_REQUIRE(!uni_isalpha(U'€')); + DT_ASSERT(uni_isalpha(U'é')); + DT_ASSERT(!uni_isalpha(U'€')); } -RX_TEST_CASE(misc, isdigit) +static void +misc_isdigit(void) { - RX_REQUIRE(uni_isdigit(U'۱')); - RX_REQUIRE(!uni_isdigit(U'€')); + DT_ASSERT(uni_isdigit(U'۱')); + DT_ASSERT(!uni_isdigit(U'€')); } -RX_TEST_CASE(misc, islower) +static void +misc_islower(void) { - RX_REQUIRE(uni_islower(U'a')); - RX_REQUIRE(uni_islower(U'é')); - RX_REQUIRE(!uni_islower(U'A')); - RX_REQUIRE(!uni_islower(U'É')); + DT_ASSERT(uni_islower(U'a')); + DT_ASSERT(uni_islower(U'é')); + DT_ASSERT(!uni_islower(U'A')); + DT_ASSERT(!uni_islower(U'É')); } -RX_TEST_CASE(misc, isspace) +static void +misc_isspace(void) { - RX_REQUIRE(uni_isspace(U' ')); - RX_REQUIRE(!uni_isspace(U'é')); + DT_ASSERT(uni_isspace(U' ')); + DT_ASSERT(!uni_isspace(U'é')); } -RX_TEST_CASE(misc, istitle) +static void +misc_istitle(void) { - RX_REQUIRE(uni_istitle(U'Dž')); - RX_REQUIRE(!uni_istitle(U'€')); + DT_ASSERT(uni_istitle(U'Dž')); + DT_ASSERT(!uni_istitle(U'€')); } -RX_TEST_CASE(misc, isupper) +static void +misc_isupper(void) { - RX_REQUIRE(!uni_isupper('a')); - RX_REQUIRE(!uni_isupper(U'é')); - RX_REQUIRE(uni_isupper('A')); - RX_REQUIRE(uni_isupper(U'É')); + DT_ASSERT(!uni_isupper('a')); + DT_ASSERT(!uni_isupper(U'é')); + DT_ASSERT(uni_isupper('A')); + DT_ASSERT(uni_isupper(U'É')); } int main(int argc, char **argv) { - return rx_main(0, NULL, argc, (const char **)argv) == RX_SUCCESS ? 0 : 1; + DT_RUN(uni8_encode_simple); + DT_RUN(uni8_encode_invalid); + DT_RUN(uni8_encode_toosmall); + DT_RUN(uni8_decode_simple); + DT_RUN(uni8_decode_invalid); + DT_RUN(uni8_sizeof_simple); + DT_RUN(uni8_sizeof_invalid); + DT_RUN(uni8_length_simple); + DT_RUN(uni8_length_invalid); + DT_RUN(uni8_to32_simple); + DT_RUN(uni8_to32_invalid); + DT_RUN(uni8_to32_toosmall); + DT_RUN(uni32_sizeof_simple); + DT_RUN(uni32_sizeof_invalid); + DT_RUN(uni32_length_simple); + DT_RUN(uni32_requires_simple); + DT_RUN(uni32_requires_invalid); + DT_RUN(uni32_to8_simple); + DT_RUN(uni32_to8_invalid); + DT_RUN(uni32_to8_toosmall); + DT_RUN(misc_isalpha); + DT_RUN(misc_isdigit); + DT_RUN(misc_islower); + DT_RUN(misc_isspace); + DT_RUN(misc_istitle); + DT_RUN(misc_isupper); + DT_SUMMARY(); } diff -r 4da5819148c6 -r f06312a7432b unicode.c --- a/unicode.c Wed Feb 01 13:07:04 2023 +0100 +++ b/unicode.c Tue Feb 07 14:30:33 2023 +0100 @@ -188,6 +188,8 @@ { 0x11D09, 0x11D0B }, { 0x11D65, 0x11D67 }, { 0x11D68, 0x11D6A }, + { 0x11F02, 0x11F04 }, + { 0x11F10, 0x11F12 }, { 0x16FE1, 0x16FE3 }, { 0x1AFF3, 0x1AFF5 }, { 0x1AFFB, 0x1AFFD }, @@ -614,6 +616,7 @@ { 0x111C1, 0x111C4 }, { 0x11200, 0x11211 }, { 0x11213, 0x1122B }, + { 0x1123F, 0x11240 }, { 0x11280, 0x11286 }, { 0x1128A, 0x1128D }, { 0x1128F, 0x1129D }, @@ -658,10 +661,13 @@ { 0x11D67, 0x11D68 }, { 0x11D6A, 0x11D89 }, { 0x11EE0, 0x11EF2 }, + { 0x11F04, 0x11F10 }, + { 0x11F12, 0x11F33 }, { 0x12000, 0x12399 }, { 0x12480, 0x12543 }, { 0x12F90, 0x12FF0 }, - { 0x13000, 0x1342E }, + { 0x13000, 0x1342F }, + { 0x13441, 0x13446 }, { 0x14400, 0x14646 }, { 0x16800, 0x16A38 }, { 0x16A40, 0x16A5E }, @@ -715,10 +721,13 @@ { 0x1D7AA, 0x1D7C2 }, { 0x1D7C4, 0x1D7CB }, { 0x1DF00, 0x1DF1E }, + { 0x1DF25, 0x1DF2A }, + { 0x1E030, 0x1E06D }, { 0x1E100, 0x1E12C }, { 0x1E137, 0x1E13D }, { 0x1E290, 0x1E2AD }, { 0x1E2C0, 0x1E2EB }, + { 0x1E4D0, 0x1E4EB }, { 0x1E7E0, 0x1E7E6 }, { 0x1E7E8, 0x1E7EB }, { 0x1E7ED, 0x1E7EE }, @@ -823,6 +832,8 @@ 0x187F7, 0x18D00, 0x18D08, + 0x1B132, + 0x1B155, 0x1D4A2, 0x1E14E, 0x1E94B, @@ -830,7 +841,7 @@ 0x20000, 0x2A6DF, 0x2A700, - 0x2B738, + 0x2B739, 0x2B740, 0x2B81D, 0x2B820, @@ -839,6 +850,8 @@ 0x2EBE0, 0x30000, 0x3134A, + 0x31350, + 0x323AF, }; int @@ -1312,6 +1325,7 @@ { 0x1D7C4, 0x1D7C9, 0x1D7C4 }, { 0x1DF00, 0x1DF09, 0x1DF00 }, { 0x1DF0B, 0x1DF1E, 0x1DF0B }, + { 0x1DF25, 0x1DF2A, 0x1DF25 }, { 0x1E922, 0x1E943, 0x1E900 }, }; @@ -1593,12 +1607,14 @@ { 0x11C50, 0x11C59 }, { 0x11D50, 0x11D59 }, { 0x11DA0, 0x11DA9 }, + { 0x11F50, 0x11F59 }, { 0x16A60, 0x16A69 }, { 0x16AC0, 0x16AC9 }, { 0x16B50, 0x16B59 }, { 0x1D7CE, 0x1D7FF }, { 0x1E140, 0x1E149 }, { 0x1E2F0, 0x1E2F9 }, + { 0x1E4F0, 0x1E4F9 }, { 0x1E950, 0x1E959 }, { 0x1FBF0, 0x1FBF9 }, };