You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #1107, we realized that we should add final for our user-facing public classes or add a test that derives from them and uses them in derived classes.
The text was updated successfully, but these errors were encountered:
How should we go about this? Testing things like these is unfortunately not as simple as just deriving from the class and using it once. Unless we had full test coverage for a derived-from Series class, this bug would have probably not shown, since it occurs only at runtime as soon as the function SeriesInterface::readIterations() is called.
Essentially, this issue asks to duplicate nearly our complete test suite for derived-from classes.
The only thing that I can imagine for now would be something like:
#include<openPMD/openPMD.hpp>// do *not* do something like `using namespace openPMD;`classSeries : publicopenPMD::Series
{
// make all constructors of openPMD::Series availabletemplate< typename ...Args >
Series( Args&&... args) : openPMD::Series{ std::forward< Args >( args )... }
{}
};
(I haven't yet tested if that would actually catch the bug in #1107)
And pull that same trick for all other classes or class templates that we have. Also, don't use auto anywhere in the tests, so we make sure that everywhere uses those derived classes. If there's one code path not covered, that one could be where something like object slicing would happen.
In #1107, we realized that we should add
final
for our user-facing public classes or add a test that derives from them and uses them in derived classes.The text was updated successfully, but these errors were encountered: