diff options
Diffstat (limited to 'tests/stubs.c')
| -rw-r--r-- | tests/stubs.c | 37 |
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. */ | ||
| 14 | void 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. */ | ||
| 29 | void clean_init(void) {} | ||
| 30 | void clean_deinit(void) {} | ||
| 31 | int clean_single_torrent(ot_torrent *torrent) { | ||
| 32 | (void)torrent; | ||
| 33 | return 0; | ||
| 34 | } | ||
| 35 | void fullscrape_init(void) {} | ||
| 36 | void fullscrape_deinit(void) {} | ||
| 37 | void livesync_init(void) {} | ||
| 38 | void livesync_deinit(void) {} | ||
| 39 | void livesync_tell(struct ot_workstruct *ws) { (void)ws; } | ||
| 40 | void stats_init(void) {} | ||
| 41 | void stats_deinit(void) {} | ||
| 42 | void 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 | } | ||
| 48 | void stats_counters_register(struct ot_workstruct *ws) { (void)ws; } | ||
| 49 | void stats_counters_retire(struct ot_workstruct *ws) { (void)ws; } | ||
| 50 | |||
| 51 | const char *g_stats_path; | ||
| 52 | ssize_t g_stats_path_len; | ||
| 53 | uint32_t g_tracker_id; | ||
