-
Notifications
You must be signed in to change notification settings - Fork 607
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
pull request #392 results in a regression #405
Comments
Hey there.. sorry you are having issues. Can you expand on how the test is failing? I'd love to see a reduced test case if possible. |
a reduced test-case is probably technically "possible", though we have a fairly large code-base, and reducing this down would be pretty time-consuming. our test is failing during cleanup, typically with an EXC_BAD_ADDRESS either in the stopMocking that gets called from dealloc, or in the .cxx_destruct for something that at first appears unrelated. i didn't dig much deeper other than to basically |
what that implies to me off the top of my head then is that your test is "passing" because the mock is being leaked. I assume your codebase is ARC based. Would you be able to see if patching in #391 fixes it for you as well? |
i tried applying patch #391, and end up with a crash in the exact same place: `Thread 1: EXC_BAD_INSTRUCTION (code=EXC_i386, INVOP, subcode 0x0) #0 0x00007fff23d0517e in _CFRelease.cold.3 () |
That implies to me that you have and "andDo" block in there somewhere? In your "andDo" block do you extract Arguments or set return values on the invocation? For extract arguments you need to be sure to use something like:
and for returns, I typically make them Note that the I would also try running with |
not sure about the provenance, but it appears the stack-crawl above was produced based on bad DerivedData … i was able to apply patch #391 properly, clean, and run the tests without failure. for informational purposes, we do use and for pragmatic purposes … i am sort of out of spare time for debugging the problem. i had been inclined to move forward with a locally reverted version of #392, and may do so until #391 is merged, or also if further "regressions" pop up. |
Thanks @twitterkb for spending the time on it. FWIW I'm busy attempting to move Google's codebase from OCMock 3.4 to OCMock 3.6 hence all the recent patches. I agree that #391 is a crucial fix to OCMock. |
Assume fixed with #391. |
i had updated to tip-of-master and discovered a regression in a test that performs
id mock = [OCMockObject niceMockForClass:[MyClass class]]; [[[mock stub] andReturn:mock] sharedInstance];
based on the comment in #392
i reverted this patch locally, and the failing test no longer fails.
i have put a comment in pull request #392 that i would like to revert it. also opening this issue to go with it.
The text was updated successfully, but these errors were encountered: