我应该使用什么C ++模拟框架? [英] What C++ mocking framework should I use?
本文介绍了我应该使用什么C ++模拟框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在c ++中模拟对象并更改方法行为。
问题是Gmock要求我的方法是虚拟的,以便从它们继承并改变行为但我无法将我的方法改为虚拟。
我尝试过:
我尝试过Typemock Isolator ++,它可以访问任何类型的方法但不幸的是它是商业的。
我检查的其他模拟框架也要求每个方法都像Gmock一样是虚拟的。
提前致谢
解决方案
选择:列表单元测试框架 - 维基百科 [ ^ ]。
I need to mock objects and change method behavior in c++.
The problem is that Gmock requires my methods to be virtual in order to inherit from them and change the behavior but I am not able to change my methods to virtual.
What I have tried:
I have tried Typemock Isolator++, it can access any kind of method but unfortunately it is commercial .
Other mocking frameworks that I checked also requires each method to be virtual just like Gmock.
Thanks in advance
解决方案
Take your pick: List of unit testing frameworks - Wikipedia[^].
这篇关于我应该使用什么C ++模拟框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文