Changeset 71 for trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
- Timestamp:
- Jan 19, 2008, 12:09:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
r53 r71 5 5 #include <sstream> 6 6 #include <stdint.h> 7 #include "Common/include/Message.h" 7 8 #include "Common/include/ErrorMorpheo.h" 8 using namespace std; 9 #include "Common/include/ToString.h" 9 10 10 11 //-----[ Routine de test ]--------------------------------------- … … 12 13 static uint32_t num_test; 13 14 14 void test_ko_error (void)15 inline void test_ko_error (void) 15 16 { 16 string msg = "Test ko : error in test \""+ toString(num_test)+"\"";17 throw ( ErrorMorpheo (msg));17 string msg = "Test ko : error in test \""+morpheo::toString(num_test)+"\""; 18 throw (morpheo::ErrorMorpheo (msg)); 18 19 } 19 20 20 21 template <class T> 21 void test_ko (char * file, uint32_t line, T exp1, T exp2)22 inline void test_ko (char * file, uint32_t line, T exp1, T exp2) 22 23 { 23 24 cerr << "[" << num_test << "] : Test KO" … … 27 28 << " - Line : " << line << endl 28 29 << " * Expression is different" << endl 29 << " - exp1 : "+ toString(exp1) << endl30 << " - exp2 : "+ toString(exp2) << endl;30 << " - exp1 : "+morpheo::toString(exp1) << endl 31 << " - exp2 : "+morpheo::toString(exp2) << endl; 31 32 32 33 test_ko_error (); 33 34 }; 34 35 35 void test_ko (char * file, uint32_t line)36 inline void test_ko (char * file, uint32_t line) 36 37 { 37 38 cerr << "[" << num_test << "] : Test KO" … … 44 45 }; 45 46 46 void test_ok ()47 inline void test_ok () 47 48 { 48 cout << "[" << num_test << "] : Test OK" << endl;49 msg (_("[%d] : Test OK\n"), num_test); 49 50 50 51 num_test ++; 51 52 }; 52 53 53 void test_ok (char * file, uint32_t line)54 inline void test_ok (char * file, uint32_t line) 54 55 { 55 cout << "[" << num_test << "] : Test OK" 56 << "\tline " << line << endl 57 // << " * Localisation" << endl 58 // << " - File : " << file << endl 59 // << " - Line : " << line << endl 60 ; 56 msg (_("[%d] : Test OK\n"), num_test); 57 msg (_("\tline %d\n"), line); 61 58 62 59 num_test ++; … … 64 61 65 62 template <class T> 66 void test_ok (char * file, uint32_t line, T exp)63 inline void test_ok (char * file, uint32_t line, T exp) 67 64 { 68 cout << "[" << num_test << "] : Test OK" 69 << "\tline " << line 70 << "\tvalue : " << toString(exp) << endl 71 // << " * Localisation" << endl 72 // << " - File : " << file << endl 73 // << " - Line : " << line << endl 74 // << " * Expression" << endl 75 // << " - exp : "+toString(exp) << endl 76 ; 65 msg (_("[%d] : Test OK\n"), num_test); 66 msg (_("\tline %d\n"), line); 67 msg (_("\tvalue %s\n"), (morpheo::toString(exp)).c_str()); 77 68 78 69 num_test ++; … … 80 71 81 72 template <class T> 82 void test(char * file, uint32_t line, T exp1, T exp2)73 inline void test(char * file, uint32_t line, T exp1, T exp2) 83 74 { 84 75 if (exp1 != exp2)
Note: See TracChangeset
for help on using the changeset viewer.