From: Alberto Leiva Popper Date: Tue, 12 Dec 2023 22:58:28 +0000 (-0600) Subject: Disable normal error messages during tests X-Git-Tag: 1.6.1~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da062d19821dd014b133d2b850308fa9caf743f1;p=thirdparty%2FFORT-validator.git Disable normal error messages during tests These error messages weren't showing up because of failing assertions; it was because the tests were checking error pipelines. Hide them by default. They can be restored in a pinch by compiling with -DPRINT_PRS ("-D print prints"): CFLAGS=-DPRINT_PRS make check Pending work from #101. --- diff --git a/test/mock.c b/test/mock.c index 195ebaab..b0bb560d 100644 --- a/test/mock.c +++ b/test/mock.c @@ -16,6 +16,8 @@ MOCK_TRUE(log_val_enabled, unsigned int l) MOCK_TRUE(log_op_enabled, unsigned int l) +/* CFLAGS=-DPRINT_PRS make check */ +#ifdef PRINT_PRS #define MOCK_PRINT \ do { \ va_list args; \ @@ -24,6 +26,9 @@ MOCK_TRUE(log_op_enabled, unsigned int l) va_end(args); \ printf("\n"); \ } while (0) +#else +#define MOCK_PRINT +#endif #define MOCK_VOID_PRINT(name) \ void \ diff --git a/test/rrdp_test.c b/test/rrdp_test.c index cab2b21e..9debbacc 100644 --- a/test/rrdp_test.c +++ b/test/rrdp_test.c @@ -8,6 +8,9 @@ /* Mocks */ +MOCK_ABORT_INT(__uri_create, struct rpki_uri **result, char const *tal, + enum uri_type type, bool is_notif, struct rpki_uri *notif, void const *guri, + size_t guri_len) __MOCK_ABORT(base64_decode, bool, false, BIO *in, unsigned char *out, bool has_nl, size_t out_len, size_t *out_written) MOCK_ABORT_INT(cache_download, struct rpki_cache *cache, struct rpki_uri *uri, diff --git a/test/tal_test.c b/test/tal_test.c index 930bed7b..fb43067f 100644 --- a/test/tal_test.c +++ b/test/tal_test.c @@ -22,6 +22,7 @@ MOCK_ABORT_INT(cache_download_alt, struct rpki_cache *cache, struct uri_list *uris, bool use_rrdp, uris_dl_cb cb, void *arg) MOCK_ABORT_PTR(cache_recover, rpki_uri, struct rpki_cache *cache, struct uri_list *uris, bool use_rrdp) +MOCK_ABORT_VOID(cache_teardown, void) MOCK_ABORT_INT(certificate_traverse, struct rpp *rpp_parent, struct rpki_uri *cert_uri) MOCK_ABORT_PTR(db_table_create, db_table, void) @@ -38,7 +39,6 @@ MOCK_ABORT_INT(handle_roa_v6, uint32_t as, struct ipv6_prefix const *prefix, uint8_t max_length, void *arg) MOCK_ABORT_INT(handle_router_key, unsigned char const *ski, struct asn_range const *asns, unsigned char const *spk, void *arg) -MOCK_ABORT_INT(init_tmpdir, void) MOCK_ABORT_VOID(rpp_refput, struct rpp *pp) MOCK_ABORT_INT(rrdp_update, struct rpki_uri *uri) MOCK(state_retrieve, struct validation *, NULL, void)