test.h

00001 
00151 /**************************************************************
00152  HISTORY
00153  7-Dec-2004     Graeme McKerrell    
00154     Updated to use the "lub_test_" prefix rather than "unittest_"
00155  18-Mar-2002        Graeme McKerrell    
00156   added unittest_stop_here() prototype
00157  16-Mar-2002        Graeme McKerrell    
00158   LINTed...
00159  4-Mar-2002     Graeme McKerrell    
00160   Ported across for use in Garibaldi
00161  28-Feb-2002        Graeme McKerrell    
00162   Created based on implentation header file.
00163   
00164 ---------------------------------------------------------------
00165  Copyright (c) 3Com Corporation. All Rights Reserved
00166 ***************************************************************/
00167 #ifndef _lub_test_h
00168 #define _lub_test_h
00169 
00170 #include <stdarg.h>
00171 #include "lub/types.h"
00172 
00173 #ifdef __cplusplus
00174 extern "C"
00175 {
00176 #endif /* __cplusplus */
00177  
00179 typedef enum {
00180   LUB_TEST_PASS, 
00181   LUB_TEST_FAIL  
00182 } lub_test_status_t;
00183 
00185 typedef enum {
00186   LUB_TEST_TERSE=0,
00187   LUB_TEST_NORMAL, 
00188   LUB_TEST_VERBOSE 
00189 } lub_test_verbosity_t;
00190 
00191 /*
00192  ************************************************************
00193  UNIT-TEST LEVEL FUNCTIONS
00194  ************************************************************
00195  */
00196 
00239 void lub_test_parse_command_line(
00240                             int argc, 
00242                             const char * const *argv);
00243   
00258 void lub_test_begin(
00260                    const char *fmt, 
00263                    ...);
00264   
00283 void 
00284         lub_test_log(
00285                          lub_test_verbosity_t level, 
00288                      const char *fmt, 
00290                          ...);
00291 
00309 lub_test_status_t 
00310         lub_test_get_status(void);
00311 
00330 int 
00331         lub_test_failure_count(void);
00332 
00352 void
00353         lub_test_end(void);
00354 
00370 void 
00371         lub_test_stop_here(void);
00372 
00373 /*
00374  ************************************************************
00375  SEQUENCE LEVEL FUNCTIONS
00376  ************************************************************
00377  */
00378 
00398 void
00399         lub_test_seq_begin(
00400                            int seq, 
00403                                    const char *fmt, 
00405                                    ...);
00406 
00425 void
00426         lub_test_seq_log(
00427                                  lub_test_verbosity_t level, 
00429                                  const char *fmt, 
00431                                  ...);
00432 
00450 void 
00451         lub_test_seq_end(void);
00452 
00453 /*
00454  ************************************************************
00455  TEST LEVEL FUNCTIONS
00456  ************************************************************
00457  */
00458 
00459 /*lint -esym(534,lub_test_check,lub_test_check_int,lub_test_check_float)
00460  Make LINT not moan about people ignoring the return values for
00461  certain files, the value return is for utility purpose rather than
00462  a value that ought to be used.
00463 
00464 ************************************************************/
00485 lub_test_status_t
00486     lub_test_check(
00487                        bool_t expr, 
00490                        const char *fmt, 
00492                        ...);
00493 
00515 lub_test_status_t
00516         lub_test_check_int(
00517                                int expect,
00519                                    int actual,
00521                                    const char *fmt, 
00523                                    ... );
00524 
00547 lub_test_status_t
00548         lag_test_test_float(
00549                             double      min,
00551                                     double      max,
00553                                     double      actual,
00555                                     const char *fmt, 
00557                                     ...);
00558 
00559 #ifdef __cplusplus
00560 }
00561 #endif /* __cplusplus */
00562 
00563 #endif /* _lub_test_h */
00564 

Generated on Tue Apr 29 13:41:07 2008 for CLISH by  doxygen 1.5.1