X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fbasic.c;h=d3ac13735e37e98726fbf68d80eb72aefb96d12a;hb=eeef1270f5cc3c6872676d57c6d2befe372a6f20;hp=626d06f6270e885a3133dd0b5819567a0b2d676a;hpb=43ec833c7c2c151bafa7f1434905f51feebab4c0;p=meshlink diff --git a/test/basic.c b/test/basic.c index 626d06f6..d3ac1373 100644 --- a/test/basic.c +++ b/test/basic.c @@ -1,5 +1,7 @@ #include #include +#include +#include #include "meshlink.h" @@ -14,7 +16,7 @@ int main(int argc, char *argv[]) { // Check that our own node exists. - meshlink_node_t *self = meshlink_get_node(mesh, "foo"); + meshlink_node_t *self = meshlink_get_self(mesh); if(!self) { fprintf(stderr, "Foo does not know about itself\n"); return 1; @@ -57,7 +59,7 @@ int main(int argc, char *argv[]) { return 1; } - self = meshlink_get_node(mesh, "foo"); + self = meshlink_get_self(mesh); if(!self) { fprintf(stderr, "Foo doesn't know about itself the second time\n"); return 1; @@ -79,5 +81,17 @@ int main(int argc, char *argv[]) { meshlink_close(mesh); + // Destroy the mesh. + + if(!meshlink_destroy("basic_conf")) { + fprintf(stderr, "Could not destroy configuration\n"); + return 1; + } + + if(!access("basic_conf", F_OK) || errno != ENOENT) { + fprintf(stderr, "Configuration not fully destroyed\n"); + return 1; + } + return 0; }