test: delete default loop after test run
Delete the default event loop after the test completes. Keeps valgrind happy.
This commit is contained in:
parent
4e268f7718
commit
f090297f62
@ -415,7 +415,6 @@ static int test_tcp(unsigned int num_servers, unsigned int num_clients) {
|
||||
|
||||
free(clients);
|
||||
free(servers);
|
||||
uv_loop_delete(uv_default_loop()); /* Silence valgrind. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
#include "runner.h"
|
||||
#include "task.h"
|
||||
#include "uv.h"
|
||||
|
||||
char executable_path[PATHMAX] = { '\0' };
|
||||
|
||||
@ -293,11 +294,14 @@ out:
|
||||
*/
|
||||
int run_test_part(const char* test, const char* part) {
|
||||
task_entry_t* task;
|
||||
int r;
|
||||
|
||||
for (task = TASKS; task->main; task++) {
|
||||
if (strcmp(test, task->task_name) == 0
|
||||
&& strcmp(part, task->process_name) == 0) {
|
||||
return task->main();
|
||||
if (strcmp(test, task->task_name) == 0 &&
|
||||
strcmp(part, task->process_name) == 0) {
|
||||
r = task->main();
|
||||
uv_loop_delete(uv_default_loop());
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -140,7 +140,6 @@ TEST_IMPL(fs_poll) {
|
||||
ASSERT(poll_cb_called == 5);
|
||||
ASSERT(timer_cb_called == 2);
|
||||
ASSERT(close_cb_called == 1);
|
||||
uv_loop_delete(loop);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user