Skip to content

Commit e90d2cb

Browse files
committed
Added changes made necessary by #235.
1 parent 4b0b147 commit e90d2cb

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Source/Changes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ OCMock 3.3 (unreleased)
55

66
* Made the use of mock objects thread safe. You still have to setup the mocks
77
and verify them from a main thread (Ian Anderson)
8+
* Added modern syntax for reject (Piotr Tobolski)
89

910

1011
OCMock 3.2.2 (2016-01-20)
@@ -19,7 +20,6 @@ OCMock 3.2.1 (2016-01-13)
1920
* Disposing dynamically generated subclasses after use (David Stites)
2021
* Build script now signs frameworks in releases. The signing identity can
2122
be changed in the script.
22-
* Added modern syntax for reject (Piotr Tobolski)
2323

2424

2525
OCMock 3.2 (2015-10-03)

Source/OCMock/OCMMacroState.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ + (void)beginRejectMacro
6464
{
6565
OCMExpectationRecorder *recorder = [[[OCMExpectationRecorder alloc] init] autorelease];
6666
[recorder never];
67-
globalState = [[[OCMMacroState alloc] initWithRecorder:recorder] autorelease];
67+
OCMMacroState *macroState = [[OCMMacroState alloc] initWithRecorder:recorder];
68+
[NSThread currentThread].threadDictionary[OCMGlobalStateKey] = macroState;
69+
[macroState release];
6870
}
6971

7072
+ (OCMStubRecorder *)endRejectMacro

Source/OCMock/OCMock.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@
7070
({ \
7171
_OCMSilenceWarnings( \
7272
[OCMMacroState beginRejectMacro]; \
73-
invocation; \
74-
[OCMMacroState endRejectMacro]; \
73+
OCMStubRecorder *recorder = nil; \
74+
@try{ \
75+
invocation; \
76+
}@finally{ \
77+
recorder = [OCMMacroState endRejectMacro]; \
78+
} \
79+
recorder; \
7580
); \
7681
})
7782

0 commit comments

Comments
 (0)