当前位置:网站首页>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边栏推荐
- 类方法和类变量的使用
- Hash table
- 杰理之AD 系列 MIDI 功能说明【篇】
- Operation of adding material schedule in SolidWorks drawing
- Kubeadm初始化报错:[ERROR CRI]: container runtime is not running
- Analyzing the maker space contained in steam Education
- Daily question-leetcode556-next larger element iii-string-double pointer-next_ permutation
- Jerry's ad series MIDI function description [chapter]
- redis事务
- Methods of improving machine vision system
猜你喜欢

如何使用ConcurrentLinkedQueue做一个缓存队列

SolidWorks工程图添加材料明细表的操作

Super detailed tutorial, an introduction to istio Architecture Principle and practical application

redis03——Redis的网络配置与心跳机制

Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"

迈动互联中标北京人寿保险

Difference between ApplicationContext and beanfactory (MS)

torch. Tensor and torch The difference between tensor

Maidong Internet won the bid of Beijing life insurance

IIC (STM32)
随机推荐
Golang interview finishing three resumes how to write
Daily question -leetcode1200- minimum absolute difference - array - sort
torch. Tensor and torch The difference between tensor
Go语言循环语句(第10课中3)
[C language] deep understanding of symbols
Why does invariant mode improve performance
TCP三次握手,四次挥手,你真的了解吗?
Analyzing the maker space contained in steam Education
Le module minidom écrit et analyse XML
【C语言】符号的深度理解
Compréhension approfondie du symbole [langue C]
创客思维在高等教育中的启迪作用
2021 CCPC 哈尔滨 B. Magical Subsequence(思维题)
WGCNA analysis basic tutorial summary
Three or two things about the actual combat of OMS system
SolidWorks工程图添加材料明细表的操作
Jerry's ad series MIDI function description [chapter]
Jerry's ad series MIDI function description [chapter]
Rotary transformer string judgment
Interpreting the development of various intelligent organizations in maker Education