Changeset 75 for trunk/IPs/systemC/processor/Morpheo/Common
- Timestamp:
- Jan 31, 2008, 6:46:41 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Common/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
r71 r75 9 9 #include "Common/include/ToString.h" 10 10 11 namespace morpheo { 12 11 13 //-----[ Routine de test ]--------------------------------------- 12 14 … … 15 17 inline void test_ko_error (void) 16 18 { 17 st ring msg = "Test ko : error in test \""+morpheo::toString(num_test)+"\"";19 std::string msg = "Test ko : error in test \""+morpheo::toString(num_test)+"\""; 18 20 throw (morpheo::ErrorMorpheo (msg)); 19 21 } … … 22 24 inline void test_ko (char * file, uint32_t line, T exp1, T exp2) 23 25 { 24 cerr << "[" << num_test << "] : Test KO"25 << "\tline " << line << endl26 << " * Localisation" << endl27 << " - File : " << file << endl28 << " - Line : " << line << endl29 << " * Expression is different" << endl30 << " - exp1 : "+morpheo::toString(exp1) << endl31 << " - exp2 : "+morpheo::toString(exp2) << endl;26 std::cerr << "[" << num_test << "] : Test KO" 27 << "\tline " << line << std::endl 28 << " * Localisation" << std::endl 29 << " - File : " << file << std::endl 30 << " - Line : " << line << std::endl 31 << " * Expression is different" << std::endl 32 << " - exp1 : "+morpheo::toString(exp1) << std::endl 33 << " - exp2 : "+morpheo::toString(exp2) << std::endl; 32 34 33 35 test_ko_error (); … … 36 38 inline void test_ko (char * file, uint32_t line) 37 39 { 38 cerr << "[" << num_test << "] : Test KO"39 << "\tline " << line << endl40 << " * Localisation" << endl41 << " - File : " << file << endl42 << " - Line : " << line << endl;40 std::cerr << "[" << num_test << "] : Test KO" 41 << "\tline " << line << std::endl 42 << " * Localisation" << std::endl 43 << " - File : " << file << std::endl 44 << " - Line : " << line << std::endl; 43 45 44 46 test_ko_error (); … … 79 81 }; 80 82 81 #define TEST(type,exp1,exp2) do { test<type> (__FILE__,__LINE__,exp1,exp2);} while(0)82 #define TEST_STR(type,exp1,exp2,str...) do {fprintf(stdout,str); fprintf(stdout,"\n"); test<type> (__FILE__,__LINE__,exp1,exp2);} while(0)83 #define TEST_OK(str...) do {fprintf(stdout,str); fprintf(stdout,"\n"); test_ok(__FILE__,__LINE__);} while(0)84 #define TEST_KO(str...) do {fprintf(stdout,str); fprintf(stdout,"\n"); test_ko(__FILE__,__LINE__);} while(0)83 #define TEST(type,exp1,exp2) do {morpheo::test<type> (__FILE__,__LINE__,exp1,exp2);} while(0) 84 #define TEST_STR(type,exp1,exp2,str...) do {fprintf(stdout,str); fprintf(stdout,"\n"); morpheo::test<type> (__FILE__,__LINE__,exp1,exp2);} while(0) 85 #define TEST_OK(str...) do {fprintf(stdout,str); fprintf(stdout,"\n"); morpheo::test_ok(__FILE__,__LINE__);} while(0) 86 #define TEST_KO(str...) do {fprintf(stdout,str); fprintf(stdout,"\n"); morpheo::test_ko(__FILE__,__LINE__);} while(0) 85 87 86 88 89 }; 87 90 #endif -
trunk/IPs/systemC/processor/Morpheo/Common/include/ToBase2.h
r43 r75 10 10 11 11 #include <sstream> 12 using namespace std;13 12 14 13 namespace morpheo { … … 16 15 template<typename T> inline std::string toBase2 (const T& value, const uint32_t & size) 17 16 { 18 ostringstream res;17 std::ostringstream res; 19 18 T mask = 1<<(size-1); 20 19
Note: See TracChangeset
for help on using the changeset viewer.