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

Side by Side Diff: third_party/ocmock/OCMock/OCMock.h

Issue 2626723004: Update OCMock to 3e193f3c2d4ea4ada63df54c8ce98e7ea4cf768f (Closed)
Patch Set: Created 3 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
« no previous file with comments | « third_party/ocmock/OCMock/OCMVerifier.m ('k') | third_party/ocmock/OCMock/OCMock-Info.plist » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //------------------------------------------------------------------------------ --------- 1 /*
2 // $Id$ 2 * Copyright (c) 2004-2015 Erik Doernenburg and contributors
3 // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 3 *
4 //------------------------------------------------------------------------------ --------- 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may
5 * not use these files except in compliance with the License. You may obtain
6 * a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations
14 * under the License.
15 */
5 16
6 #import <OCMock/OCMockObject.h> 17 #import <OCMock/OCMockObject.h>
7 #import <OCMock/OCMockRecorder.h> 18 #import <OCMock/OCMRecorder.h>
19 #import <OCMock/OCMStubRecorder.h>
8 #import <OCMock/OCMConstraint.h> 20 #import <OCMock/OCMConstraint.h>
9 #import <OCMock/OCMArg.h> 21 #import <OCMock/OCMArg.h>
22 #import <OCMock/OCMLocation.h>
23 #import <OCMock/OCMMacroState.h>
10 #import <OCMock/NSNotificationCenter+OCMAdditions.h> 24 #import <OCMock/NSNotificationCenter+OCMAdditions.h>
25 #import <OCMock/OCMFunctions.h>
26
27
28 #define OCMClassMock(cls) [OCMockObject niceMockForClass:cls]
29
30 #define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls]
31
32 #define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol]
33
34 #define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol]
35
36 #define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj]
37
38 #define OCMObserverMock() [OCMockObject observerMock]
39
40
41 #define OCMStub(invocation) \
42 ({ \
43 _OCMSilenceWarnings( \
44 [OCMMacroState beginStubMacro]; \
45 invocation; \
46 [OCMMacroState endStubMacro]; \
47 ); \
48 })
49
50 #define OCMExpect(invocation) \
51 ({ \
52 _OCMSilenceWarnings( \
53 [OCMMacroState beginExpectMacro]; \
54 invocation; \
55 [OCMMacroState endExpectMacro]; \
56 ); \
57 })
58
59 #define ClassMethod(invocation) \
60 _OCMSilenceWarnings( \
61 [[OCMMacroState globalState] switchToClassMethod]; \
62 invocation; \
63 );
64
65
66 #define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__ , __LINE__)]
67
68 #define OCMVerifyAllWithDelay(mock, delay) [mock verifyWithDelay:delay atLocatio n:OCMMakeLocation(self, __FILE__, __LINE__)]
69
70 #define OCMVerify(invocation) \
71 ({ \
72 _OCMSilenceWarnings( \
73 [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__ , __LINE__)]; \
74 invocation; \
75 [OCMMacroState endVerifyMacro]; \
76 ); \
77 })
78
79 #define _OCMSilenceWarnings(macro) \
80 ({ \
81 _Pragma("clang diagnostic push") \
82 _Pragma("clang diagnostic ignored \"-Wunused-value\"") \
83 _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \
84 macro \
85 _Pragma("clang diagnostic pop") \
86 })
OLDNEW
« no previous file with comments | « third_party/ocmock/OCMock/OCMVerifier.m ('k') | third_party/ocmock/OCMock/OCMock-Info.plist » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698