Commit 7affbdf0 authored by Yannis Duffourd's avatar Yannis Duffourd

implementing unit tests

parent 5abb3753
// unit tests for vihgo
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <cstring>
#include <algorithm>
#include <sys/time.h>
#include <sys/types.h>
#include "utils.h"
using namespace std;
int main(int argc, char* argv[])
{
cerr << "Starting unit tests" << endl;
int nTest = 0;
int nSuccessTest = 0;
// chisquare tests
vector<double> a;
vector<double> b;
a.push_back( 1 );
a.push_back( 10 );
b.push_back( 5 );
b.push_back( 100 );
nTest ++;
if ( chisquare(a, b) != 0.53737445246309 )
{
cerr << "Assertion fail for chisquare test : " << a[0] << " : " << a[1] << " vs " << b[0] << " : " << b[1] << " => pvalue from function = " << chisquare(a, b) << " ; should be 0.53737445246309 " << endl;
}
nTest ++;
if ( chisquare_Two(a, b) != 0.53737445246309 )
{
cerr << "Assertion fail for chisquare test : " << a[0] << " : " << a[1] << " vs " << b[0] << " : " << b[1] << " => pvalue from function = " << chisquare_Two(a, b) << " ; should be 0.53737445246309 " << endl;
}
return 0;
}
// end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment