X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fbasicpp.cpp;h=4d126cf58dde2e2af42c0beb02317b375e3e8caf;hb=HEAD;hp=ff49e3d428f749e9d7d9845c6176d494ed47782f;hpb=6c897377f68fc23ca9a8b23a6ca204517998b2e9;p=meshlink diff --git a/test/basicpp.cpp b/test/basicpp.cpp index ff49e3d4..c0550ecf 100644 --- a/test/basicpp.cpp +++ b/test/basicpp.cpp @@ -9,7 +9,7 @@ using namespace std; -int main() { +int main(void) { assert(meshlink::destroy("basicpp_conf")); // Open a new meshlink instance. @@ -41,11 +41,14 @@ int main() { // Close the mesh and open it again, now with a different name parameter. mesh.close(); - assert(mesh.open("basicpp_conf", "bar", "basicpp", DEV_CLASS_BACKBONE)); + assert(!mesh.open("basicpp_conf", "bar", "basicpp", DEV_CLASS_BACKBONE)); + + // Open it without giving a name. + + assert(mesh.open("basicpp_conf", nullptr, "basicpp", DEV_CLASS_BACKBONE)); // Check that the name is ignored now, and that we still are "foo". - assert(!mesh.get_node("bar")); self = mesh.get_self(); assert(self); assert(!strcmp(self->name, "foo"));