Permalink
Browse files

Fix tests

Fix tests after merging GAs.
  • Loading branch information...
pascalhorton committed Jul 3, 2017
1 parent 1f50e5f commit fc4fb6166b0709737934654112dc508226174807
View
@@ -55,4 +55,6 @@ bin/
Test Results *
CMakeFiles/*
cmake-build-debug/
*.resolve
cmake-build-release/
cmake-build-relwithdebinfo/
*.resolve
View
@@ -6,7 +6,7 @@ install:
- sudo apt-get -qq update
- sudo apt-get install -y build-essential gnome-devel cmake git
- sudo apt-get install -y libnetcdf-dev libgdal-dev libcurl3 libwxgtk3.0-dev
- cmake CMakeLists.txt -DBUILD_OPTIMIZER=1 -DUSE_CODECOV=0
- cmake CMakeLists.txt -DBUILD_OPTIMIZER=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CODECOV=0
- make -j$(nproc)
before_script:
- ls
@@ -31,5 +31,6 @@
TEST(Exception, ThrowException)
{
wxLogNull logNo;
ASSERT_THROW(asThrowException("My exception"), asException);
}
@@ -155,6 +155,8 @@ TEST(FileXml, LoadSimpleXmlFile)
TEST(FileXml, LoadSimpleXmlFileWithErrors)
{
wxLogNull logNo;
wxString filePath = wxFileName::GetCwd();
filePath.Append("/files/file_xml_error.xml");
asFileXml fileXml(filePath, asFile::ReadOnly);
@@ -1815,6 +1815,8 @@ TEST(ForecastScore, ProcessRankHistogram)
TEST(ForecastScore, ProcessRankHistogramReliability)
{
wxLogNull logNo;
// Sizes
int timeLength = 20;
int nanalogs = 30;
@@ -80,6 +80,8 @@ TEST(GeoAreaCompositeGeneralGrid, CheckConsistency)
TEST(GeoAreaCompositeGeneralGrid, CheckConsistencyException)
{
wxLogNull logNo;
double Xmin = 10;
int Xptsnb = 1;
double Ymin = 40;
@@ -32,6 +32,8 @@
TEST(GeoAreaCompositeRegularGrid, ConstructorStepException)
{
wxLogNull logNo;
Coo CornerUL, CornerUR, CornerLL, CornerLR;
CornerUL.x = -10;
CornerUL.y = 40;
@@ -121,6 +123,8 @@ TEST(GeoAreaCompositeRegularGrid, CheckConsistency)
TEST(GeoAreaCompositeRegularGrid, CheckConsistencyException)
{
wxLogNull logNo;
double Xmin = 10;
double Xwidth = 0;
double Ymin = 40;
@@ -147,6 +151,8 @@ TEST(GeoAreaCompositeRegularGrid, IsRectangleTrue)
TEST(GeoAreaCompositeRegularGrid, IsRectangleFalse)
{
wxLogNull logNo;
Coo CornerUL, CornerUR, CornerLL, CornerLR;
CornerUL.x = 10;
CornerUL.y = 40;
@@ -32,6 +32,8 @@
TEST(GeoAreaRegularGrid, ConstructorLimitsException)
{
wxLogNull logNo;
Coo CornerUL, CornerUR, CornerLL, CornerLR;
CornerUL.x = -10;
CornerUL.y = 40;
@@ -48,6 +50,8 @@ TEST(GeoAreaRegularGrid, ConstructorLimitsException)
TEST(GeoAreaRegularGrid, ConstructorAlternativeLimitsException)
{
wxLogNull logNo;
double Xmin = -10;
double Xwidth = 30;
double Ymin = 30;
@@ -59,6 +63,8 @@ TEST(GeoAreaRegularGrid, ConstructorAlternativeLimitsException)
TEST(GeoAreaRegularGrid, ConstructorStepException)
{
wxLogNull logNo;
double Xmin = -10;
double Xwidth = 30;
double Ymin = 30;
@@ -87,6 +93,8 @@ TEST(GeoAreaRegularGrid, IsRectangleTrue)
TEST(GeoAreaRegularGrid, IsRectangleFalse)
{
wxLogNull logNo;
Coo CornerUL, CornerUR, CornerLL, CornerLR;
CornerUL.x = 10;
CornerUL.y = 40;
@@ -32,6 +32,8 @@
TEST(GeoArea, ConstructorLimitsException)
{
wxLogNull logNo;
Coo CornerUL, CornerUR, CornerLL, CornerLR;
CornerUL.x = -10;
CornerUL.y = 40;
@@ -47,6 +49,8 @@ TEST(GeoArea, ConstructorLimitsException)
TEST(GeoArea, ConstructorAlternativeLimitsException)
{
wxLogNull logNo;
double Xmin = -10;
double Xwidth = 30;
double Ymin = 30;
@@ -25,7 +25,7 @@
* Portions Copyright 2008-2013 Pascal Horton, University of Lausanne.
* Portions Copyright 2013-2015 Pascal Horton, Terranum.
*/
/*
#include <wx/filename.h>
#include <wx/dir.h>
#include "asDataPredictandPrecipitation.h"
@@ -1696,4 +1696,4 @@ TEST(MethodCalibrator, NormalizedRMSECriteria)
EXPECT_NE(criteriaStd.coeff(i, j), criteriaNorm.coeff(i, j));
}
}
}*/
}
@@ -158,12 +158,10 @@ TEST(PredictorCriteria, ProcessS1)
// Process S1 and check the results
float resZ1000, resZ500, res;
wxConfigBase *pConfig = wxFileConfig::Get();
resZ1000 = criteria->Assess(RefZ1000, CandZ1000, RefZ1000.rows(), RefZ1000.cols());
resZ500 = criteria->Assess(RefZ500, CandZ500, RefZ500.rows(), RefZ500.cols());
res = (resZ500 + resZ1000) / 2;
EXPECT_NEAR(critS1[i_cand], res, 0.05);
EXPECT_NEAR(critS1[iCand], res, 0.05);
}
wxDELETE(criteria);
@@ -292,12 +290,10 @@ TEST(PredictorCriteria, ProcessNS1)
// Process S1 and check the results
float resZ1000, resZ500, res;
wxConfigBase *pConfig = wxFileConfig::Get();
resZ1000 = criteria->Assess(RefZ1000, CandZ1000, (int) RefZ1000.rows(), (int) RefZ1000.cols());
resZ500 = criteria->Assess(RefZ500, CandZ500, (int) RefZ500.rows(), (int) RefZ500.cols());
res = (resZ500 + resZ1000) / 2;
EXPECT_NEAR(critS1[i_cand], res, 0.05);
EXPECT_NEAR(critS1[iCand], res, 0.05);
}
wxDELETE(criteria);
@@ -371,9 +367,6 @@ TEST(PredictorCriteria, ProcessS1preprocessed)
CandOriginal = hgtOriginal[iCand][0];
CandPreproc = hgtPreproc[iCand][0];
// Process the score
wxConfigBase *pConfig = wxFileConfig::Get();
S1Original = criteria->Assess(RefOriginal, CandOriginal, CandOriginal.rows(), CandOriginal.cols());
S1Preproc = criteriaGrads->Assess(RefPreproc, CandPreproc, CandPreproc.rows(), CandPreproc.cols());
EXPECT_FLOAT_EQ(S1Original, S1Preproc);
@@ -453,9 +446,6 @@ TEST(PredictorCriteria, ProcessNS1preprocessed)
CandOriginal = hgtOriginal[iCand][0];
CandPreproc = hgtPreproc[iCand][0];
// Process the score
wxConfigBase *pConfig = wxFileConfig::Get();
S1Original = criteria->Assess(RefOriginal, CandOriginal, CandOriginal.rows(), CandOriginal.cols());
S1Preproc = criteriaGrads->Assess(RefPreproc, CandPreproc, CandPreproc.rows(), CandPreproc.cols());
EXPECT_FLOAT_EQ(S1Original, S1Preproc);
@@ -645,8 +635,6 @@ TEST(PredictorCriteria, ProcessRSE)
// Process RMSE and check the results
float res;
wxConfigBase *pConfig = wxFileConfig::Get();
res = criteria->Assess(RefMulti, CandMulti, RefMulti.rows(), RefMulti.cols());
EXPECT_NEAR(critRMSE[iCand], res, 0.05);
}
@@ -832,12 +820,10 @@ TEST(PredictorCriteria, ProcessRMSE)
// Process RMSE and check the results
float res12h, res24h, res;
wxConfigBase *pConfig = wxFileConfig::Get();
res12h = criteria->Assess(RefMulti12h, CandMulti12h, RefMulti12h.rows(), RefMulti12h.cols());
res24h = criteria->Assess(RefMulti24h, CandMulti24h, RefMulti24h.rows(), RefMulti24h.cols());
res = (res12h + res24h) / 2;
EXPECT_NEAR(critRMSE[i_cand], res, 0.05);
EXPECT_NEAR(critRMSE[iCand], res, 0.05);
}
wxDELETE(criteria);
@@ -1022,12 +1008,10 @@ TEST(PredictorCriteria, ProcessNRMSE)
// Process RMSE and check the results
float res12h, res24h, res;
wxConfigBase *pConfig = wxFileConfig::Get();
res12h = criteria->Assess(RefMulti12h, CandMulti12h, RefMulti12h.rows(), RefMulti12h.cols());
res24h = criteria->Assess(RefMulti24h, CandMulti24h, RefMulti24h.rows(), RefMulti24h.cols());
res = (res12h + res24h) / 2;
EXPECT_NEAR(critRMSE[i_cand], res, 0.05);
EXPECT_NEAR(critRMSE[iCand], res, 0.05);
}
wxDELETE(criteria);
@@ -1036,8 +1020,6 @@ TEST(PredictorCriteria, ProcessNRMSE)
TEST(PredictorCriteria, ProcessDifferences)
{
wxConfigBase *pConfig = wxFileConfig::Get();
va2f RefData;
a2f Datatmp;
Datatmp.resize(2, 2);
Oops, something went wrong.

0 comments on commit fc4fb61

Please sign in to comment.