Changeset 0d1984 in git


Ignore:
Timestamp:
May 11, 2012, 3:51:24 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
d7eac3b10f1d0681478bd033cc259409eeab9132
Parents:
860d71cc6a362dccf8aea3a8620a4e147d6ab72c
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-05-11 15:51:24+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-05-11 15:51:35+02:00
Message:
better factory test (for 'make check')

add: output test parameters: p,i
chg: no immediate exit on failed test
add: accumulate the return value
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/test.cc

    r860d71 r0d1984  
    2424int test2 (int p)
    2525{
     26  int ret = 1;
    2627  setCharacteristic (p);
     28  printf ("p: %d, i: %d", p, 0);
    2729  CanonicalForm d1= Variable (1) + Variable (2) + 1;
    2830  CanonicalForm f1= Variable (1) - Variable (2) - 2;
     
    3335  CanonicalForm h= gcd (f,g);
    3436  h /= Lc (h);
     37  printf (", h==d? %d\n", (h == d));
    3538  if (h != d)
    36     return -1;
    37   printf ("h==d? %d\n", (h == d));
     39    ret = -1;
    3840  for (int i= 3; i <= 11; i++)
    3941  {
     42    printf ("p: %d, i: %d", p, i);
    4043    d1 += power (Variable (i), i);
    4144    f1 -= power (Variable (i), i);
     
    4649    h= gcd (f,g);
    4750    h /= Lc (h);
     51    printf (", h==d? %d\n", (h == d));
    4852    if (h != d)
    49       return -1;
    50     printf ("h==d? %d\n", (h == d));
     53      ret = -1;
    5154  }
    52   return 1;
     55  return ret;
    5356}
    5457
     
    97100int main( int, char *argv[] )
    98101{
     102  int ret = 0;
     103 
    99104  feInitResources(argv[0]);
    100    
     105
     106//  On (SW_USE_EZGCD); On (SW_USE_EZGCD_P); // TODO&NOTE: these switches lead to failed tests (with nonzero p)!
     107 
    101108  int t= test2 (0);
    102109  if (t < 0)
    103     return t;
     110    ret = t;
    104111  /*t= test5 (0);
    105112  if (t < 0)
     
    116123  t= test2 (3);
    117124  if (t < 0)
    118     return t;
     125    ret += t;
     126 
    119127  t= test2 (101);
    120128  if (t < 0)
    121     return t;
     129    ret += t;
     130 
    122131  t= test2 (43051);
    123132  if (t < 0)
    124     return t;
    125   return 0;
     133    ret += t;
     134 
     135  return ret;
    126136}
Note: See TracChangeset for help on using the changeset viewer.