Changeset 4f684a in git
- Timestamp:
- Apr 18, 2011, 9:06:26 PM (12 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- 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
- Location:
- libpolys/tests
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/tests/Makefile.am
r845729b r4f684a 2 2 3 3 ## for testing... 4 AM_LDFLAGS = -L${top_builddir}/ coeffs -L${top_builddir}/reporter -L${top_builddir}/resources -L${top_builddir}/misc -L${top_builddir}/../omalloc4 AM_LDFLAGS = -L${top_builddir}/polys -L${top_builddir}/coeffs -L${top_builddir}/reporter -L${top_builddir}/resources -L${top_builddir}/misc -L${top_builddir}/../omalloc 5 5 6 6 … … 14 14 INCLUDES = -I${top_srcdir} -I${top_srcdir}/.. -I${top_builddir} -I${srcdir} ${GMP_CFLAGS} 15 15 16 TESTS = simple_test coeffs_test 16 17 TESTS = simple_test coeffs_test polys_test 17 18 check_PROGRAMS = $(TESTS) 18 19 19 20 simple_test_SOURCES = simple_test_runner.cpp 20 21 21 coeffs_test_SOURCES = coeffs_test_runner.cpp 22 polys_test_SOURCES = polys_test_runner.cpp 22 23 23 24 coeffs_test_LDADD = -lcoeffs_g ${GMP_LIBS} -lresources_g -lreporter_g -lmisc -lomalloc_debug 25 polys_test_LDADD = -lpolys_g $(coeffs_test_LDADD) 24 26 25 27 26 BUILT_SOURCES = $(simple_test_SOURCES) $(coeffs_test_SOURCES) 28 BUILT_SOURCES = $(simple_test_SOURCES) $(coeffs_test_SOURCES) $(polys_test_SOURCES) 27 29 28 30 … … 33 35 coeffs_test_runner.cpp: coeffs_test.h 34 36 ${srcdir}/cxxtestgen.pl --no-eh -o $@ --error-printer $^ 37 38 polys_test_runner.cpp: polys_test.h 39 ${srcdir}/cxxtestgen.pl --no-eh -o $@ --error-printer $^ -
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.