https://github.com/catchorg/Catch2
写起来也很简单:
define CATCH_CONFIG_MAIN
include "catch.hpp"
unsigned int factorial( unsigned int n ) {
return n <= 1 ? n : Factorial(n-1) * n;}
TEST_CASE("Factorials are computed", "[factorial]" ) {
REQUIRE( factorial(1) == 1 );REQUIRE( factorial(2) == 2 );REQUIRE( factorial(3) == 6 );REQUIRE( factorial(10) == 3628800 );}
继续阅读与本文标签相同的文章
上一篇 :
Dremio架构分析
下一篇 :
阿里巴巴在应用性能测试场景设计和实现上的实践
-
监控Apache Flink应用程序101
2026-05-20栏目: 教程
-
阿里云CDN上线 WAF,一站式提供分发+安全能力
2026-05-20栏目: 教程
-
阿里云服务器优惠购买攻略:代金券+9折优惠码+云上爆款特惠活动
2026-05-20栏目: 教程
-
Java面试之Jvm内存泄漏
2026-05-20栏目: 教程
-
算法题之动态规划-01背包问题
2026-05-20栏目: 教程
