当前位置:网站首页>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边栏推荐
- Daily question-leetcode556-next larger element iii-string-double pointer-next_ permutation
- Jerry's ad series MIDI function description [chapter]
- Go language loop statement (3 in Lesson 10)
- Flutter 返回按钮的监听
- Case sharing | integrated construction of data operation and maintenance in the financial industry
- 2021 CCPC Harbin I. power and zero (binary + thinking)
- Three or two things about the actual combat of OMS system
- flink1.13 sql基础语法(一)DDL、DML
- Numpy vstack and column_ stack
- 吐槽 B 站收费,是怪它没钱么?
猜你喜欢

CloudCompare&Open3D DBSCAN聚类(非插件式)
![[ 每周译Go ] 《How to Code in Go》系列文章上线了!!](/img/bf/77253c87bfa1512f4b8d3d8f7ebe80.png)
[ 每周译Go ] 《How to Code in Go》系列文章上线了!!

【公开课预告】:视频质量评价基础与实践
![Jerry added the process of turning off the touch module before turning it off [chapter]](/img/28/5e4eb39243a0c973d0b90f76571f9b.png)
Jerry added the process of turning off the touch module before turning it off [chapter]

Redis 排查大 key 的3种方法,优化必备
![[wechat applet] collaborative work and release](/img/14/2658cf0ba6be9432c74b2490e53d05.png)
[wechat applet] collaborative work and release

巅峰不止,继续奋斗!城链科技数字峰会于重庆隆重举行

Master the use of auto analyze in data warehouse

Huawei ENSP simulator layer 3 switch

解析互联网时代的创客教育技术
随机推荐
2022 version of stronger jsonpath compatibility and performance test (snack3, fastjson2, jayway.jsonpath)
Redis cache
Word文档中标题前面的黑点如何去掉
redis RDB AOF
redis事务
For MySQL= No data equal to null can be found. Solution
Redis bloom filter
Flink1.13 SQL basic syntax (I) DDL, DML
Redis03 - network configuration and heartbeat mechanism of redis
Go语言循环语句(第10课中3)
EhLib 数据库记录的下拉选择
Delphi soap WebService server-side multiple soapdatamodules implement the same interface method, interface inheritance
Billions of citizens' information has been leaked! Is there any "rescue" for data security on the public cloud?
SolidWorks工程图添加材料明细表的操作
Kubedm initialization error: [error cri]: container runtime is not running
Redis 排查大 key 的3种方法,优化必备
解析steam教育中蕴含的众创空间
Jerry's ad series MIDI function description [chapter]
开源之夏专访|Apache IoTDB社区 新晋Committer谢其骏
2021 CCPC Harbin B. magical subsequence (thinking question)