X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fencrypted.c;h=e51debd65e210d6b70b4165d5a0dd1e374736812;hb=HEAD;hp=17b2fd80a7fc81f1a11ffdd30672758f97b2929a;hpb=9a2520c36431a8a5fd90451e97f488c22f4decc5;p=meshlink diff --git a/test/encrypted.c b/test/encrypted.c index 17b2fd80..ac0dfa92 100644 --- a/test/encrypted.c +++ b/test/encrypted.c @@ -1,14 +1,19 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif + #include #include #include #include #include #include +#include #include "meshlink.h" #include "utils.h" -int main() { +int main(void) { meshlink_set_log_cb(NULL, MESHLINK_DEBUG, log_cb); // Open a new meshlink instance. @@ -36,5 +41,15 @@ int main() { // Destroy the mesh. assert(meshlink_destroy("encrypted_conf")); - assert(access("encrypted_conf", F_OK) == -1 && errno == ENOENT); + + DIR *dir = opendir("encrypted_conf"); + assert(dir); + struct dirent *ent; + + while((ent = readdir(dir))) { + fprintf(stderr, "%s\n", ent->d_name); + assert(!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")); + } + + closedir(dir); }