source: rtems/testsuites/fstests/support/fstest.h @ 32448524

4.115
Last change on this file since 32448524 was 32448524, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/30/11 at 03:07:21

2011-09-30 Ralf Corsépius <ralf.corsepius@…>

  • fserror/test.c, fslink/test.c, fspatheval/test.c, fspermission/test.c, fsrdwr/init.c, fssymlink/test.c, fstime/test.c, support/fstest_support.c, support/ramdisk_support.c: Explicitly include "pmacros.h".
  • support/fstest.h: Don't include "pmacros.h".
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#ifndef __FSTEST_H
13#define __FSTEST_H
14
15#define TIME_PRECISION  (2)
16#define TIME_EQUAL(x,y) (abs((x)-(y))<TIME_PRECISION)
17
18
19#define FS_PASS() do {puts("PASS");} while (0)
20#define FS_FAIL() do {\
21  printf( "FAIL   %s: %d \n", __FILE__, __LINE__ );\
22 } while (0)
23
24
25#define SHOW_MESSAGE(e, func, ...) printf(\
26    "Testing %-10s with arguments: %-20s EXPECT %s\n",\
27    #func,#__VA_ARGS__,#e)
28
29#define EXPECT_EQUAL(expect, function, ...)  do { \
30  SHOW_MESSAGE(#expect,function,__VA_ARGS__);\
31 if (expect==function(__VA_ARGS__)) \
32     FS_PASS();\
33 else \
34     FS_FAIL();\
35   } while (0)
36
37#define EXPECT_UNEQUAL(expect, function, ...)  do { \
38  SHOW_MESSAGE(#expect,function,__VA_ARGS__);\
39 if (expect!=function(__VA_ARGS__)) \
40     FS_PASS();\
41 else\
42     FS_FAIL();\
43   } while (0)
44
45#define EXPECT_ERROR(ERROR, function, ...)  do { \
46  SHOW_MESSAGE(#ERROR,function,#__VA_ARGS__);\
47 if ((-1==function(__VA_ARGS__)) && (errno==ERROR)) \
48     FS_PASS();\
49 else \
50     FS_FAIL();\
51   } while (0)
52
53
54#define BASE_FOR_TEST "/mnt"
55#endif
Note: See TracBrowser for help on using the repository browser.