]> git.meshlink.io Git - meshlink/blobdiff - test/basicpp.cpp
Add a function to destroy a MeshLink instance.
[meshlink] / test / basicpp.cpp
index 34c0bacbf2a7b45d13b227a99378d3bbb0af67a9..3a0c75ac016fd4db7a5bf25a26c93b55be0e4246 100644 (file)
@@ -1,5 +1,7 @@
 #include <cstring>
 #include <iostream>
+#include <unistd.h>
+#include <cerrno>
 
 #include "meshlink++.h"
 
@@ -71,5 +73,15 @@ int main(int argc, char *argv[]) {
 
        mesh.stop();
 
+       if(!meshlink::destroy("basicpp_conf")) {
+               cerr << "Could not destroy configuration\n";
+               return 1;
+       }
+
+       if(!access("basic.conf", F_OK) || errno != ENOENT) {
+               cerr << "Configuration not fully destroyed\n";
+               return 1;
+       }
+
        return 0;
 }