Ignore:
Timestamp:
Dec 14, 2008, 11:13:48 PM (13 years ago)
Author:
Jari Häkkinen
Message:

Addresses #466. Added checks for GSL errors, improved docs, added some more tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/interpolation_test.cc

    r1648 r1650  
    7575  w(10)=25;  z(10)=119.43138;
    7676
    77   for (size_t i=0; i<w.size(); ++i)
     77  for (size_t i=0; i<w.size(); ++i) {
    7878    if (!suite.equal(cspline.evaluate(w(i)),z(i),1e9)) {
    7979      suite.err() << "cspline test failed for i=" << i << std::endl;
    8080      suite.add(false);
    8181    }
     82    // Check for errors
     83    if (cspline.error_status()) {
     84      suite.err() << "cspline test failed with GSL_EDOM error" << std::endl;
     85      suite.add(false);
     86    }
     87  }
     88
     89  // An error should be generated, if not test fails
     90  cspline.evaluate(w(0)-5);
     91  if (!cspline.error_status()) {
     92    suite.err() << "cspline test failed no GSL_EDOM error occured" << std::endl;
     93    suite.add(false);
     94  }
    8295
    8396  // lazy testing, at least try to create the objects
Note: See TracChangeset for help on using the changeset viewer.