unittest: use common_setup / common_shutdown almost everywhere.

Avoids much cut & paste.  Some tests don't need any of it, but most
want at least some of this infrastructure.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-12-02 10:40:04 +10:30
parent 39f4ca98b5
commit ca2bd98082
43 changed files with 147 additions and 208 deletions

View File

@@ -2,6 +2,7 @@
#include <common/amount.h>
#include <common/utils.h>
#include <common/json.c>
#include <common/setup.h>
#include <wire/wire.h>
/* AUTOGENERATED MOCKS START */
@@ -264,10 +265,9 @@ static void remove_inside_obj(void)
"4", "four", NULL);
}
int main(void)
int main(int argc, char *argv[])
{
setup_locale();
setup_tmpctx();
common_setup(argv[0]);
sanity();
remove_one();
@@ -278,6 +278,6 @@ int main(void)
remove_complex();
remove_inside_obj();
tal_free(tmpctx);
printf("run-json_remove ok\n");
common_shutdown();
}