palaeoware / trevosim

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

testOne testFlag usage #49

Closed ms609 closed 1 month ago

ms609 commented 1 month 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 1 month 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.