Changed the csvdiff default return value.

Now a return of 0 indicates a success.
  Previously a return of 1 indicated a success. Please note!
This commit is contained in:
Harry Moffat 2010-04-02 19:29:07 +00:00
parent 08615de293
commit 4811459364
14 changed files with 149 additions and 142 deletions

View file

@ -322,7 +322,7 @@ Initial T = 414.143, pres = 1.17767e-06 atm
NO 5.58575e-12 5.80828e-12 -38.5785
NO+ 4.52092e-104 4.70095e-104 12.1169
Electron 4.52092e-104 8.53846e-109 -254.253
N+ 8.08849e-210 3.92595e-210 32.1429
N+ 8.0885e-210 3.92595e-210 32.1429
O+ 3.41902e-171 1.8956e-171 30.6695
N2+ 6.99476e-169 6.79029e-169 13.5903
O2+ 3.64494e-127 4.04179e-127 10.6435
@ -355,7 +355,7 @@ Initial T = 414.143, pres = 1.17767e-05 atm
NO 5.58575e-12 5.80828e-12 -36.2759
NO+ 2.7933e-104 2.90453e-104 13.938
Electron 2.7933e-104 5.27558e-109 -252.432
N+ 1.58037e-210 7.67069e-211 32.8127
N+ 1.58037e-210 7.6707e-211 32.8127
O+ 6.68024e-172 3.70371e-172 31.3393
N2+ 4.32179e-169 4.19545e-169 15.4114
O2+ 2.25207e-127 2.49726e-127 12.4646
@ -424,7 +424,7 @@ Initial T = 414.143, pres = 0.00117767 atm
N+ 6.03308e-212 2.9283e-212 34.1523
O+ 2.55019e-173 1.4139e-173 32.6789
N2+ 1.64985e-169 1.60162e-169 19.0536
O2+ 8.5973e-128 9.53333e-128 16.1068
O2+ 8.5973e-128 9.53334e-128 16.1068
Final T = 414.143, pres = 0.00117767 atm
Initial T = 414.143, pres = 0.0117767 atm
@ -457,7 +457,7 @@ Initial T = 414.143, pres = 0.0117767 atm
N+ 1.17877e-212 5.72145e-213 34.8221
O+ 4.98269e-174 2.76254e-174 33.3487
N2+ 1.01938e-169 9.89578e-170 20.8747
O2+ 5.31193e-128 5.89027e-128 17.9279
O2+ 5.31194e-128 5.89027e-128 17.9279
Final T = 414.143, pres = 0.0117767 atm
Initial T = 1153.16, pres = 3.27918e-08 atm
@ -485,10 +485,10 @@ Initial T = 1153.16, pres = 3.27918e-08 atm
N 2.86312e-15 1.38975e-15 -21.3563
O 2.23425e-05 1.23879e-05 -22.8775
NO 0.000134494 0.000139854 -44.2338
NO+ 9.19995e-24 9.56641e-24 7.08807
Electron 9.19995e-24 1.73757e-28 -74.3227
N+ 1.62751e-56 7.89959e-57 29.9656
O+ 3.109e-43 1.72373e-43 28.4444
NO+ 9.19996e-24 9.56642e-24 7.08807
Electron 9.19996e-24 1.73757e-28 -74.3227
N+ 1.62751e-56 7.8996e-57 29.9656
O+ 3.109e-43 1.72374e-43 28.4444
N2+ 1.23423e-46 1.19817e-46 8.60924
O2+ 3.28303e-32 3.64051e-32 5.5669
@ -523,7 +523,7 @@ Initial T = 1152.46, pres = 3.27723e-07 atm
N+ 1.39651e-56 6.7783e-57 32.0898
O+ 2.65657e-43 1.47288e-43 30.5686
N2+ 3.33238e-46 3.23497e-46 11.8846
O2+ 8.8243e-32 9.78508e-32 8.8423
O2+ 8.8243e-32 9.78509e-32 8.8423
Final T = 1152.61, pres = 3.27763e-07 atm
Initial T = 1152.61, pres = 3.27763e-06 atm
@ -551,11 +551,11 @@ Initial T = 1152.61, pres = 3.27763e-06 atm
N 2.88709e-16 1.40138e-16 -19.0539
O 2.24413e-06 1.24425e-06 -20.575
NO 0.000134716 0.000140083 -39.6289
NO+ 6.55508e-23 6.81612e-23 13.6391
Electron 6.55508e-23 1.23803e-27 -67.7541
NO+ 6.55509e-23 6.81613e-23 13.6391
Electron 6.55509e-23 1.23803e-27 -67.7541
N+ 1.17797e-56 5.71759e-57 34.2141
O+ 2.23788e-43 1.24075e-43 32.693
N2+ 8.87483e-46 8.6154e-46 15.1603
N2+ 8.87483e-46 8.61541e-46 15.1603
O2+ 2.34675e-31 2.60226e-31 12.1179
Final T = 1152.66, pres = 3.27775e-06 atm
@ -617,11 +617,11 @@ Initial T = 1152.67, pres = 0.000327779 atm
N 2.88951e-17 1.40255e-17 -16.7513
O 2.24513e-07 1.24481e-07 -18.2725
NO 0.000134738 0.000140106 -35.0238
NO+ 4.59472e-22 4.77768e-22 20.1897
NO+ 4.59472e-22 4.77769e-22 20.1897
Electron 4.59472e-22 8.67784e-27 -61.2017
N+ 8.26992e-57 4.014e-57 38.4622
O+ 1.57022e-43 8.70576e-44 36.941
N2+ 6.22643e-45 6.04441e-45 21.7109
N+ 8.26992e-57 4.01401e-57 38.4622
O+ 1.57022e-43 8.70577e-44 36.941
N2+ 6.22643e-45 6.04442e-45 21.7109
O2+ 1.64546e-30 1.82461e-30 18.6686
Final T = 1152.68, pres = 0.00032778 atm

View file

@ -25,7 +25,7 @@ ${CANTERA_BIN}/csvdiff -a 1.0E-19 table.csv table_blessed.csv > diff_csv.txt
retnStat_csv=$?
eCode=1
if test $retnStat_csv = "1"
if test $retnStat_csv = "0"
then
eCode=0
echo "Successful test comparison on " $testName

View file

@ -31,7 +31,7 @@ retnStat_txt=$?
$BINDIR/csvdiff -a 1.0E-50 vcs_equilibrate_blessed.csv vcs_equilibrate_res.csv > diff_csv.txt
retnStat_csv=$?
if test $retnStat_csv = "1"
if test $retnStat_csv = "0"
then
echo "Successful test comparison on "`pwd`
if [ $retnStat_txt != "0" ]

View file

@ -42,7 +42,7 @@ retnStat_txt=$?
$BINDIR/csvdiff -a 1.0E-50 vcs_equilibrate_blessed.csv vcs_equilibrate_res.csv > diff_csv.txt
retnStat_csv=$?
if test $retnStat_csv = "1"
if test $retnStat_csv = "0"
then
echo "Successful test comparison on "`pwd`
if [ $retnStat_txt != "0" ]

View file

@ -36,7 +36,7 @@ machType=`../../bin/get_arch`
$CANTERA_BIN/csvdiff eq1.csv eq1_blessed.csv > eq1_test.out
retnStat=$?
if [ $retnStat = "1" ]
if [ $retnStat = "0" ]
then
echo "successful csv comparison on eq1 test"
else
@ -57,7 +57,7 @@ fi
$CANTERA_BIN/csvdiff tr1.csv tr1_blessed.csv > tr1_test.out
retnStat=$?
if [ $retnStat = "1" ]
if [ $retnStat = "0" ]
then
echo "successful csv comparison on tr1 test"
if [ $temp_success = "1" ]
@ -82,7 +82,7 @@ fi
$CANTERA_BIN/csvdiff tr2.csv tr2_blessed.csv > tr2_test.out
retnStat=$?
if [ $retnStat = "1" ]
if [ $retnStat = "0" ]
then
echo "successful csv comparison on tr2 test"
if [ $temp_success = "1" ]
@ -116,7 +116,7 @@ fi
$CANTERA_BIN/csvdiff -r 3.0E-3 kin1.csv kin1_blessed_tmp.csv > kin1_test.out
retnStat=$?
if [ $retnStat = "1" ]
if [ $retnStat = "0" ]
then
echo "successful csv comparison on kin1 test"
if [ $temp_success = "1" ]
@ -150,7 +150,7 @@ fi
$CANTERA_BIN/csvdiff kin2.csv kin2_blessed_tmp.csv > kin2_test.out
retnStat=$?
if [ $retnStat = "1" ]
if [ $retnStat = "0" ]
then
echo "successful csv comparison on kin2 test"
if [ $temp_success = "1" ]

View file

@ -116,7 +116,17 @@ Problem solved on [13] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1
New points inserted after grid points 0
to resolve H2O2 HO2
..............................................................................
Attempt Newton solution of steady-state problem... success.
Problem solved on [14] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0
to resolve H2O2 HO2
..............................................................................
@ -127,7 +137,62 @@ Problem solved on [15] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0
to resolve H2O2 HO2
to resolve HO2
..............................................................................
Attempt Newton solution of steady-state problem... success.
Problem solved on [16] point grid(s).
no new points needed in flame
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 1 timesteps 7.5e-06 5.055
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 2 timesteps 8.438e-06 5.05
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 5 timesteps 3.204e-05 5.045
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.0002309 4.993
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.0008323 4.76
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.0007499 4.434
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.002703 4.143
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.002435 3.937
..............................................................................
Attempt Newton solution of steady-state problem... success.
@ -136,107 +201,48 @@ Problem solved on [16] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0
to resolve HO2
..............................................................................
Attempt Newton solution of steady-state problem... success.
Problem solved on [17] point grid(s).
no new points needed in flame
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 1 timesteps 7.5e-06 5.054
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 2 timesteps 8.438e-06 5.049
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 5 timesteps 3.204e-05 5.044
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.0002309 4.991
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.0008323 4.751
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.0015 4.747
..............................................................................
Attempt Newton solution of steady-state problem... failure.
..............................................................................
Take 10 timesteps 0.001351 4.316
..............................................................................
Attempt Newton solution of steady-state problem... success.
Problem solved on [17] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1 2 3 4 5 6 7 8 9 10 11 12 13
New points inserted after grid points 0 1 2 3 4 5 6 7 8 9 10 11 12
to resolve H H2 H2O H2O2 HO2 O O2 OH T u
..............................................................................
Attempt Newton solution of steady-state problem... success.
Problem solved on [31] point grid(s).
Problem solved on [29] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 22 23 26 27
New points inserted after grid points 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 20 21 24 25
to resolve H H2 H2O H2O2 HO2 O O2 OH T u
..............................................................................
Attempt Newton solution of steady-state problem... success.
Problem solved on [54] point grid(s).
Problem solved on [50] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 47
New points inserted after grid points 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 43
to resolve H H2 H2O H2O2 HO2 O O2 OH T u
..............................................................................
Attempt Newton solution of steady-state problem... success.
Problem solved on [74] point grid(s).
Problem solved on [71] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1 2 3 5 6 7 8 9 10 11 12 13 14 16 17 24 25 26 27 28 29 30 31 32 33
to resolve H H2 H2O H2O2 HO2 O O2
New points inserted after grid points 0 1 2 3 5 6 7 8 9 10 11 12 13 14 16 17 24 25 26 27 28 29 30 31 32 33 34
to resolve H H2 H2O H2O2 HO2 O O2 OH
..............................................................................
Attempt Newton solution of steady-state problem... success.
Problem solved on [100] point grid(s).
Problem solved on [98] point grid(s).
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1 2
to resolve H2O2 HO2
New points inserted after grid points 0 1 2 56 57
to resolve H2O2 HO2 O
..............................................................................
Attempt Newton solution of steady-state problem... success.

View file

@ -67,7 +67,7 @@ retnStat_txt=$?
$BINDIR/csvdiff -a 1.0E-10 flame1_blessed.csv flame1.csv > diff_csv.txt
retnStat_csv=$?
if test $retnStat_csv = "1"
if test $retnStat_csv = "0"
then
echo " Successful test comparison on "`pwd`
if [ $retnStat_txt != "0" ]
@ -76,7 +76,7 @@ then
fi
else
echo " Unsuccessful test comparison on "`pwd` " test"
if test $retnStat_csv != "1"
if test $retnStat_csv != "0"
then
echo " csv files are different - see diff_csv.txt"
fi

View file

@ -68,9 +68,9 @@ then
echo "diamond.py returned with bad status, $retnStat, check output"
fi
$CANTERA_BIN/csvdiff diamond.csv diamond_blessed.csv > diamond_test.out
$CANTERA_BIN/csvdiff diamond.csv diamond_blessed.csv > diamond_test_csv.out
retnStat=$?
if [ $retnStat = "1" ]
if [ $retnStat = "0" ]
then
echo "successful csv comparison on diamond test"
if [ $temp_success = "1" ]

View file

@ -1,4 +0,0 @@
*.csv
.depends
Makefile
csvdiff

View file

@ -3,9 +3,9 @@
* | CVS File Information |
* ------------------------
* $RCSfile: csvdiff.cpp,v $
* $Author: hkmoffa $
* $Date: 2008/01/03 18:54:23 $
* $Revision: 1.17 $
* $Author$
* $Date$
* $Revision$
* $Name: $
*====================================================================*/
/*
@ -71,6 +71,11 @@ int Debug_Flag = TRUE;
double grtol = 1.0E-3;
double gatol = 1.0E-9;
#define RT_PASSED 0
#define RT_FAILED_COL 1
#define RT_FAILED_HDR 2
#define RT_FAILED_OTHER 3
/*
* First iteration towards getting this variable
*/
@ -646,7 +651,7 @@ int main(int argc, char *argv[])
int mixed_var = 0;
int i, j, ndiff, jmax, i1, i2, k, found;
double max_diff, rel_diff;
int testPassed = 1;
int testPassed = RT_PASSED;
double atol_j, atol_arg = 0.0, rtol_arg = 0.0;
/********************** BEGIN EXECUTION ************************************/
@ -719,7 +724,7 @@ int main(int argc, char *argv[])
printf("\n");
printf("----------------------------------------------------------\n");
printf("csvdiff: CSVFile comparison utility program\n");
printf(" Version $Revision: 1.17 $\n");
printf(" Version $Revision$\n");
printf(" Harry K. Moffat Div. 9114 Sandia National Labs\n");
printf(" \n");
printf(" First CSV File = %s\n", fileName1);
@ -751,37 +756,37 @@ int main(int argc, char *argv[])
get_sizes(fp1, nTitleLines1, nColTitleLines1, nCol1, nDataRows1, &ColIsFloat1);
if (nCol1 == 0) {
printf("Number of columns in file %s is zero\n", fileName1);
testPassed = -1;
exit (-1);
testPassed = RT_FAILED_OTHER;
exit(RT_FAILED_OTHER);
}
if (nDataRows1 == 0) {
printf("Number of data rows in file %s is zero\n", fileName1);
testPassed = -1;
exit (-1);
testPassed = RT_FAILED_OTHER;
exit(RT_FAILED_OTHER);
}
get_sizes(fp2, nTitleLines2, nColTitleLines2, nCol2, nDataRows2, &ColIsFloat2);
if (nCol2 == 0) {
printf("Number of columns in file %s is zero\n", fileName2);
testPassed = -1;
exit (-1);
testPassed = RT_FAILED_OTHER;
exit(RT_FAILED_OTHER);
}
if (nDataRows2 == 0) {
printf("Number of data rows in file %s is zero\n", fileName2);
testPassed = -1;
exit (-1);
testPassed = RT_FAILED_OTHER;
exit(RT_FAILED_OTHER);
}
if (nTitleLines1 != nTitleLines2) {
printf("Number o Title Lines differ:, %d %d\n",nTitleLines1, nTitleLines2);
testPassed = 0;
printf("Number of Title Lines differ:, %d %d\n",nTitleLines1, nTitleLines2);
testPassed = RT_FAILED_OTHER;
} else if (Debug_Flag) {
printf("Number of Title Lines in each file = %d\n", nTitleLines1);
}
if (nColTitleLines1 != nColTitleLines2) {
printf("Number of Column title lines differ:, %d %d\n", nColTitleLines1,
nColTitleLines2);
testPassed = 0;
testPassed = RT_FAILED_OTHER;
} else if (Debug_Flag) {
printf("Number of column title lines in each file = %d\n", nColTitleLines1);
}
@ -809,27 +814,27 @@ int main(int argc, char *argv[])
for (i = 0; i < n; i++) {
if (strcmp(title1[i], title2[i]) != 0) {
printf("Title Line %d differ:\n\t\"%s\"\n\t\"%s\"\n", i, title1[i], title2[i]);
testPassed = 0;
testPassed = RT_FAILED_HDR;
} else if (Debug_Flag) {
printf("Title Line %d for each file: \"%s\"\n", i, title1[i]);
}
}
if (nTitleLines1 != nTitleLines2) {
printf("Number of Title Lines differ: %d %d\n", nTitleLines1, nTitleLines2);
testPassed = -1;
testPassed = RT_FAILED_HDR;;
}
} else {
if (nTitleLines1 != nTitleLines2) {
if (nTitleLines1) {
printf("Titles differ: title for first file: \"%s\"\n",
title1[0]);
testPassed = 0;
testPassed = RT_FAILED_HDR;
}
if (nTitleLines2) {
printf("Titles differ: title for second file: \"%s\"\n",
title2[0]);
}
testPassed = -1;
testPassed = RT_FAILED_HDR;
}
}
@ -842,7 +847,7 @@ int main(int argc, char *argv[])
printf("Number of column variables differ:, %d %d\n",
nCol1, nCol2);
mixed_var = TRUE;
testPassed = 0;
testPassed = RT_FAILED_OTHER;
} else if (Debug_Flag) {
printf("Number of column variables in both files = %d\n",
nCol1);
@ -879,7 +884,7 @@ int main(int argc, char *argv[])
if (!found) {
printf("csvdiff WARNING Variable %s (%d) in first file not found"
" in second file\n", ColNames1[i], i);
testPassed = 0;
testPassed = RT_FAILED_OTHER;
}
}
for (j = 0; j < nCol2; j++) {
@ -891,7 +896,7 @@ int main(int argc, char *argv[])
printf("csvdiff WARNING Variable %s (%d) in second file "
"not found in first file\n",
ColNames2[j], j);
testPassed = 0;
testPassed = RT_FAILED_OTHER;
}
}
@ -1024,7 +1029,7 @@ int main(int argc, char *argv[])
printf(" Largest difference was at data row %d ", jmax + 1);
printf(": %g %g\n", curVarValues1[jmax], curVarValues2[jmax]);
}
testPassed = 0;
testPassed = RT_FAILED_COL;
} else if (Debug_Flag) {
printf("Column variable %s passed\n", ColNames1[i1]);
}

View file

@ -1,9 +1,9 @@
/*
******************************************************************************
* $RCSfile: mdp_allo.cpp,v $
* $Author: hkmoffa $
* $Date: 2009/04/19 02:31:12 $
* $Revision: 1.6 $
* $Author$
* $Date$
* $Revision$
* $Name: $
******************************************************************************
*/

View file

@ -5,11 +5,11 @@
*
* $RCSfile: mdp_allo.h,v $
*
* $Author: hkmoffa $
* $Author$
*
* $Date: 2007/03/26 21:53:45 $
* $Date$
*
* $Revision: 1.3 $
* $Revision$
*
* $Name: $
*====================================================================*/

View file

@ -5,14 +5,14 @@
*
* $RCSfile: tok_input_util.cpp,v $
*
* $Author: hkmoffa $
* $Author$
*
* $Date: 2009/03/28 03:07:23 $
* $Date$
*
* $Revision: 1.2 $
* $Revision$
* Symbolic $Name: $
*
* $Id: tok_input_util.cpp,v 1.2 2009/03/28 03:07:23 hkmoffa Exp $
* $Id$
* $Source: /cvsroot/cantera/cantera/tools/testtools/tok_input_util.cpp,v $
*
*====================================================================*/

View file

@ -5,14 +5,14 @@
*
* $RCSfile: tok_input_util.h,v $
*
* $Author: dggoodwin $
* $Author$
*
* $Date: 2003/04/14 17:58:00 $
* $Date$
*
* $Revision: 1.1.1.1 $
* $Revision$
* Symbolic $Name: $
*
* $Id: tok_input_util.h,v 1.1.1.1 2003/04/14 17:58:00 dggoodwin Exp $
* $Id$
* $Source: /cvsroot/cantera/cantera/tools/testtools/tok_input_util.h,v $
*
*