Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用框架 cppunit 来测试我的类,我想知道这些方法是为 TEST_SUITE 调用一次还是为添加到该套件的每个方法调用TestFixture::setUp()它们TestFixture::tearDown()
TestFixture::setUp()
TestFixture::tearDown()
这些方法包装了每个单独的测试用例。从文档:
每个测试都在自己的夹具中运行,因此测试运行之间不会有副作用。