test: Add fakecircs.{h|c} helper

Fake circuits are created everywhere in the unit tests. This is an attempt at
centralizing a "fake circuit creation" API like fakechans.c does for channel.

This commit introduces fakecircs.c and changes test_relay.c and
test_circpadding.c which were using roughly the same code.

This will allow easier OR circuit creation for the future tests in
test_circuitmux.c

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet
2019-10-22 11:35:53 -04:00
parent a41ec84914
commit dba249bc73
5 changed files with 122 additions and 104 deletions
+2
View File
@@ -99,6 +99,7 @@ if UNITTESTS_ENABLED
# ADD_C_FILE: INSERT SOURCES HERE.
src_test_test_SOURCES += \
src/test/fakecircs.c \
src/test/log_test_helpers.c \
src/test/hs_test_helpers.c \
src/test/rend_test_helpers.c \
@@ -339,6 +340,7 @@ src_test_test_timers_LDFLAGS = $(src_test_test_LDFLAGS)
# ADD_C_FILE: INSERT HEADERS HERE.
noinst_HEADERS+= \
src/test/fakechans.h \
src/test/fakecircs.h \
src/test/hs_test_helpers.h \
src/test/log_test_helpers.h \
src/test/rend_test_helpers.h \