Changeset 1228 for trunk


Ignore:
Timestamp:
Mar 13, 2008, 3:48:37 PM (14 years ago)
Author:
Peter
Message:

move of Test Suite to a library and modified equal function

Location:
trunk/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/Makefile.am

    r1214 r1228  
    3131noinst_HEADERS = Suite.h
    3232
     33noinst_LTLIBRARIES = libyattest.la
     34
    3335TESTS = alignment_test averager_test                  \
    3436  commandline_test \
     
    5052#check_PROGRAMS +=
    5153
    52 LDADD = @top_builddir@/$(YAT_LIB_LOCATION)/$(YAT_LIB)
     54LDADD = @top_builddir@/$(YAT_LIB_LOCATION)/$(YAT_LIB) libyattest.la
    5355
    5456AM_CPPFLAGS = -I@top_srcdir@
    5557
     58libyattest_la_SOURCES = Suite.cc
    5659
    5760alignment_test_SOURCES = alignment_test.cc
    58 averager_test_SOURCES = averager_test.cc Suite.cc
     61averager_test_SOURCES = averager_test.cc
    5962commandline_test_SOURCES = commandline_test.cc
    6063consensus_inputranker_test_SOURCES = consensus_inputranker_test.cc
  • trunk/test/Suite.cc

    r1215 r1228  
    7070  bool equal(double a, double b, u_int n)
    7171  {
    72     return std::abs(a-b) <= n*std::numeric_limits<double>().epsilon();
     72    return std::abs(a-b) <=
     73      n*std::numeric_limits<double>().epsilon()*std::min(std::abs(a),
     74                                                         std::abs(b));
    7375  }
    7476
  • trunk/test/Suite.h

    r1215 r1228  
    8181
    8282  /**
    83      \return true if |a-b| <= N*std::numerical_limits<double>().epsilon()
     83     \return true if \f$ |a-b| <= N * \epsilon * min(|a|,|b|) \f$
     84     where \f$ \epsilon \f$ is std::numeric_limits<double>().epsilon()
    8485  */
    8586  bool equal(double a, double b, unsigned int N=1);
Note: See TracChangeset for help on using the changeset viewer.