Ai
1 Star 6 Fork 1

jiangli/Tutorials

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.cpp 486 Bytes
一键复制 编辑 原始数据 按行查看 历史
李江 提交于 2023-08-29 08:58 +08:00 . feat[03]: add test gtest
//
// Authir:jiangli
// Email: 1316762810@qq.com
//
#include "sum_integers.h"
#include "gtest/gtest.h"
#include <vector>
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
TEST(example, sum_zero) {
auto integers = {1, -1, 2, -2, 3, -3};
auto result = sum_integers(integers);
ASSERT_EQ(result, 0);
}
TEST(example, sum_five) {
auto integers = {1, 2, 3, 4, 5};
auto result = sum_integers(integers);
ASSERT_EQ(result, 15);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jiangli01/tutorials.git
git@gitee.com:jiangli01/tutorials.git
jiangli01
tutorials
Tutorials
master

搜索帮助