对于C单元测试框架 [英] unit testing framework for C
本文介绍了对于C单元测试框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有像JUnit和NUnit的Java和.NET对C的单元测试框架?
还是我们如何测试一张code的C语言编写的不同场景?
Is there any unit testing framework for C like JUnit and Nunit for java and .NET? Or how do we test a piece of code written in C for different scenarios?
在此先感谢......
Thanks in advance......
推荐答案
我已经做了一些与检查和它非常易于安装。它的使用如的GStreamer 一些大的活动项目。下面是一个简单的例子,如果失败行:
I have worked some with Check and its very easy to setup. Its used by some big active projects like GStreamer. Here is a simple example of fail if line:
fail_if (0 == get_element_position(spot), "Position should not be 0");
这篇关于对于C单元测试框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文