src/vfer_tests.h File Reference

Header file that is used by protocol tests. More...

#include "vfer.h"

Go to the source code of this file.

Defines

#define ASSERT(TEST)
 abort if test fails
#define T_ERR(FUNC,)
#define TEST_CHECK(TO_TEST, MESG)
#define TEST_ERR
#define TEST_OUT
#define TEST_PRINT(FUNC,)
#define TEST_SUMMARY()   { fprintf(test_err, "%s faulty tests: %d / %d\n", test_name, test_faults, test_max_faults); }

Functions

void TEST_INIT (char *TEST, char *File, FILE *OUT, FILE *ERR)

Variables

FILE * test_err
int test_faults
char test_file [32]
int test_max_faults
char test_name [32]
FILE * test_out


Detailed Description

Header file that is used by protocol tests.

Author:
Ivan Beschastnikh
This header file includes useful macros & functions for error and debug processing.

Definition in file vfer_tests.h.


Define Documentation

#define ASSERT ( TEST   ) 

Value:

do { \
     bool _ok = (TEST); \
     TEST_CHECK(_ok, #TEST " is false"); \
     if (!_ok) { \
         TEST_SUMMARY(); \
         exit(1); \
     } \
     } while(0)
abort if test fails

Definition at line 102 of file vfer_tests.h.

#define T_ERR ( FUNC   ) 

Value:

do { \
                if (test_err != NULL) { \
                fprintf(test_err, "%-13s [ %-20s ] ERROR ", test_name, FUNC); \
                fprintf(test_err, __VA_ARGS__); \
                fprintf(test_err, "\n"); }} while (0)

Definition at line 53 of file vfer_tests.h.

#define TEST_CHECK ( TO_TEST,
MESG   ) 

Value:

{ \
        test_max_faults++; \
        if (!TO_TEST) { \
                fprintf(test_err, "%s *** test failed: %s ***\n", test_name, MESG); \
                test_faults++; \
        }}

Definition at line 92 of file vfer_tests.h.

#define TEST_ERR

Definition at line 37 of file vfer_tests.h.

#define TEST_OUT

Definition at line 39 of file vfer_tests.h.

#define TEST_PRINT ( FUNC   ) 

Value:

do { \
                if (test_out != NULL) { \
                fprintf(test_out, "%-13s [ %-20s ] ", test_name, FUNC); \
                fprintf(test_out, __VA_ARGS__); \
                fprintf(test_out, "\n"); }} while (0)

Definition at line 43 of file vfer_tests.h.

 
#define TEST_SUMMARY (  )     { fprintf(test_err, "%s faulty tests: %d / %d\n", test_name, test_faults, test_max_faults); }

Definition at line 99 of file vfer_tests.h.


Function Documentation

void TEST_INIT ( char *  TEST,
char *  File,
FILE *  OUT,
FILE *  ERR 
)

Definition at line 72 of file vfer_tests.h.


Variable Documentation

FILE* test_err

Definition at line 27 of file vfer_tests.h.

int test_faults

Definition at line 33 of file vfer_tests.h.

char test_file[32]

Definition at line 30 of file vfer_tests.h.

int test_max_faults

Definition at line 34 of file vfer_tests.h.

char test_name[32]

Definition at line 29 of file vfer_tests.h.

FILE* test_out

Definition at line 26 of file vfer_tests.h.


Generated on Tue Aug 8 16:07:22 2006 for VFER by  doxygen 1.4.7