Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: third_party/ocmock/OCMock/OCObserverMockObject.m

Issue 9240023: Roll OCMock r77:7f521db0628086185123666b0979e48d6ecaeac1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 //------------------------------------------------------------------------------ --------- 1 //------------------------------------------------------------------------------ ---------
2 // $Id: OCObserverMockObject.m 57 2010-07-19 06:14:27Z erik $ 2 // $Id$
3 // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 3 // Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
4 //------------------------------------------------------------------------------ --------- 4 //------------------------------------------------------------------------------ ---------
5 5
6 #import "OCObserverMockObject.h" 6 #import "OCObserverMockObject.h"
7 #import "OCMObserverRecorder.h" 7 #import "OCMObserverRecorder.h"
8 8
9 9
10 @implementation OCObserverMockObject 10 @implementation OCObserverMockObject
11 11
12 #pragma mark Initialisers, description, accessors, etc. 12 #pragma mark Initialisers, description, accessors, etc.
13 13
14 - (id)init 14 - (id)init
15 { 15 {
16 » [super init]; 16 » self = [super init];
17 recorders = [[NSMutableArray alloc] init]; 17 recorders = [[NSMutableArray alloc] init];
18 return self; 18 return self;
19 } 19 }
20 20
21 - (void)dealloc 21 - (void)dealloc
22 { 22 {
23 [recorders release]; 23 [recorders release];
24 [super dealloc]; 24 [super dealloc];
25 } 25 }
26 26
(...skipping 30 matching lines...) Expand all
57 [self description], [recorders count]]; 57 [self description], [recorders count]];
58 } 58 }
59 } 59 }
60 60
61 61
62 62
63 #pragma mark Receiving notifications 63 #pragma mark Receiving notifications
64 64
65 - (void)handleNotification:(NSNotification *)aNotification 65 - (void)handleNotification:(NSNotification *)aNotification
66 { 66 {
67 » int i, limit; 67 » NSUInteger i, limit;
68 68
69 limit = expectationOrderMatters ? 1 : [recorders count]; 69 limit = expectationOrderMatters ? 1 : [recorders count];
70 for(i = 0; i < limit; i++) 70 for(i = 0; i < limit; i++)
71 { 71 {
72 if([[recorders objectAtIndex:i] matchesNotification:aNotificatio n]) 72 if([[recorders objectAtIndex:i] matchesNotification:aNotificatio n])
73 { 73 {
74 [recorders removeObjectAtIndex:i]; 74 [recorders removeObjectAtIndex:i];
75 return; 75 return;
76 } 76 }
77 } 77 }
78 [NSException raise:NSInternalInconsistencyException format:@"%@: unexpec ted notification observed: %@", [self description], 78 [NSException raise:NSInternalInconsistencyException format:@"%@: unexpec ted notification observed: %@", [self description],
79 [aNotification description]]; 79 [aNotification description]];
80 } 80 }
81 81
82 82
83 @end 83 @end
OLDNEW
« no previous file with comments | « third_party/ocmock/OCMock/OCObserverMockObject.h ('k') | third_party/ocmock/OCMock/OCObserverMockObjectTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698