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

4.115
Last change on this file since e5b2ed7 was e5b2ed7, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/07/11 at 07:43:15

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

  • imfs_support/fs_supprot.h, support/fstest.h, support/ramdisk_support.h: Don't include config.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#include "pmacros.h"
16
17#define TIME_PRECISION  (2)
18#define TIME_EQUAL(x,y) (abs((x)-(y))<TIME_PRECISION)
19
20
21#define FS_PASS() do {puts("PASS");} while (0)
22#define FS_FAIL() do {\
23  printf( "FAIL   %s: %d \n", __FILE__, __LINE__ );\
24 } while (0)
25
26
27#define SHOW_MESSAGE(e, func, ...) printf(\
28    "Testing %-10s with arguments: %-20s EXPECT %s\n",\
29    #func,#__VA_ARGS__,#e)
30
31#define EXPECT_EQUAL(expect, function, ...)  do { \
32  SHOW_MESSAGE(#expect,function,__VA_ARGS__);\
33 if (expect==function(__VA_ARGS__)) \
34     FS_PASS();\
35 else \
36     FS_FAIL();\
37   } while (0)
38
39#define EXPECT_UNEQUAL(expect, function, ...)  do { \
40  SHOW_MESSAGE(#expect,function,__VA_ARGS__);\
41 if (expect!=function(__VA_ARGS__)) \
42     FS_PASS();\
43 else\
44     FS_FAIL();\
45   } while (0)
46
47#define EXPECT_ERROR(ERROR, function, ...)  do { \
48  SHOW_MESSAGE(#ERROR,function,#__VA_ARGS__);\
49 if ((-1==function(__VA_ARGS__)) && (errno==ERROR)) \
50     FS_PASS();\
51 else \
52     FS_FAIL();\
53   } while (0)
54
55
56#define BASE_FOR_TEST "/mnt"
57#endif
Note: See TracBrowser for help on using the repository browser.