Home  >  Q&A  >  body text

c++ - C语言里的static函数通常怎么进行单元测试?是不把静态函数作为测试的最小单元吗?还是使用条件编译?

如题,C语言里的static函数通常怎么进行单元测试?是不把静态函数作为测试的最小单元吗?还是使用条件编译?

高洛峰高洛峰2714 days ago795

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-17 13:12:33

    If you are worried that running the test will leave some irreversible side effects, the only way is to start the program every time a test case is run. Testing is still testing.

    reply
    0
  • Cancelreply