/* Test of getdelim() function.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007-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
#include <config.h>
#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (getdelim, ssize_t, (char **, size_t *, int, FILE *));
+
#include <stdlib.h>
#include <string.h>
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- abort (); \
- } \
- } \
- while (0)
+#include "macros.h"
int
-main (int argc, char **argv)
+main (void)
{
FILE *f;
char *line = NULL;
if (!f || fwrite ("anbcnd\0f", 1, 8, f) != 8 || fclose (f) != 0)
{
fputs ("Failed to create sample file.\n", stderr);
- unlink ("test-getdelim.txt");
+ remove ("test-getdelim.txt");
return 1;
}
f = fopen ("test-getdelim.txt", "rb");
if (!f)
{
fputs ("Failed to reopen sample file.\n", stderr);
- unlink ("test-getdelim.txt");
+ remove ("test-getdelim.txt");
return 1;
}
free (line);
fclose (f);
- unlink ("test-getdelim.txt");
+ remove ("test-getdelim.txt");
return 0;
}