mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
added test for correct exception handling
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8948 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
5bd2cae399
commit
0272550872
@ -4475,3 +4475,24 @@ void TestIPhreeqc::TestGetAccumulatedLinesAfterRunString(void)
|
||||
CPPUNIT_ASSERT_EQUAL( std::string(expected), obj.GetAccumulatedLines() );
|
||||
}
|
||||
}
|
||||
|
||||
void TestIPhreeqc::TestPBasicStopThrow(void)
|
||||
{
|
||||
IPhreeqc obj;
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("../database/phreeqc.dat"));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("SOLUTION 1 # Mine water from Bain et al., 2001"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("USER_PRINT"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("10 print -(0.006^0.9)"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("20 print TOTMOL(\"H\"), TOTMOLE(\"H\"), TOTMOLES(\"H\")"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("110 print (-0.2)^3"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("120 print (-0.2)^3.0"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("130 print (-0.2)^-2"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("140 print (-0.2)^-3"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("150 print -0.2^2.2"));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("END"));
|
||||
|
||||
obj.SetOutputFileOn(true);
|
||||
CPPUNIT_ASSERT_EQUAL( 5, obj.RunAccumulated() );
|
||||
}
|
||||
|
||||
@ -85,6 +85,7 @@ class TestIPhreeqc : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST( TestGetAccumulatedLines );
|
||||
CPPUNIT_TEST( TestGetAccumulatedLinesAfterRunFile );
|
||||
CPPUNIT_TEST( TestGetAccumulatedLinesAfterRunString );
|
||||
CPPUNIT_TEST( TestPBasicStopThrow );
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -170,6 +171,7 @@ public:
|
||||
void TestGetAccumulatedLines(void);
|
||||
void TestGetAccumulatedLinesAfterRunFile(void);
|
||||
void TestGetAccumulatedLinesAfterRunString(void);
|
||||
void TestPBasicStopThrow(void);
|
||||
|
||||
protected:
|
||||
void TestFileOnOff(const char* FILENAME, bool output_file_on, bool error_file_on, bool log_file_on, bool selected_output_file_on, bool dump_file_on);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user