mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
tests: use common_setup/common_shutdown to avoid leaks.
It also does more checks (like taken() checks). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <common/channel_id.h>
|
||||
#include <common/json_stream.h>
|
||||
#include <common/node_id.h>
|
||||
#include <common/setup.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
@@ -171,7 +172,7 @@ ssize_t test_read(int fd UNUSED, void *buf, size_t len)
|
||||
|
||||
int main(int argc UNUSED, char *argv[])
|
||||
{
|
||||
setup_locale();
|
||||
common_setup(argv[0]);
|
||||
|
||||
char *fake_argv[] = { argv[0], "--lightning-dir=/tmp/", "test", "-N", "none", NULL };
|
||||
|
||||
@@ -200,7 +201,6 @@ int main(int argc UNUSED, char *argv[])
|
||||
max_read_return = -1;
|
||||
assert(test_main(5, fake_argv) == 0);
|
||||
tal_free(response);
|
||||
assert(!taken_any());
|
||||
take_cleanup();
|
||||
common_shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user