diff options
author | David Goulet <dgoulet@torproject.org> | 2020-10-22 15:48:05 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-10-27 10:43:42 -0400 |
commit | 4c19eed35c8bae22cda219b7a4fb4a65d1c65525 (patch) | |
tree | 66d2575ad09ed7907b5079cc81ee578a73ce2211 /src/test/test_periodic_event.c | |
parent | f2e42045902524cb8277ab9674f9d669d2d8ab00 (diff) | |
download | tor-4c19eed35c8bae22cda219b7a4fb4a65d1c65525.tar.gz tor-4c19eed35c8bae22cda219b7a4fb4a65d1c65525.zip |
tests: Fix unit tests after adding new HS metrics module
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_periodic_event.c')
-rw-r--r-- | src/test/test_periodic_event.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test_periodic_event.c b/src/test/test_periodic_event.c index b7f1785805..1dd3f7a68d 100644 --- a/src/test/test_periodic_event.c +++ b/src/test/test_periodic_event.c @@ -17,6 +17,7 @@ #include "core/or/or.h" #include "app/config/config.h" #include "feature/hibernate/hibernate.h" +#include "feature/hs/hs_metrics.h" #include "feature/hs/hs_service.h" #include "core/mainloop/mainloop.h" #include "core/mainloop/netstatus.h" @@ -187,6 +188,7 @@ test_pe_launch(void *arg) done: if (to_remove) { + hs_metrics_service_free(&service); remove_service(get_hs_service_map(), to_remove); } hs_free_all(); @@ -279,6 +281,7 @@ test_pe_get_roles(void *arg) roles = get_my_roles(options); /* Remove it now so the hs_free_all() doesn't try to free stack memory. */ remove_service(get_hs_service_map(), &service); + hs_metrics_service_free(&service); tt_int_op(roles, OP_EQ, (PERIODIC_EVENT_ROLE_BRIDGEAUTH | PERIODIC_EVENT_ROLE_RELAY | PERIODIC_EVENT_ROLE_HS_SERVICE | PERIODIC_EVENT_ROLE_DIRSERVER | @@ -332,6 +335,7 @@ test_pe_hs_service(void *arg) /* Remove the service from the global map, it should trigger a rescan and * disable the HS service events. */ remove_service(get_hs_service_map(), &service); + hs_metrics_service_free(&service); for (int i = 0; mainloop_periodic_events[i].name; ++i) { periodic_event_item_t *item = &mainloop_periodic_events[i]; if (item->roles & PERIODIC_EVENT_ROLE_HS_SERVICE) { @@ -341,6 +345,7 @@ test_pe_hs_service(void *arg) done: if (to_remove) { + hs_metrics_service_free(&service); remove_service(get_hs_service_map(), to_remove); } hs_free_all(); |