Changeset 56abc3 in git


Ignore:
Timestamp:
Jun 9, 2010, 11:33:55 AM (14 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
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
Message:
More tests...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • coeffs/test.cc

    r7d4350e r56abc3  
    1313
    1414
    15 int main()
     15#include <iostream>
     16using namespace std;
     17
     18
     19bool Test(const coeffs r)
    1620{
    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
     35bool Test(const n_coeffType type)
     36{
     37
     38  cout << "Testing coeffs: [" << type << "]: " << endl;
    2139
    2240  const coeffs r = nInitChar( type, NULL );
    2341
    2442  assume( r != NULL );
    25  
     43
    2644  nSetChar( r );
    2745
     
    3250  assume( r->cfAdd != NULL );
    3351  assume( r->cfDelete != NULL );
    34  
     52
    3553
    3654  if( type == n_Q )
     
    5977  }
    6078
    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 );
    7180
    7281  nKillChar( r );
    7382
    74   return 0;
     83  return ret;
    7584}
     85
     86
     87
     88
     89int 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.