palaeoware / trevosim

TREvoSim - The [Tr]ee [Evo]lutionary [Sim]ulator program
GNU General Public License v3.0
5 stars 3 forks source link

testOne testFlag usage #49

Closed ms609 closed 5 months ago

ms609 commented 5 months ago

Not particularly consequential, but in testOne (and others) an error triggers a return false and the test to abort, whereas in testZero an error sets the flag to false but subsequent tests continue to run. The line if (testFlag) out << "\nMask initiation tests passed.\n"; hints that this, rather than an immediate return is the intention for this test.

RussellGarwood commented 5 months ago

Yes, this is inconsistent. I have changed it so the tests now throughout return false on an error of a simulation not initialising correctly, but failed tests will just make the flag false. There are several ways I could do these tests, but this way when it returns it should be obvious at which point of initialising a simulation the test failed from the return point.