Changeset 56abc3 in git
- Timestamp:
- Jun 9, 2010, 11:33:55 AM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 72f476ba29bee4c07a8d6d6dba881205187ca8ae
- Parents:
- 7d4350e11fdb85544b4c200f11181d1b707765a1
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2010-06-09 11:33:55+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:55:05+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
coeffs/test.cc
r7d4350e r56abc3 13 13 14 14 15 int main() 15 #include <iostream> 16 using namespace std; 17 18 19 bool Test(const coeffs r) 16 20 { 17 const n_coeffType type = nRegister( n_Q, nlInitChar); assume( type == n_Q ); 18 // const n_coeffType type = nRegister( n_long_C, ngcInitChar); assume( type == n_long_C ); 19 // const n_coeffType type = nRegister( n_R, nrInitChar); assume( type == n_R ); 20 21 number a = r->cfInit(666, r); 22 number b = r->cfAdd( a, a, r); 23 24 StringSetS("a: ");r->cfWrite( a, r );PrintS(StringAppend("\n")); 25 StringSetS("b: "); r->cfWrite( b, r );PrintS(StringAppend("\n")); 26 27 r->cfDelete( &a, r); 28 r->cfDelete( &b, r); 29 30 return false; 31 } 32 33 34 35 bool Test(const n_coeffType type) 36 { 37 38 cout << "Testing coeffs: [" << type << "]: " << endl; 21 39 22 40 const coeffs r = nInitChar( type, NULL ); 23 41 24 42 assume( r != NULL ); 25 43 26 44 nSetChar( r ); 27 45 … … 32 50 assume( r->cfAdd != NULL ); 33 51 assume( r->cfDelete != NULL ); 34 52 35 53 36 54 if( type == n_Q ) … … 59 77 } 60 78 61 62 63 number a = r->cfInit(666, r); 64 number b = r->cfAdd( a, a, r); 65 66 StringSetS("a: ");r->cfWrite( a, r );PrintS(StringAppend("\n")); 67 StringSetS("b: "); r->cfWrite( b, r );PrintS(StringAppend("\n")); 68 69 r->cfDelete( &a, r); 70 r->cfDelete( &b, r); 79 bool ret = Test( r ); 71 80 72 81 nKillChar( r ); 73 82 74 return 0;83 return ret; 75 84 } 85 86 87 88 89 int main() 90 { 91 int c = 0; 92 93 n_coeffType type; 94 95 type = nRegister( n_Q, nlInitChar); assume( type == n_Q ); 96 97 if( Test(type) ) 98 c ++; 99 100 type = nRegister( n_long_C, ngcInitChar); assume( type == n_long_C ); 101 if( Test(type) ) 102 c ++; 103 104 type = nRegister( n_R, nrInitChar); assume( type == n_R ); 105 if( Test(type) ) 106 c ++; 107 108 return c; 109 110 }
Note: See TracChangeset
for help on using the changeset viewer.