]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Disable normal error messages during tests
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 12 Dec 2023 22:58:28 +0000 (16:58 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 12 Dec 2023 23:02:39 +0000 (17:02 -0600)
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.

test/mock.c
test/rrdp_test.c
test/tal_test.c

index 195ebaaba6888730e4c101a207f21b6cb99880bf..b0bb560df20c64bb9909575d04372c28603af268 100644 (file)
@@ -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                                                            \
index cab2b21e0ed2e073125a170d4b2fbeabd1736690..9debbacc3cc2d59fa7ce81790afccba8511b66dd 100644 (file)
@@ -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,
index 930bed7b0f75d191278a9a5d6688c6f3c3d75e68..fb43067f84209da24bc4e70b8b95cd7b791f90df 100644 (file)
@@ -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)