随笔 - 52  文章 - 50  评论 - 1  阅读 - 24839
05 2022 档案
googletest相关文章
摘要:windows从零搭建googletest测试工程 https://blog.csdn.net/qq_42769920/article/details/121198844基于gtest、mockcpp写C++LLT测试入门级教程 https://blog.csdn.net/qq_43003442/a 阅读全文
posted @ 2022-05-26 10:40 蜀山菜鸟 阅读(47) 评论(0) 推荐(0) 编辑
Gmock简单使用
摘要:参考:https://blog.csdn.net/primeprime/article/details/99677794 #include "gtest.h" #include "gmock.h" #include <string> #include <iostream> using namespa 阅读全文
posted @ 2022-05-25 20:48 蜀山菜鸟 阅读(464) 评论(0) 推荐(0) 编辑
ClionLLT搭建
摘要:1. 准备工作 a.下载googletest源码 gtest源码下载地址: 下载地址:https://github.com/google/googletest git 仓库地址:https://github.com/google/googletest.git b.clion工程准备 2. 目录结构 阅读全文
posted @ 2022-05-25 11:54 蜀山菜鸟 阅读(105) 评论(0) 推荐(0) 编辑
CMake学习
摘要:LINK_DIRECTORIES LINK_DIRECTORIES 命令来指定第三方库所在路径,比如,你的动态库在/home/myproject/libs这个路径下,则通过命令:LINK_DIRECTORIES(/home/myproject/libs),把该路径添加到第三方库搜索路径中,这样就可以 阅读全文
posted @ 2022-05-24 21:23 蜀山菜鸟 阅读(475) 评论(0) 推荐(0) 编辑
googletest简单搭建
摘要:主函数 #include "gtest/gtest.h" #include "gmock/gmock.h" int main(int argc, char **argv) { testing::InitGoogleMock(&argc, argv); testing::InitGoogleTest( 阅读全文
posted @ 2022-05-24 19:51 蜀山菜鸟 阅读(153) 评论(0) 推荐(0) 编辑
googletest 示例
摘要:googletest测试用例 class TestExample : public testing::Test { public: // 所有用例执行前 执行该函数 static void SetUpTestCase() {} // 所有用例执行结束后,执行该函数 static void TearD 阅读全文
posted @ 2022-05-23 22:14 蜀山菜鸟 阅读(454) 评论(0) 推荐(0) 编辑
c++变长参数的应用
摘要:c++变长参数应用示例: // C++中C11提供了任意类别的安全的变长参数函数模板(C11之前模板函数参数个数只能固定),使用方法如下: // template<typename... Args> void Func(Args... args); template <typename... Arg 阅读全文
posted @ 2022-05-23 22:11 蜀山菜鸟 阅读(124) 评论(0) 推荐(0) 编辑
const修饰
摘要:const修饰是否能修改,判断性质简便方法:从由往左读,遇到p就替换为“p is a”,遇到*就替换为“point to”,其余不变。 如 const int p; p is a int const. p是一个int型常量 阅读全文
posted @ 2022-05-19 22:00 蜀山菜鸟 阅读(18) 评论(0) 推荐(0) 编辑
C语言常见易错点
摘要:1. 占位符概念 关于%.*f的格式化输出:(占位符的概念) int a = 4; float m = 3.14159; printf(“%.*f\n”, a, m); A. 3.1416 B. 3.14159 C. 4.000000 D. 运行错误还是什么的,不太记得了 解析:https://zh 阅读全文
posted @ 2022-05-19 20:33 蜀山菜鸟 阅读(53) 评论(0) 推荐(0) 编辑
适配器,桥接,代理,享元模式示例代码
摘要:适配器模式: // 适配器模式 将一个类的接口转换成客户希望的另外一个接口 // 接口层 class OutInterface { public: virtual ~OutInterface() = default; // 客户希望实现的接口 例如: 用户希望一次性打印姓名 年龄 成绩 virtua 阅读全文
posted @ 2022-05-19 14:57 蜀山菜鸟 阅读(30) 评论(0) 推荐(0) 编辑
CMake常用编译选项
摘要:-j 27 // 多线程,最多27个线程编译 VERBOSE=1 // 打印详细的编译信息 阅读全文
posted @ 2022-05-19 11:16 蜀山菜鸟 阅读(90) 评论(0) 推荐(0) 编辑
UML
摘要:时序图: https://www.cnblogs.com/ywqu/archive/2009/12/22/1629426.html 阅读全文
posted @ 2022-05-17 17:15 蜀山菜鸟 阅读(13) 评论(0) 推荐(0) 编辑
电子书
摘要:电子书 GCC中文手册.pdf Git学习总结.doc GNU make v3.80完整版中文指南.pdf GNU-Make-使用手册(中译版).pdf GNU-make-中文手册.pdf Linux进程控制.pdf 100个gdb小技巧(v1.0).pdf 阅读全文
posted @ 2022-05-17 16:06 蜀山菜鸟 阅读(22) 评论(0) 推荐(0) 编辑
CMake常用函数宏定义等
摘要:https://cmake.org/cmake/help/latest/command/add_library.html message([STATUS|WARNING|AUTHOR_WARNING|FATAL_ERROR|SEND_ERROR]"message to display"...) ⽆) 阅读全文
posted @ 2022-05-17 14:32 蜀山菜鸟 阅读(281) 评论(0) 推荐(0) 编辑
代理模式
摘要:class Service { public: int QueryData() { // 服务端,查询数据,订阅数据,修改数据等 cout << "this is service data" << endl; return 0; } }; class CProxy { private: CProxy 阅读全文
posted @ 2022-05-16 21:35 蜀山菜鸟 阅读(18) 评论(0) 推荐(0) 编辑
桥接模式实现
摘要:// 抽象部分, 外部接口,抽象化产品 // 当一个类存在两个独立变化的维度,且这两个维度都需要进行扩展时。 // 当一个系统不希望使用继承或因为多层次继承导致系统类的个数急剧增加时。 // 当一个系统需要在构件的抽象化角色和具体化角色之间增加更多的灵活性时。 // 例子1: 画图形 正方形, 圆形 阅读全文
posted @ 2022-05-16 20:18 蜀山菜鸟 阅读(27) 评论(0) 推荐(0) 编辑
引用接口赋值
摘要:继承接口赋值的时候,需要采用引用的方式,需要在初始化列表里面初始化 class Parent { public: virtual void ShowEntry() { cout << " entry parent "<< endl; }; }; class Child : public Parent 阅读全文
posted @ 2022-05-16 20:16 蜀山菜鸟 阅读(20) 评论(0) 推荐(0) 编辑
googletest Cmake脚本
摘要:主目录CMakeLists.txt cmake_minimum_required(VERSION 3.20) project(CppTest) set(CMAKE_CXX_STANDARD 14) include("D:/platform/gtest.cmake") include("D:/plat 阅读全文
posted @ 2022-05-16 15:26 蜀山菜鸟 阅读(171) 评论(0) 推荐(0) 编辑
Makefile的链接顺序
摘要:在链接静态库时,如果静态库之间存在依赖关系,则存在依赖关系的静态库在链接时存在链接顺序的问题,否则会出现找不到链接符号的错误,undefined reference to `XXX'. 例如:libtest2.a依赖libtest1.a,可执行文件test依赖libtest2.a,则链接顺序为:-l 阅读全文
posted @ 2022-05-14 11:41 蜀山菜鸟 阅读(868) 评论(0) 推荐(0) 编辑
图形程序开发 opengl和directx
摘要:https://zhidao.baidu.com/question/119300042.html opengl和directxOpenGL:OpenGL是个专业的3D程序接口,是一个功能强大,调用方便的底层3D图形库。OpenGL是个与硬件无关的软件接口,可以在不同的平台如Windows 95、Wi 阅读全文
posted @ 2022-05-12 10:53 蜀山菜鸟 阅读(203) 评论(0) 推荐(0) 编辑
Clion 错误信息
摘要:1. 在Clion中用gtest执行单元测试,返回错误 Error running 'testAdd.t0': Cannot run 'testAdd.t0' on '<default> 原因是没有指定单元测试的入口。 解决办法:Run->Edit Configurations -> 设置好指定的t 阅读全文
posted @ 2022-05-08 10:40 蜀山菜鸟 阅读(370) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示