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

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 #include "testing/gtest/include/gtest/gtest.h"
9
10 @class OCMockObject;
11
12 namespace testing {
13 namespace internal {
14 bool VerifyOCMock(OCMockObject* mock, const char* file, int line);
15 } // namespace mac
Mark Mentovai 2011/05/17 21:13:59 You didn’t change this to “// namespace internal”.
16 } // namespace testing
17
18 // Calls -verify of the mock and traps the Objective-C exception that is
19 // generated, adding it to the gtest failures and returning true/false
20 // for if there was an exception. The result should be used in normal
21 // gtest EXECPT_TRUE/ASSERT_TRUE fashion.
22 //
23 // So code that would do:
24 //
25 // id mockFoo = [OCMockObject mockForClass:[Foo class]];
26 // ...
27 // [mockFoo verify];
28 //
29 // Should instead do:
30 //
31 // id mockFoo = [OCMockObject mockForClass:[Foo class]];
32 // ...
33 // EXPECT_OCMOCK_VERIFY(mockFoo);
34 //
35 #define EXPECT_OCMOCK_VERIFY(m) \
36 EXPECT_TRUE(testing::internal::VerifyOCMock((m), __FILE__, __LINE__))
37 #define ASSERT_OCMOCK_VERIFY(m) \
38 ASSERT_TRUE(testing::internal::VerifyOCMock((m), __FILE__, __LINE__))
39
40 #endif // THIRD_PARTY_OCMOCK_GTEST_SUPPORT_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/wrench_menu/menu_tracked_root_view_unittest.mm ('k') | third_party/ocmock/gtest_support.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698