当前位置:网站首页>GTEST from ignorance to proficiency (4) how to write unit tests with GTEST
GTEST from ignorance to proficiency (4) how to write unit tests with GTEST
2022-07-04 21:41:00 【Wonderful binary】
1 gtest What is it?
gtest yes Google Developed a cross platform open source unit testing framework ,git Warehouse click here to get . Mainly aimed at c/c++,gtest It has the following characteristics :
The test framework
Automatically collect test cases , No need for developers to organize again
Provides a powerful set of assertions , Support includes Boolean 、 integer 、 floating-point 、 String, etc.
Provides custom extensions for assertion methods
Provide death test function
Common use case initialization and cleaning can be put into the test fixture , from gtest Automatically call
Value-parameterized tests.
Type-parameterized tests.
Generate xml Format test report
2. Define a basic test case
TEST Macros are used to define a test case :
#include <gtest/gtest.h>
int Add(int i
边栏推荐
- redis事务
- redis缓存
- [ 每周译Go ] 《How to Code in Go》系列文章上线了!!
- Huawei ENSP simulator configures DHCP for router
- Jerry's ad series MIDI function description [chapter]
- Open3D 曲面法向量计算
- Flutter在 release版本,打开后随机白屏不显示内容
- Routing configuration and connectivity test of Huawei simulator ENSP
- Word文档中标题前面的黑点如何去掉
- 解读创客教育中的各类智能化组织发展
猜你喜欢
杰理之增加进关机前把触摸模块关闭流程【篇】
At the right time, the Guangzhou station of the city chain science and Technology Strategy Summit was successfully held
Flutter TextField示例
每日一题-LeetCode1200-最小绝对差-数组-排序
Shutter textfield example
Jerry's ad series MIDI function description [chapter]
解析互联网时代的创客教育技术
迈动互联中标北京人寿保险
SolidWorks工程图添加材料明细表的操作
开源之夏专访|Apache IoTDB社区 新晋Committer谢其骏
随机推荐
Drop down selection of Ehlib database records
How to use concurrentlinkedqueue as a cache queue
杰理之AD 系列 MIDI 功能说明【篇】
Use of class methods and class variables
哈希表(Hash Tabel)
Flutter 返回按钮的监听
Golang interview finishing three resumes how to write
TCP shakes hands three times and waves four times. Do you really understand?
杰理之AD 系列 MIDI 功能说明【篇】
IIC (STM32)
Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"
杰理之AD 系列 MIDI 功能说明【篇】
Huawei ENSP simulator configures DHCP for router
Jerry's ad series MIDI function description [chapter]
解读创客教育中的各类智能化组织发展
类方法和类变量的使用
redis RDB AOF
Jerry's ad series MIDI function description [chapter]
应用实践 | 蜀海供应链基于 Apache Doris 的数据中台建设
案例分享|金融业数据运营运维一体化建设