]> git.meshlink.io Git - meshlink/blobdiff - test/basicpp.cpp
Allow meshlink_open() to be called with a NULL name.
[meshlink] / test / basicpp.cpp
index ff49e3d428f749e9d7d9845c6176d494ed47782f..2f4e5c84a12d727349f751540ac33a60d26c160d 100644 (file)
@@ -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"));