問題描述
之前一直在撞墻,因?yàn)槲以谑褂?c/c++ 時(shí)沒有制作任何測(cè)試類(而是有很多打印方法).
Been hitting my head on the wall before as I don't make any test classes while using c/c++ (but instead have a lot of print methods).
在 c/c++ 代碼中執(zhí)行測(cè)試最常用的方法是什么?Java 的 JUnit 在調(diào)試時(shí)只給我留下了美好的回憶.
What is the most used method to perform testing in the c/c++ code? Java's JUnit has only left me with good memories while debugging things.
我知道在帶有定義的調(diào)試頭的代碼中使用斷言應(yīng)該可以工作,但是沒有更好的方法嗎?
I know that using asserts in code with a defined debug header should work, but aren't there any better ways?
而且由于我打算將來制作測(cè)試類,歡迎提供任何有用的提示.
And since I have the intention to make test classes in the future, any useful tips are welcome.
推薦答案
您可以查看這些:
http://gamesfromwithin.com/?p=29
http://www.opensourcetesting.org/unit_c.php
http://msdn.microsoft.com/en-us/magazine/cc136757.aspx
這篇關(guān)于C/C++ 測(cè)試框架(如 Java 的 JUnit)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!