Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
r83 r88 1 #ifndef TEST_H 2 #define TEST_H 1 #ifndef Morpheo_Test_h 2 #define Morpheo_Test_h 3 4 /* 5 * $Id$ 6 * 7 * [ Description ] 8 * 9 * Macro / function to test 10 */ 3 11 4 12 #include <iostream> … … 11 19 namespace morpheo { 12 20 13 //-----[ Routine de test ]--------------------------------------- 21 #define STR_OK "Test OK" 22 #define STR_KO "Test KO" 14 23 15 24 static uint32_t num_test; … … 24 33 inline void test_ko (char * file, uint32_t line, T exp1, T exp2) 25 34 { 26 std::cerr << "[" << num_test << "] : Test KO" 35 fflush (stdout); 36 fflush (stderr); 37 38 std::cerr << "[" << num_test << "] : " << STR_KO 27 39 << "\tline " << line << std::endl 28 40 << " * Localisation" << std::endl … … 38 50 inline void test_ko (char * file, uint32_t line) 39 51 { 40 std::cerr << "[" << num_test << "] : Test KO" 52 fflush (stdout); 53 fflush (stderr); 54 55 std::cerr << "[" << num_test << "] : " << STR_KO 41 56 << "\tline " << line << std::endl 42 57 << " * Localisation" << std::endl … … 49 64 inline void test_ok () 50 65 { 51 msg (_("[%d] : Test OK\n"), num_test); 66 fflush (stdout); 67 fflush (stderr); 68 69 msg (_("[%d] : %s\n"), num_test,STR_OK); 52 70 53 71 num_test ++; … … 56 74 inline void test_ok (char * file, uint32_t line) 57 75 { 58 msg (_("[%d] : Test OK\n"), num_test); 76 fflush (stdout); 77 fflush (stderr); 78 79 msg (_("[%d] : %s\n"), num_test,STR_OK); 59 80 msg (_("\tline %d\n"), line); 60 81 … … 65 86 inline void test_ok (char * file, uint32_t line, T exp) 66 87 { 67 msg (_("[%d] : Test OK\n"), num_test); 88 fflush (stdout); 89 fflush (stderr); 90 91 msg (_("[%d] : %s\n"), num_test, STR_OK); 68 92 msg (_("\tline %d\n"), line); 69 93 msg (_("\tvalue %s\n"), (morpheo::toString(exp)).c_str()); … … 91 115 msg (str); \ 92 116 msg (_("\n")); \ 117 fflush (stdout); \ 93 118 } while(0) 94 95 119 96 120 #ifndef CYCLE_MAX … … 109 133 } \ 110 134 \ 111 if ( cycle_current > CYCLE_MAX)\135 if ((CYCLE_MAX != 0) and (cycle_current > CYCLE_MAX)) \ 112 136 { \ 113 137 TEST_KO("Maximal cycles Reached"); \
Note: See TracChangeset
for help on using the changeset viewer.