之后如何在 CPPUNIT_TEST 中访问我在第一个 CPPUNIT_TEST 中设置的变量?
对于 EX。
CPPUNIT_TEST_SUITE(TestingEx);
CPPUNIT_TEST(ex1);
CPPUNIT_TEST(ex2);
CPPUNIT_TEST_SUITE_END();
public:
int x=0;
void ex1()
{
do some testing and logic would set x to someother value ...
x=4;
}
void ex2()
{
use x to do some testing // x should be 4, but I get 0??
}
有人可以解释一下我出了什么问题,我该如何让它工作?