-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCMock 3: Infinite recursion when mocking object that does selector forwarding #126
Comments
With the recent changes made in response to some of the other issues reported this problem seems to have been fixed, too. Could you retry whether it works for you now? |
I will give it a try and get back to you as soon as I can. Thanks for the update. |
The problem still occurs with the referenced example test case. |
Any update here? I've just recently upgraded some projects to OCMock 3 and am seeing the same issue partial mocking objects with classes that use selector forwarding. |
Many years later I looked into this again. There's still no fix. The problem is that |
That sounds like a challenging problem indeed. For what it's worth, we haven't seen this crop up in many years. We needed to reduce reliance on selector forwarding, and avoiding the infinite recursion in tests was an excellent motivator. |
The code base I work on includes several classes that utilize selector forwarding. Each forwarding class has the following code:
When migrating to OCMock 3 from version 2, I found that infinite recursion would occur if I simply created a partial mock for an instance of one of these classes. I worked around it by changing the first line of
‑forwardingTargetForSelector:
to be the following:I made a simple test class that demonstrates the problem.
The text was updated successfully, but these errors were encountered: