00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00041 #ifndef __STRUCTURAL_TEST_H__
00042 #define __STRUCTURAL_TEST_H__
00043
00044 typedef struct test_result_struct
00045 {
00046 unsigned int tests;
00047 unsigned int functions;
00048 unsigned int errors;
00049 unsigned int notimplemented;
00050 } test_result;
00051
00057 #define IPSEC_TESTING_EVALUATE(__retcode__, __sub_results__, __functionname__, __msg__) { \
00058 switch(__retcode__) { \
00059 case IPSEC_STATUS_SUCCESS: ; \
00060 IPSEC_LOG_TST_NOMSG(__functionname__, "SUCCESS "); \
00061 printf __msg__ ; \
00062 printf("\n"); \
00063 break; \
00064 case IPSEC_STATUS_NOT_IMPLEMENTED: ; __sub_results__.notimplemented++; \
00065 IPSEC_LOG_TST_NOMSG(__functionname__, "NOT IMPL."); \
00066 printf __msg__ ; \
00067 printf("\n"); \
00068 break; \
00069 default: ; __sub_results__.errors += __retcode__; \
00070 IPSEC_LOG_TST_NOMSG(__functionname__, "ERROR "); \
00071 printf("(%d errors)", __retcode__); \
00072 printf __msg__ ; \
00073 printf("\n"); \
00074 } \
00075 } \
00076
00077
00078
00079
00080 #endif
00081
00082