diff --git a/common/test/Makefile b/common/test/Makefile index d6262adf0..8c38dd92c 100644 --- a/common/test/Makefile +++ b/common/test/Makefile @@ -1,13 +1,18 @@ -# FIXME: Move to common/test -COMMON_TEST_PROGRAMS := \ - common/test/test_sphinx +COMMON_TEST_SRC := \ + common/test/test_sphinx.c +COMMON_TEST_OBJS := $(COMMON_TEST_SRC:.c=.o) +COMMON_TEST_PROGRAMS := $(COMMON_TEST_OBJS:.o=) COMMON_TEST_COMMON_OBJS := \ common/sphinx.o \ common/utils.o -$(COMMON_TEST_PROGRAMS): $(TEST_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) +$(COMMON_TEST_PROGRAMS): $(COMMON_TEST_COMMON_OBJS) $(BITCOIN_OBJS) +$(COMMON_TEST_OBJS): $(COMMON_HEADERS) $(COMMON_SRC) ALL_TEST_PROGRAMS += $(COMMON_TEST_PROGRAMS) ALL_OBJS += $(COMMON_TEST_PROGRAMS:=.o) +update-mocks: $(COMMON_TEST_SRC:%=update-mocks/%) + +check: $(COMMON_TEST_PROGRAMS:%=unittest/%) diff --git a/common/test/test_sphinx.c b/common/test/test_sphinx.c index 20d4eee93..6d9c2f80a 100644 --- a/common/test/test_sphinx.c +++ b/common/test/test_sphinx.c @@ -11,6 +11,52 @@ #include #include +/* AUTOGENERATED MOCKS START */ +/* Generated stub for fromwire */ +const u8 *fromwire(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, void *copy UNNEEDED, size_t n UNNEEDED) +{ fprintf(stderr, "fromwire called!\n"); abort(); } +/* Generated stub for fromwire_pad */ +void fromwire_pad(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_pad called!\n"); abort(); } +/* Generated stub for fromwire_short_channel_id */ +void fromwire_short_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, + struct short_channel_id *short_channel_id UNNEEDED) +{ fprintf(stderr, "fromwire_short_channel_id called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u32 */ +u32 fromwire_u32(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u32 called!\n"); abort(); } +/* Generated stub for fromwire_u64 */ +u64 fromwire_u64(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u64 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* Generated stub for towire */ +void towire(u8 **pptr UNNEEDED, const void *data UNNEEDED, size_t len UNNEEDED) +{ fprintf(stderr, "towire called!\n"); abort(); } +/* Generated stub for towire_pad */ +void towire_pad(u8 **pptr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_pad called!\n"); abort(); } +/* Generated stub for towire_short_channel_id */ +void towire_short_channel_id(u8 **pptr UNNEEDED, + const struct short_channel_id *short_channel_id UNNEEDED) +{ fprintf(stderr, "towire_short_channel_id called!\n"); abort(); } +/* Generated stub for towire_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u32 */ +void towire_u32(u8 **pptr UNNEEDED, u32 v UNNEEDED) +{ fprintf(stderr, "towire_u32 called!\n"); abort(); } +/* Generated stub for towire_u64 */ +void towire_u64(u8 **pptr UNNEEDED, u64 v UNNEEDED) +{ fprintf(stderr, "towire_u64 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* AUTOGENERATED MOCKS END */ secp256k1_context *secp256k1_ctx;