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

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

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 #ifndef THIRD_PARTY_OCMOCK_GTEST_SUPPORT_H_
6 #define THIRD_PARTY_OCMOCK_GTEST_SUPPORT_H_
7
8 @class OCMockObject;
9
10 namespace testing {
11 namespace mac {
12
13 // Calls -verify of the mock and traps the Objective-C exception that is
14 // generated, adding it to the gtest failures and returning true/false
15 // for if there was an exception. The result should be used in normal
16 // gtest EXECPT_TRUE/ASSERT_TRUE fashion.
17 //
18 // So code that would do:
19 //
20 // id mockFoo = [OCMockObject mockForClass:[Foo class]];
21 // ...
22 // [mockFoo verify];
23 //
24 // Should instead do:
25 //
26 // id mockFoo = [OCMockObject mockForClass:[Foo class]];
27 // ...
28 // EXPECT_TRUE(testing::mac::VerifyOCMock(mockFoo));
29 //
30 bool VerifyOCMock(OCMockObject* mock);
31
32 } // namespace mac
33 } // namespace testing
34
35 // Helper macros that looks a little more like gtest macros.
Mark Mentovai 2011/05/17 15:10:16 looks -> look
TVL 2011/05/17 19:19:38 Done.
36 #define EXPECT_OCMOCK_VERIFY(m) EXPECT_TRUE(testing::mac::VerifyOCMock(m))
37 #define ASSERT_OCMOCK_VERIFY(m) ASSERT_TRUE(testing::mac::VerifyOCMock(m))
38
39 #endif // THIRD_PARTY_OCMOCK_GTEST_SUPPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698