|
OLD | NEW |
---|---|
(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 #include "testing/gtest/include/gtest/gtest.h" | |
10 #import "third_party/ocmock/OCMock/OCMock.h" | |
11 | |
12 // When C++ exceptions are disabled, the C++ library defines |try| and | |
13 // |catch| so as to allow exception-expecting C++ code to build properly when | |
14 // language support for exceptions is not present. These macros interfere | |
15 // with the use of |@try| and |@catch| in Objective-C files such as this one. | |
16 // Undefine these macros here, after everything has been #included, since | |
17 // there will be no C++ uses and only Objective-C uses from this point on. | |
18 #undef try | |
19 #undef catch | |
20 | |
21 namespace testing { | |
22 namespace mac { | |
23 | |
24 bool VerifyOCMock(OCMockObject* mock) { | |
25 bool result = true; | |
26 @try { | |
27 [mock verify]; | |
28 } | |
29 @catch (NSException* e) { | |
Mark Mentovai
2011/05/16 22:16:38
I read @try/@catch as part of the same construct,
TVL
2011/05/17 14:57:16
Done.
| |
30 result = false; | |
31 ADD_FAILURE() << "Error validating OCMock: " | |
Mark Mentovai
2011/05/16 22:16:38
Reword? It’s not really validating OCMock, it’s va
TVL
2011/05/17 14:57:16
I'm not liking this choice better, do you have a s
Robert Sesek
2011/05/17 15:01:15
This also struck me as a bit off, but I didn't lea
| |
32 << [[e description] UTF8String]; | |
Mark Mentovai
2011/05/16 22:16:38
Line the << up with the << above.
TVL
2011/05/17 14:57:16
Done.
| |
33 } | |
34 return result; | |
35 } | |
36 | |
37 } // namespace mac | |
38 } // namespace testing | |
OLD | NEW |