WSL/SLF GitLab Repository

Skip to content
Snippets Groups Projects
Commit 99cd5da7 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Fixed some errors and warnings when compiling the tests on Hera

parent 3c4f3dd3
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,7 @@ bool grid3d(const unsigned int& n) {
return status;
}
bool matrix(const unsigned int& n) {
bool matrix(const size_t& n) {
cout << "Testing Matrix\n";
bool status=true;
Matrix I(n,1.); //build an n*n identity matrix
......
......@@ -115,24 +115,22 @@ bool compareFiles(){
bool status=true;
for(int i = 0; i < n_files; i++) {
// ------ Compare reference file with generated results ---------
cout << " --- Start comparing reference file with output file generated before for : " << files[i] << endl;
cout << " --- Comparing reference file with generated output file " << files[i] << endl;
ifstream ifref((prefix_ref+files[i]).c_str());
ifstream ifout(files[i].c_str());
string l_ref, l_out;
while (!ifref.eof())
{
while (!ifref.eof()) {
if(ifout.eof()) {
cerr << "Not enough lines generated as result!!!" << endl;
cerr << "Generated file has less lines than the reference!" << endl;
return false;
}
getline(ifref,l_ref);
getline(ifout,l_out);
if (l_ref!=l_out) {
cerr << " ERROR, Sun generatet error at following point an error " << endl;
cerr << "Generated and reference files differ!" << endl;
cerr << "ref : \n " << l_ref << endl;
cerr << "out : \n " << l_out << endl;
status=false;
......@@ -140,7 +138,7 @@ bool compareFiles(){
}
if(!ifout.eof()) {
cerr << "To much lines generated as result!!!" << endl;
cerr << "Generated file has more lines than the reference!" << endl;
status=false;
}
ifout.close();
......
......@@ -25,7 +25,7 @@ void cr_fixed_vectors(vector<double> &X, vector<double> &Y) {
void cr_rand_vectors(vector<double> &X, vector<double> &Y) {
const size_t N = 20;
srand( time(NULL) );
srand( static_cast<unsigned int>(time(NULL)) );
X.clear(); X.resize(N);
Y.clear(); Y.resize(N);
......@@ -191,7 +191,7 @@ bool check_basics(const vector<double>& X, const vector<double>& Y) {
}
//vector weighted mean
const vector<double> weights(X.size(), 1./(X.size()));
const vector<double> weights(X.size(), 1./static_cast<double>(X.size()));
const double vector_mean = Interpol1D::weightedMean(X, weights);
const double mean = Interpol1D::arithmeticMean(X);
const double vector_mean_status = IOUtils::checkEpsilonEquality(vector_mean, mean, 1e-6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment