当前位置:网站首页>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边栏推荐
- Why does invariant mode improve performance
- redis事务
- In the release version, the random white screen does not display the content after opening the shutter
- A quick start to fastdfs takes you three minutes to upload and download files to the ECS
- [public class preview]: basis and practice of video quality evaluation
- How to implement Devops with automatic tools
- Jerry's ad series MIDI function description [chapter]
- Flink1.13 SQL basic syntax (I) DDL, DML
- torch. Tensor and torch The difference between tensor
- 杰理之AD 系列 MIDI 功能说明【篇】
猜你喜欢

MP3是如何诞生的?

B站视频 声音很小——解决办法

杰理之增加进关机前把触摸模块关闭流程【篇】

ArcGIS 10.2.2 | solution to the failure of ArcGIS license server to start

How is the entered query SQL statement executed?
![[weekly translation go] how to code in go series articles are online!!](/img/bf/77253c87bfa1512f4b8d3d8f7ebe80.png)
[weekly translation go] how to code in go series articles are online!!
![[wechat applet] collaborative work and release](/img/14/2658cf0ba6be9432c74b2490e53d05.png)
[wechat applet] collaborative work and release

Case sharing | integrated construction of data operation and maintenance in the financial industry

杰理之AD 系列 MIDI 功能说明【篇】

torch. Tensor and torch The difference between tensor
随机推荐
IIC (STM32)
ArcGIS 10.2.2 | solution to the failure of ArcGIS license server to start
每日一题-LeetCode1200-最小绝对差-数组-排序
redis03——Redis的网络配置与心跳机制
In the release version, the random white screen does not display the content after opening the shutter
Jerry's ad series MIDI function description [chapter]
Redis03 - network configuration and heartbeat mechanism of redis
Jerry's ad series MIDI function description [chapter]
Drop down selection of Ehlib database records
旋变串判断
为什么说不变模式可以提高性能
Jerry's ad series MIDI function description [chapter]
创客思维在高等教育中的启迪作用
The video sound of station B is very low - solution
Delphi SOAP WebService 服务器端多个 SoapDataModule 实现相同的接口方法,接口继承
How was MP3 born?
迈动互联中标北京人寿保险
Billions of citizens' information has been leaked! Is there any "rescue" for data security on the public cloud?
更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"