Rename this for consistency.
[beanstalkd.git] / cut.h
blob4d9e0369009ea84077759fd8bb4b76642194bf95
1 /*
2 * cut.h
3 * CUT 2.3
5 * Copyright (c) 2001 Samuel A. Falvo II, William D. Tanksley
6 * See CUT-LICENSE.TXT for details.
8 * Based on WDT's "TestAssert" package.
10 * $Log: cut.h,v $
11 * Revision 1.4 2003/03/18 05:53:50 sfalvo
12 * ADD: cutgen.c: cut_exit() -- common exit point; returns proper error code
13 * at all times.
15 * FIX: cutgen.c: Factored all instances of exit() to invoke cut_exit()
16 * instead. This fixes the bug #703793.
18 * Revision 1.3 2003/03/13 04:27:54 sfalvo
19 * ADD: LICENSE.TXT -- zlib license
21 * ADD: README cut.h cutgen.c -- Changelog token for CVS
23 * FIX: test/bringup-failure -- reflects new usage for bringups and
24 * teardowns in CUT 2.2.
28 #ifndef CUT_CUT_H_INCLUDED
29 #define CUT_CUT_H_INCLUDED
31 typedef void CUTTakedownFunction( void );
33 void cut_start ( char *, CUTTakedownFunction * );
34 void cut_init ( int breakpoint );
35 void cut_break_formatting ( void );
36 void cut_resume_formatting( void );
37 void cut_interject( const char *, ... );
39 #define cut_end(t) __cut_end( __FILE__, __LINE__, t )
40 #define cut_mark_point() __cut_mark_point(__FILE__,__LINE__)
41 #define cut_check_errors() __cut_check_errors( __FILE__, __LINE__ )
42 #define ASSERT(X,msg) __cut_assert(__FILE__,__LINE__,msg,#X,X)
44 #define ASSERT_EQUALS(X,Y,msg) __cut_assert_equals( __FILE__, __LINE__, msg, #X " == " #Y, ( (X) == (Y) ), X )
46 #define STATIC_ASSERT(X) extern bool __static_ASSERT_at_line_##__LINE__##__[ (0!=(X))*2-1 ];
49 * These functions are not officially "public". They exist here because they
50 * need to be for proper operation of CUT. Please use the aforementioned
51 * macros instead.
54 void __cut_end ( char *, int, char * );
55 void __cut_mark_point ( char *, int );
56 void __cut_assert ( char *, int, char *, char *, int );
57 void __cut_assert_equals( char *, int, char *, char *, int, int );
58 int __cut_check_errors ( char *, int );
60 #endif