8 #include "meshlink++.h"
13 assert(meshlink::destroy("basicpp_conf"));
15 // Open a new meshlink instance.
18 meshlink::mesh mesh("basicpp_conf", "foo", "basicpp", DEV_CLASS_BACKBONE);
19 assert(mesh.isOpen());
21 // Check that our own node exists.
23 meshlink::node *self = mesh.get_self();
25 assert(!strcmp(self->name, "foo"));
27 // Disable local discovery.
29 mesh.enable_discovery(false);
31 // Start and stop the mesh.
36 // Make sure we can start and stop the mesh again.
41 // Close the mesh and open it again, now with a different name parameter.
44 assert(mesh.open("basicpp_conf", "bar", "basicpp", DEV_CLASS_BACKBONE));
46 // Check that the name is ignored now, and that we still are "foo".
48 assert(!mesh.get_node("bar"));
49 self = mesh.get_self();
51 assert(!strcmp(self->name, "foo"));
53 // Start and stop the mesh.
55 mesh.enable_discovery(false);
63 assert(meshlink::destroy("basicpp_conf"));
65 DIR *dir = opendir("basicpp_conf");
68 while((ent = readdir(dir))) {
69 assert(!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."));