X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-getcwd.c;h=2502b02cecd9d1607ec5f5d5a238ed58ee41bd1d;hb=5f1cfee9e825db39e75bc2388856fb274d395e20;hp=2733e4f6cf85079c7639133bdd9882fd7855e1e6;hpb=e2b8816f0465fa211eb5b49ecbeb78e9c3cc46b8;p=gnulib.git diff --git a/tests/test-getcwd.c b/tests/test-getcwd.c index 2733e4f6c..2502b02ce 100644 --- a/tests/test-getcwd.c +++ b/tests/test-getcwd.c @@ -1,9 +1,9 @@ /* Test of getcwd() function. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 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,21 +18,14 @@ #include +#include "signature.h" +SIGNATURE_CHECK (getcwd, char *, (char *, size_t)); + #include #include #include -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" int main (int argc, char **argv) @@ -43,7 +36,7 @@ main (int argc, char **argv) if (1 < argc) { if (chdir (argv[1]) == 0) - printf ("changed to directory %s\n", argv[1]); + printf ("changed to directory %s\n", argv[1]); } pwd1 = getcwd (NULL, 0); @@ -62,7 +55,7 @@ main (int argc, char **argv) free (pwd2); { size_t len = strlen (pwd1); - size_t i = len - 10; + ssize_t i = len - 10; if (i < 0) i = 0; pwd2 = malloc (len + 2);