Fixed C++ tests that were failing under Windows
Visual Studio defaults to 3-digit exponents when printing in scientific notation. The tests now use a MSVC-specific function to change this behavior when necessary.
This commit is contained in:
parent
7ac1cb4dd4
commit
b88846e5e0
32 changed files with 98 additions and 11 deletions
|
|
@ -11,6 +11,9 @@ using namespace Cantera;
|
|||
using namespace Cantera_CXX;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
int numSucc = 0;
|
||||
int numFail = 0;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ using namespace Cantera;
|
|||
using namespace Cantera_CXX;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
IdealGasMix g("gri30.xml", "gri30_mix");
|
||||
double pres = 1.0E5;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ using namespace Cantera;
|
|||
using namespace Cantera_CXX;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
#ifdef DEBUG_CHEMEQUIL
|
||||
ChemEquil_print_lvl = 0;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ using namespace Cantera;
|
|||
using namespace Cantera_CXX;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
IdealGasMix g("red1.xml", "gri30_mix");
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ using namespace Cantera;
|
|||
using namespace Cantera_CXX;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
IdealGasMix g("bad_air.xml", "air");
|
||||
double pres = 1.0E5;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ void printDbl(double val) {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ void printUsage() {
|
|||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
// int solver = 2;
|
||||
int numSucc = 0;
|
||||
int numFail = 0;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ using namespace std;
|
|||
using namespace Cantera;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
PrintCtrl::GlobalCrop = PrintCtrl::GCT_CROP;
|
||||
Cantera::IdealSolnGasVPSS gg("silane.xml", "silane");
|
||||
|
|
|
|||
|
|
@ -48,7 +48,9 @@ void pAtable(HMWSoln *HMW) {
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
int retn = 0;
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ void pAtable(HMWSoln *HMW) {
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
|
||||
int retn = 0;
|
||||
try {
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@ static void printUsage()
|
|||
using namespace Cantera;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
string infile;
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
string infile;
|
||||
// look for command-line options
|
||||
if (argc > 1) {
|
||||
string tok;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ static void printUsage()
|
|||
using namespace Cantera;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
string infile;
|
||||
// look for command-line options
|
||||
if (argc > 1) {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ static void printUsage()
|
|||
using namespace Cantera;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
string infile;
|
||||
// look for command-line options
|
||||
if (argc > 1) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
using namespace std;
|
||||
|
||||
int main () {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
WaterPropsIAPWSphi *phi = new WaterPropsIAPWSphi();
|
||||
|
||||
phi->check1();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ double numdpdt(WaterPropsIAPWS *water, double T, double pres) {
|
|||
}
|
||||
|
||||
int main () {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
double dens, u, s, h;
|
||||
WaterPropsIAPWS *water = new WaterPropsIAPWS();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ using namespace std;
|
|||
using namespace Cantera;
|
||||
|
||||
int main () {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
double dens, u, s, h, cv, cp, pres;
|
||||
WaterPropsIAPWS *water = new WaterPropsIAPWS();
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ double tvalue(double val, double atol = 1.0E-9) {
|
|||
}
|
||||
|
||||
int main () {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
double pres;
|
||||
try {
|
||||
Cantera::VPStandardStateTP *nnn = 0;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ double tvalue(double val, double atol = 1.0E-9) {
|
|||
|
||||
|
||||
int main () {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
double pres;
|
||||
try {
|
||||
WaterSSTP *w = new WaterSSTP("waterTPphase.xml","");
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ exfun fex[] = {kinetics_example1, kinetics_example2, kinetics_example3,
|
|||
|
||||
// main program
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
int example_num = 0;
|
||||
cout << endl
|
||||
<< "-----------------------------------" << endl
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ void printDbl(double val) {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
int i, k;
|
||||
string infile = "diamond.xml";
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ void printDbl(double val) {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
int i, k;
|
||||
string infile = "frac.xml";
|
||||
double x[10], kc[10];
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ void printDbl(double val) {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
int i, k;
|
||||
string infile = "diamond.cti";
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ using namespace std;
|
|||
|
||||
#
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
int i;
|
||||
string infile = "noxNeg.cti";
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ void printDbl(double val) {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
int k;
|
||||
string infile = "diamond.xml";
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ static double cutoff (double val, double atol=1.0E-15) {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
int k;
|
||||
string infile = "diamond.xml";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ using namespace Cantera;
|
|||
using namespace std;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
int i;
|
||||
std::string infile = "noxNeg.xml";
|
||||
|
|
|
|||
|
|
@ -284,7 +284,9 @@ void doLogger() {
|
|||
}
|
||||
|
||||
int main() {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
// How to connect to a file:
|
||||
// ofstream fff("redirect.txt");
|
||||
// ostream ffs(fff.rdbuf());
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@ double tvalue(double val, double atol = 1.0E-9) {
|
|||
|
||||
|
||||
int main () {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
double pres;
|
||||
try {
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,9 @@ int openRankine(int np, void* p) {
|
|||
}
|
||||
|
||||
int main() {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
return openRankine(0, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ using namespace Cantera;
|
|||
using namespace Cantera_CXX;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
try {
|
||||
IdealGasMix g("silane.xml", "silane");
|
||||
g.setState_TPX(1500.0, 100.0, "SIH4:0.01, H2:0.99");
|
||||
|
|
|
|||
|
|
@ -157,6 +157,9 @@ void printSurf(ostream &oooo,
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
string infile;
|
||||
int ioflag = 1;
|
||||
int i, k;
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ string getp(int& i, int argc, char** args) {
|
|||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
string infile="chem.inp", dbfile="", trfile="", logfile;
|
||||
string idtag = "gas";
|
||||
bool debug = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue