framework/c/inc/le_test.h
Go to the documentation of this file.
00001 
00144 //--------------------------------------------------------------------------------------------------
00152 #ifndef LEGATO_TEST_INCLUDE_GUARD
00153 #define LEGATO_TEST_INCLUDE_GUARD
00154 
00155 
00156 //--------------------------------------------------------------------------------------------------
00162 //--------------------------------------------------------------------------------------------------
00163 void _le_test_Init(void);
00164 void _le_test_Fail(void);
00165 int _le_test_GetNumFailures(void);
00166 // @}
00167 
00168 
00169 //--------------------------------------------------------------------------------------------------
00173 //--------------------------------------------------------------------------------------------------
00174 #define LE_TEST_INIT                _le_test_Init()
00175 
00176 
00177 //--------------------------------------------------------------------------------------------------
00184 //--------------------------------------------------------------------------------------------------
00185 #define LE_TEST(testResult)         if (testResult) \
00186                                     { \
00187                                         LE_INFO("Unit Test Passed: '%s'", #testResult); \
00188                                     } \
00189                                     else \
00190                                     { \
00191                                         LE_ERROR("Unit Test Failed: '%s'", #testResult); \
00192                                         _le_test_Fail(); \
00193                                     }
00194 
00195 
00196 //--------------------------------------------------------------------------------------------------
00200 //--------------------------------------------------------------------------------------------------
00201 #define LE_TEST_SUMMARY             exit(_le_test_GetNumFailures());
00202 
00203 
00204 //--------------------------------------------------------------------------------------------------
00208 //--------------------------------------------------------------------------------------------------
00209 #define LE_TEST_NUM_FAILURES        _le_test_GetNumFailures()
00210 
00211 
00212 
00213 #endif // LEGATO_TEST_INCLUDE_GUARD
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines