- self = meshlink_get_node(mesh, "foo");
- if(!self) {
- fprintf(stderr, "Foo doesn't know about itself the second time\n");
- return 1;
- }
- if(strcmp(self->name, "foo")) {
- fprintf(stderr, "Foo thinks its name is %s the second time\n", self->name);
- return 1;
- }
+ // Check that we remembered we were reachable
+
+ assert(!meshlink_get_node_reachability(mesh, self, &last_reachable, &last_unreachable));
+ assert(last_reachable);
+ assert(last_unreachable);
+
+ // Check that the name is ignored now, and that we still are "foo".
+
+ assert(!meshlink_get_node(mesh, "bar"));
+ self = meshlink_get_self(mesh);
+ assert(self);
+ assert(!strcmp(self->name, "foo"));