Skip to content

Commit

Permalink
renaming, reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Jan 22, 2025
1 parent 7bb3304 commit e825789
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 44 deletions.
18 changes: 9 additions & 9 deletions tests/xmltester/XMLTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ XMLTester::XMLTester()
wktwriter(nullptr),
wkbreader(nullptr),
wkbwriter(nullptr),
failed(0),
succeeded(0),
failedCount(0),
succeededCount(0),
caseCount(0),
testCount(0),
testLineNum(0),
Expand Down Expand Up @@ -356,14 +356,14 @@ XMLTester::resultSummary(std::ostream& os) const
{
os << "Files: " << testFileCount << std::endl;
os << "Tests: " << totalTestCount << std::endl;
os << "Failed: " << failed << std::endl;
os << "Succeeded: " << succeeded << std::endl;
os << "Failed: " << failedCount << std::endl;
os << "Succeeded: " << succeededCount << std::endl;
}

void
XMLTester::resetCounters()
{
testFileCount = totalTestCount = failed = succeeded = 0;
testFileCount = totalTestCount = failedCount = succeededCount = 0;
}

void
Expand Down Expand Up @@ -637,10 +637,10 @@ XMLTester::runTest(const tinyxml2::XMLNode* node)
bool success = test.run(node, gA, gB);

if(success) {
++succeeded;
++succeededCount;
}
else {
++failed;
++failedCount;
}
}

Expand Down Expand Up @@ -1455,7 +1455,7 @@ main(int argC, char* argV[])
continue;
}
if(! std::strcmp(argV[i], "--test-valid-output")) {
tester.testOutputValidity(true);
tester.setTestOutputValidity(true);
continue;
}
if(! std::strcmp(argV[i], "--sql-output")) {
Expand All @@ -1469,7 +1469,7 @@ main(int argC, char* argV[])
continue;
}
if(! std::strcmp(argV[i], "--test-valid-input")) {
tester.testInputValidity(true);
tester.setTestInputValidity(true);
continue;
}

Expand Down
51 changes: 16 additions & 35 deletions tests/xmltester/XMLTester.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,11 @@ using geos::geom::Geometry;
class XMLTester {

private:
enum {
SHOW_RUN_INFO = 1,
SHOW_CASE,
SHOW_TEST,
SHOW_RESULT,
SHOW_GEOMS,
SHOW_GEOMS_FULL,
PRED
};

void parsePrecisionModel(const tinyxml2::XMLElement* el);
void parseRun(const tinyxml2::XMLNode* node);
void parseCase(const tinyxml2::XMLNode* node);

void runPredicates(const geom::Geometry* a, const geom::Geometry* b);

void runTest(const tinyxml2::XMLNode* node);
Expand All @@ -56,13 +48,11 @@ class XMLTester {

int verbose;

int failed;
int succeeded;
int failedCount;
int succeededCount;
int caseCount;
int testCount;
int testLineNum;
std::string opSignature;

int testFileCount;
int totalTestCount;

Expand Down Expand Up @@ -99,41 +89,32 @@ class XMLTester {
*/
int setVerbosityLevel(int val);

int isVerbose() { return verbose; }

bool isTestValidOutput() { return testValidOutput; }

bool isPrepared() { return usePrepared; }

geom::GeometryFactory* getFactory() { return factory.get(); }

int
getFailuresCount()
{
return failed;
}

void
testOutputValidity(bool val)
void setTestOutputValidity(bool val)
{
testValidOutput = val;
}
void
testInputValidity(bool val)
void setTestInputValidity(bool val)
{
testValidInput = val;
}
void
setSQLOutput(bool val)
void setSQLOutput(bool val)
{
sqlOutput = val;
}
void
setHEXWKBOutput(bool val)
void setHEXWKBOutput(bool val)
{
HEXWKB_output = val;
}

int isVerbose() { return verbose; }

bool isTestValidOutput() { return testValidOutput; }

bool isPrepared() { return usePrepared; }

geom::GeometryFactory* getFactory() { return factory.get(); }

int getFailuresCount() { return failedCount; }
};

/*
Expand Down

0 comments on commit e825789

Please sign in to comment.