From: Guus Sliepen Date: Sun, 23 Feb 2020 00:47:11 +0000 (+0100) Subject: Check that importing the same data twice is fine, but importing garbage is not. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=781514e1c7f1fece3e4fee12e21815ebcab18f71;p=meshlink Check that importing the same data twice is fine, but importing garbage is not. --- 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;