Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Adjust comparison of initial data point
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel authored and OpenModelica-Hudson committed Apr 7, 2017
1 parent 9166cbf commit adf56d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Compiler/runtime/SimulationResultsCmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ void* SimulationResultsCmp_compareResults(int isResultCmp, int runningTestsuite,
ddf.n=0;
ddf.n_max=0;
len = 1;
int offset, offsetRef;

/* open files */
/* fprintf(stderr, "Open File %s\n", filename); */
Expand Down Expand Up @@ -617,6 +618,9 @@ void* SimulationResultsCmp_compareResults(int isResultCmp, int runningTestsuite,
"File[%d]=%f\n",timeref.n,timeref.data[timeref.n-1],time.n,time.data[time.n-1]);
c_add_message(NULL,-1, ErrorType_scripting, ErrorLevel_warning, buf, NULL, 0);
}
/* calculate offsets */
for(offset=0; offset<time.n-1 && time.data[offset] == time.data[offset+1]; ++offset);
for(offsetRef=0; offsetRef<timeref.n-1 && timeref.data[offsetRef] == timeref.data[offsetRef+1]; ++offsetRef);
var1=NULL;
var2=NULL;
/* compare vars */
Expand Down Expand Up @@ -670,6 +674,11 @@ void* SimulationResultsCmp_compareResults(int isResultCmp, int runningTestsuite,
ngetfailedvars++;
continue;
}
/* adjust initial data points */
for(j=offset; j>0; j--)
data.data[j-1] = data.data[j];
for(j=offsetRef; j>0; j--)
dataref.data[j-1] = dataref.data[j];
/* compare */
if (isHtml) {
vardiffindx = cmpDataTubes(isResultCmp,var,&time,&timeref,&data,&dataref,reltol,rangeDelta,reltolDiffMaxMin,&ddf,cmpdiffvars,vardiffindx,keepEqualResults,&res,resultfilename,1,htmlOut);
Expand Down

0 comments on commit adf56d3

Please sign in to comment.