X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fimport-export.c;fp=test%2Fimport-export.c;h=392f1dac18753eebfea70db506c591a48801e464;hb=781514e1c7f1fece3e4fee12e21815ebcab18f71;hp=bffe0fc49cabfd9aae8b8022b723106c43122a63;hpb=2224a56ea44bffdafbe29ba7b74d1a0adb0cbd95;p=meshlink diff --git a/test/import-export.c b/test/import-export.c index bffe0fc4..392f1dac 100644 --- a/test/import-export.c +++ b/test/import-export.c @@ -55,9 +55,15 @@ int main() { data = meshlink_export(mesh2); assert(data); + assert(meshlink_import(mesh1, data)); + + // Check that importing twice is fine assert(meshlink_import(mesh1, data)); free(data); + // Check that importing garbage is not fine + assert(!meshlink_import(mesh1, "Garbage\n")); + // Check that foo knows bar, but that it is not reachable. time_t last_reachable;