Open tudortimi opened 5 years ago
This used to work in the past, but the name of the mock is now concatenated to create a define. I'm not sure what this define is used for.
There's a great reason for this. but for the life of me I can't remember what that is. I think it has something to do with needing to use the name of the class under the hood to be able to specialize arguments and method names so that there was no overlap (i.e. name conflicts) between mocks.
I'm looking through the code now thinking I had a half-hack to get avoid this being a dead-stop but I can't see it...
I think the concatenated define is there to be able to decide in the mocker expansions if you want to call super.
What's the use case for mocks without any parent class? The only thing I can think of is when you want to test a class that takes a type parameter, where you pass the mock type as the parameter value.
I think I know how to solve this now. If we don't want a parent, we can use a dummy class as a parent. This dummy class would be defined in svmock
. This dummy class would be the default parameter of the `SVMOCK
macro.
Another idea using the pre-processor: https://stackoverflow.com/a/77293308/1334062
This is a good trick to keep in mind.