X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest-link.c;h=934dddb4ccbaede9c0b0c2443f39fcd96009cedd;hb=5191b3546cfb6c163228c23f214e325ddf60d46f;hp=255a939e6d1f4294008e5cc3a827ad86916e81d2;hpb=8e0d8019628758a7cf002f9b295a652f4bee261a;p=gnulib.git diff --git a/tests/test-link.c b/tests/test-link.c index 255a939e6..934dddb4c 100644 --- a/tests/test-link.c +++ b/tests/test-link.c @@ -1,9 +1,9 @@ /* Test of link() function. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,26 +18,30 @@ #include +#include "signature.h" +SIGNATURE_CHECK (link, int, (char const *, char const *)); + +#include +#include +#include #include #include +#include +#include +#include + +#include "ignore-value.h" +#include "macros.h" + +#define BASE "test-link.t" -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "test-link.h" int -main (int argc, char **argv) +main (void) { - ASSERT (argc == 3); - ASSERT (link (argv[1], argv[2]) == 0); + /* Remove any garbage left from previous partial runs. */ + ignore_value (system ("rm -rf " BASE "*")); - return 0; + return test_link (link, true); }