/* Test of filevercmp() function.
- Copyright (C) 2008-2009 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 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 "filevercmp.h"
-#include <stdio.h>
-#include <stdlib.h>
+#include <stddef.h>
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
- while (0)
+#include "macros.h"
/* set of well sorted examples */
static const char *const examples[] =
{
const char *const *j;
for (j = examples; *j; j++)
- {
- int result = filevercmp (*i, *j);
- if (result < 0)
- ASSERT (i < j);
- else if (0 < result)
- ASSERT (j < i);
- else
- ASSERT (i == j);
- }
+ {
+ int result = filevercmp (*i, *j);
+ if (result < 0)
+ ASSERT (i < j);
+ else if (0 < result)
+ ASSERT (j < i);
+ else
+ ASSERT (i == j);
+ }
}
return 0;