unittests: make the destructors be the virtual functions