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

4.115
Last change on this file since d83f90b was 6fed43e, checked in by Joel Sherrill <joel.sherrill@…>, on 08/02/11 at 14:24:59

2011-08-02 Xiang Cui <medivhc@…>

  • configure.ac, fserror/test.c, fslink/test.c, fspermission/test.c, fsrdwr/init.c, fssymlink/test.c, fstime/test.c, mdosfs_support/fs_config.h, mdosfs_support/fs_support.c, mimfs_support/fs_support.c, mrfs_support/fs_config.h, support/fstest.h, support/fstest_support.c, support/ramdisk_support.c, support/ramdisk_support.h: Perform first phase of clean up.
  • 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 Exp $
10 */
11
12#ifndef __FSTEST_H
13#define __FSTEST_H
14
15#ifdef HAVE_CONFIG_H
16#include "config.h"
17#endif
18#include <pmacros.h>
19
20#define TIME_PRECISION  (2)
21#define TIME_EQUAL(x,y) (abs((x)-(y))<TIME_PRECISION)
22
23
24#define FS_PASS() do {puts("PASS");} while (0)
25#define FS_FAIL() do {\
26  printf( "FAIL   %s: %d \n", __FILE__, __LINE__ );\
27 } while (0)
28
29
30#define SHOW_MESSAGE(e, func, ...) printf(\
31    "Testing %-10s with arguments: %-20s EXPECT %s\n",\
32    #func,#__VA_ARGS__,#e)
33
34#define EXPECT_EQUAL(expect, function, ...)  do { \
35  SHOW_MESSAGE(#expect,function,__VA_ARGS__);\
36 if (expect==function(__VA_ARGS__)) \
37     FS_PASS();\
38 else \
39     FS_FAIL();\
40   } while (0)
41
42#define EXPECT_UNEQUAL(expect, function, ...)  do { \
43  SHOW_MESSAGE(#expect,function,__VA_ARGS__);\
44 if (expect!=function(__VA_ARGS__)) \
45     FS_PASS();\
46 else\
47     FS_FAIL();\
48   } while (0)
49
50#define EXPECT_ERROR(ERROR, function, ...)  do { \
51  SHOW_MESSAGE(#ERROR,function,#__VA_ARGS__);\
52 if ((-1==function(__VA_ARGS__)) && (errno==ERROR)) \
53     FS_PASS();\
54 else \
55     FS_FAIL();\
56   } while (0)
57
58
59#define BASE_FOR_TEST "/mnt"
60#endif
61
62
Note: See TracBrowser for help on using the repository browser.