当前位置:网站首页>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
边栏推荐
- 2021 CCPC Harbin B. magical subsequence (thinking question)
- Huawei ENSP simulator configures DHCP for router
- Redis cache
- Delphi SOAP WebService 服务器端多个 SoapDataModule 实现相同的接口方法,接口继承
- 华为模拟器ensp的路由配置以及连通测试
- MP3是如何诞生的?
- Interpreting the development of various intelligent organizations in maker Education
- 更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
- Numpy vstack and column_ stack
- Compréhension approfondie du symbole [langue C]
猜你喜欢
每日一题-LeetCode1200-最小绝对差-数组-排序
Daily question-leetcode556-next larger element iii-string-double pointer-next_ permutation
[C language] deep understanding of symbols
一文掌握数仓中auto analyze的使用
Huawei ENSP simulator configures ACL access control list
杰理之AD 系列 MIDI 功能说明【篇】
解析互联网时代的创客教育技术
How to remove the black dot in front of the title in word document
Jerry added the process of turning off the touch module before turning it off [chapter]
Y56. Chapter III kubernetes from entry to proficiency -- business image version upgrade and rollback (29)
随机推荐
华为模拟器ensp的路由配置以及连通测试
面试官:说说XSS攻击是什么?
杰理之AD 系列 MIDI 功能说明【篇】
SolidWorks工程图添加材料明细表的操作
为什么说不变模式可以提高性能
Huawei ENSP simulator configures DHCP for router
TCP shakes hands three times and waves four times. Do you really understand?
Enlightenment of maker thinking in Higher Education
Billions of citizens' information has been leaked! Is there any "rescue" for data security on the public cloud?
[buuctf.reverse] 151_ [FlareOn6]DnsChess
Super detailed tutorial, an introduction to istio Architecture Principle and practical application
2022 version of stronger jsonpath compatibility and performance test (snack3, fastjson2, jayway.jsonpath)
Jerry's ad series MIDI function description [chapter]
Le module minidom écrit et analyse XML
Golang interview finishing three resumes how to write
Go language loop statement (3 in Lesson 10)
迈动互联中标北京人寿保险
巅峰不止,继续奋斗!城链科技数字峰会于重庆隆重举行
Jerry added the process of turning off the touch module before turning it off [chapter]
更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)