summaryrefslogtreecommitdiff
path: root/tests/stubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stubs.c')
-rw-r--r--tests/stubs.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/tests/stubs.c b/tests/stubs.c
index a8e6962..f7ac679 100644
--- a/tests/stubs.c
+++ b/tests/stubs.c
@@ -1,18 +1,14 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. 2 It is considered beerware. Prost. Skol. Cheers or whatever. */
3
4 $id$ */
5 3
6/* Stubs for symbols the modules under test reference but never reach along 4/* Stubs for symbols the modules under test reference but never reach along
7 the paths the tests exercise. If a test ever does reach one, the missing 5 the paths the tests exercise. If a test ever does reach one, the missing
8 behaviour should be supplied here rather than the test weakened. */ 6 behaviour should be supplied here rather than the test weakened. */
9 7
10/* Opentracker */ 8/* Opentracker */
9#include "ot_stats.h"
11#include "trackerlogic.h" 10#include "trackerlogic.h"
12 11
13/* ot_vector.c calls this from vector_clean_list, which no test drives yet. */
14void free_peerlist(ot_peerlist *peer_list) { (void)peer_list; }
15
16/* ot_accesslist.c is built with WANT_ACCESSLIST_BLACK so that the hash parser 12/* ot_accesslist.c is built with WANT_ACCESSLIST_BLACK so that the hash parser
17 is reachable. These two belong to accesslist_readfile and the reload worker, 13 is reachable. These two belong to accesslist_readfile and the reload worker,
18 neither of which any test drives. */ 14 neither of which any test drives. */
@@ -26,3 +22,32 @@ long io_trywrite(long d, const char *buf, long len) {
26 (void)buf; 22 (void)buf;
27 return len; 23 return len;
28} 24}
25
26/* trackerlogic.c is under test, and starting it up starts every module it
27 leans on. None of them is driven by these tests, so they are answered here
28 rather than linked in and left to run threads of their own. */
29void clean_init(void) {}
30void clean_deinit(void) {}
31int clean_single_torrent(ot_torrent *torrent) {
32 (void)torrent;
33 return 0;
34}
35void fullscrape_init(void) {}
36void fullscrape_deinit(void) {}
37void livesync_init(void) {}
38void livesync_deinit(void) {}
39void livesync_tell(struct ot_workstruct *ws) { (void)ws; }
40void stats_init(void) {}
41void stats_deinit(void) {}
42void stats_issue_event(struct ot_workstruct *ws, ot_status_event event, PROTO_FLAG proto, uintptr_t event_data) {
43 (void)ws;
44 (void)event;
45 (void)proto;
46 (void)event_data;
47}
48void stats_counters_register(struct ot_workstruct *ws) { (void)ws; }
49void stats_counters_retire(struct ot_workstruct *ws) { (void)ws; }
50
51const char *g_stats_path;
52ssize_t g_stats_path_len;
53uint32_t g_tracker_id;