aboutsummaryrefslogtreecommitdiff
path: root/src/test/fakecircs.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-10-22 11:35:53 -0400
committerDavid Goulet <dgoulet@torproject.org>2019-10-28 13:17:11 -0400
commitdba249bc735b02b6cafe92e5be7e8df049c53ae6 (patch)
tree7d867b4c74b78d033e8959740f3480d7fdc9b44c /src/test/fakecircs.h
parenta41ec8491480ea27588225c8db108503b2d7f757 (diff)
downloadtor-dba249bc735b02b6cafe92e5be7e8df049c53ae6.tar.gz
tor-dba249bc735b02b6cafe92e5be7e8df049c53ae6.zip
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>
Diffstat (limited to 'src/test/fakecircs.h')
-rw-r--r--src/test/fakecircs.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/fakecircs.h b/src/test/fakecircs.h
new file mode 100644
index 0000000000..5fd02027f0
--- /dev/null
+++ b/src/test/fakecircs.h
@@ -0,0 +1,17 @@
+/* Copyright (c) 2019, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file fakecircs.h
+ * \brief Declarations for fake circuits for test suite use.
+ **/
+
+#ifndef TOR_FAKECIRCS_H
+#define TOR_FAKECIRCS_H
+
+#include "core/or/or_circuit_st.h"
+
+or_circuit_t *new_fake_orcirc(channel_t *nchan, channel_t *pchan);
+void free_fake_orcirc(or_circuit_t *orcirc);
+
+#endif /* TOR_FAKECIRCS_H */