Unit tests for the core SMS++ library. Each test is registered as a separate
ctest target and exercises one of the core abstractions in isolation:
ClassFactory_testchecks the class factory used to constructBlock,SolverandConfigurationobjects by name.AbstractBlock_testcoversBlockandAbstractBlock.ColVariable_testcoversVariableandColVariable.BooleanVariable_testcoversBooleanVariable,ClauseConstraintwith theClauseConstraintModit issues, andBooleanVariableSolution.Function_testcovers theFunctioninterface.LinearFunction_testcoversLinearFunction.QuadFunction_testcoversDQuadFunction.AbstractPath_testcoversAbstractPath.SizeVariable_testcovers the size variable of aPolyhedralFunctionBlock, given before or after its abstract representation exists and kept in step by a change of the global scale.Group_testcovers the groups ofVariableandConstraintof aBlock, and the two consumers that copy them, theSolutionand the abstract copy of aBlock.Solution_testcovers what aSolutiondoes when the dynamicRowConstraintof theBlockit was read from are removed, i.e., the dual values it has to drop for whoever holds a dual solution to see whether what is left of it is still feasible.
These are built and run through CMake / ctest (there is no makefile here); all of them passing is a good sign that no regressions have been introduced in the SMS++ core.
The checks of a test are assert(), and they hold in every build type, the
Release one included: each test includes TestAssert.h after every header of
the library, which undefines NDEBUG for the test alone while the library
headers are read as the library was compiled.
-
Donato Meoli
Dipartimento di Informatica
Università di Pisa -
Niccolò Iardella
Dipartimento di Informatica
Università di Pisa -
Rafael Durbano Lobato
Dipartimento di Informatica
Università di Pisa -
Wim van Ackooij
EDF Lab Paris-Saclay
This code is provided free of charge under the GNU Lesser General Public License version 3.0, see the LICENSE file for details.