Changeset 679 for trunk


Ignore:
Timestamp:
Oct 11, 2006, 2:37:55 PM (15 years ago)
Author:
Markus Ringnér
Message:

Fixed some minor stuff so it compiles on eddie.thep.lu.se running g++3.2

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/data_lookup_1d_test.cc

    r675 r679  
    2626#include "yat/classifier/MatrixLookup.h"
    2727
     28
     29#include <cstdio>
    2830#include <fstream>
    2931#include <iostream>
     
    3436
    3537utility::matrix matrix(size_t n);
     38int end_test(std::ostream*, bool);
    3639
    3740int main(const int argc,const char* argv[])
     
    4750      std::cout << "lookup_test -v : for printing extra information\n";
    4851  }
     52 
    4953
    5054  *error << "Testing Lookup Classes" << std::endl;
    5155  bool ok = true;
     56
     57  if(!std::numeric_limits<double>::has_quiet_NaN) {
     58    *error << "Error: a compiler without quiet_NaN is used!\n"
     59     << "This will likely also mess up a lot of other yat tests\n";
     60    ok=false;
     61    return end_test(error,ok);
     62  }
     63
     64
    5265
    5366  *error << "Testing DataLookup1D" << std::endl;
     
    132145    *error << "\nERROR\n" << std::endl;
    133146  }
    134   unlink("data/tmp_test_datalookup1D.txt");
     147  std::remove("data/tmp_test_datalookup1D.txt");
    135148 
    136149  // Second with a vector with a missing value separated by '\t'.
     
    152165           << std::endl;
    153166  }
    154   unlink("data/tmp_test_datalookup1D.txt");
     167  std::remove("data/tmp_test_datalookup1D.txt");
    155168   
    156 
    157   if (ok)
    158     *error << "Ok." << std::endl;
    159   if (error!=&std::cerr)
    160     delete error;
    161   return (ok ? 0 : -1);
     169  return end_test(error,ok);
    162170}
    163171
     
    171179}
    172180
     181int end_test(std::ostream* error, bool ok)
     182
     183  if (ok)
     184    *error << "Ok." << std::endl;
     185  if (error!=&std::cerr)
     186    delete error;
     187  return (ok ? 0 : -1);
     188}
  • trunk/test/kernel_test.cc

    r675 r679  
    188188  index[1]=2;
    189189  index[2]=3;
    190   classifier::KernelLookup kv(classifier::KernelLookup(kernel),index, index);
     190  classifier::KernelLookup kv_raw(kernel);
     191  classifier::KernelLookup kv(kv_raw,index, index);
    191192  if (kv.rows()!=index.size()){
    192193    *error << "Error: KernelLookup(kernel, index)\n" << std::endl
  • trunk/test/matrix_test.cc

    r675 r679  
    2424#include "yat/utility/matrix.h"
    2525
    26 #include <unistd.h>
     26#include <cstdio>
    2727#include <fstream>
    2828#include <iostream>
     
    7676  if (m3!=m2)
    7777    ok=false;
    78   unlink("data/tmp_test_matrix.txt");
     78  std::remove("data/tmp_test_matrix.txt");
    7979
    8080  *error << "\toperator*(double)" << std::endl;
  • trunk/yat/utility/CommandLine.h

    r675 r679  
    2727#include "Option.h"
    2828
     29#include <cctype>
    2930#include <list>
    3031#include <map>
Note: See TracChangeset for help on using the changeset viewer.