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

Side by Side Diff: third_party/ocmock/gtest_support.mm

Issue 7031014: Support for better integration between OCMock and gtest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "third_party/ocmock/gtest_support.h"
6
7 #import <Foundation/Foundation.h>
8
9 #import "third_party/ocmock/OCMock/OCMock.h"
10
11 // When C++ exceptions are disabled, the C++ library defines |try| and
12 // |catch| so as to allow exception-expecting C++ code to build properly when
13 // language support for exceptions is not present. These macros interfere
14 // with the use of |@try| and |@catch| in Objective-C files such as this one.
15 // Undefine these macros here, after everything has been #included, since
16 // there will be no C++ uses and only Objective-C uses from this point on.
17 #undef try
18 #undef catch
19
20 namespace testing {
21 namespace internal {
22
23 bool VerifyOCMockFileLine(OCMockObject* mock, const char* file, int line) {
Mark Mentovai 2011/05/17 19:41:10 You can just call this VerifyOCMockFile since you’
24 bool result = true;
25 @try {
26 [mock verify];
27 } @catch (NSException* e) {
28 result = false;
29 ADD_FAILURE_AT(file, line) << "OCMock validation failed: "
30 << [[e description] UTF8String];
31 }
32 return result;
33 }
34
35 } // namespace internal
36 } // namespace testing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698