Changeset 4f684a in git for libpolys/tests/coeffs_test.h
- Timestamp:
- Apr 18, 2011, 9:06:26 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 0ffdec76b9340ac8c557e00b7c25bf36046ecf5b
- Parents:
- 845729b0cdf699d3eba18bc144ad8e14f46e1c99
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-04-18 21:06:26+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:17+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/tests/coeffs_test.h
r845729b r4f684a 22 22 23 23 24 #include <iostream>24 #include "common.h" 25 25 using namespace std; 26 26 27 27 28 #pragma GCC diagnostic ignored "-Wwrite-strings"29 28 namespace 30 29 { 31 static inline ostream& operator<< (ostream& o, const n_coeffType& type)32 {33 #define CASE(A) case A: return o << (" " # A) << " ";34 switch( type )35 {36 CASE(n_unknown);37 CASE(n_Zp);38 CASE(n_Q);39 CASE(n_R);40 CASE(n_GF);41 CASE(n_long_R);42 CASE(n_Zp_a);43 CASE(n_Q_a);44 CASE(n_long_C);45 CASE(n_Z);46 CASE(n_Zn);47 CASE(n_Zpn);48 CASE(n_Z2m);49 CASE(n_CF);50 default: return o << "Unknown type: [" << (const unsigned long) type << "]";51 }52 #undef CASE53 return o;54 }55 56 template<typename T>57 static inline std::string _2S(T i)58 {59 std::stringstream ss;60 ss << i;61 // std::string s = ss.str();62 return ss.str();63 }64 65 66 static inline std::string _2S(number a, const coeffs r)67 {68 n_Test(a,r);69 StringSetS("");70 n_Write(a, r);71 72 const char* s = StringAppendS("");73 74 std::stringstream ss; ss << s;75 76 StringSetS("");77 return ss.str();78 79 }80 81 82 }83 84 void PrintSized(/*const*/ number a, const coeffs r, BOOLEAN eoln = TRUE)85 {86 clog << _2S(a, r) << ", of size: " << n_Size(a, r);87 88 if( eoln )89 clog << endl;90 }91 92 30 93 31 void TestSum(const coeffs r, const unsigned long N) … … 365 303 366 304 305 } 306 367 307 368 308 class CoeffsTestSuite : public CxxTest::TestSuite 369 309 { 370 310 public: 371 void test_dummy() 372 { 373 float fnum = 2.00001f; 374 TS_ASSERT_DELTA (fnum, 2.0f, 0.0001f); 375 376 } 377 311 // void test_dummy() { float fnum = 2.00001f; TS_ASSERT_DELTA (fnum, 2.0f, 0.0001f); } 378 312 379 313 void test_Z2m4()
Note: See TracChangeset
for help on using the changeset viewer.