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

Unified Diff: ios/testing/ocmock_complex_type_helper_unittest.mm

Issue 2891863002: [ObjC ARC] Converts ios/testing:ocmock_support_unittest to ARC. (Closed)
Patch Set: Fix auto arc script errors Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/testing/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/testing/ocmock_complex_type_helper_unittest.mm
diff --git a/ios/testing/ocmock_complex_type_helper_unittest.mm b/ios/testing/ocmock_complex_type_helper_unittest.mm
index 709c7b978647c41a5228960c026dfd14f7226f1e..ab859ca8f973492dbfc9b494db80699474b31b85 100644
--- a/ios/testing/ocmock_complex_type_helper_unittest.mm
+++ b/ios/testing/ocmock_complex_type_helper_unittest.mm
@@ -5,11 +5,14 @@
#import "ios/testing/ocmock_complex_type_helper.h"
#include "base/logging.h"
-#import "base/mac/scoped_nsobject.h"
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
#include "third_party/ocmock/gtest_support.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
// A complex type to test with..
struct SampleComplexType {
int number;
@@ -49,9 +52,9 @@ - (void)passScalar:(ScalarType)foo {
protected:
void SetUp() override {
PlatformTest::SetUp();
- helped_mock_.reset([[MockClass alloc]
- initWithRepresentedObject:
- [OCMockObject mockForProtocol:@protocol(TestedProtocol)]]);
+ OCMockObject* protocol_mock =
liaoyuke 2017/06/14 00:12:45 this temporary variable helps with formatting.
+ [OCMockObject mockForProtocol:@protocol(TestedProtocol)];
+ helped_mock_ = [[MockClass alloc] initWithRepresentedObject:protocol_mock];
}
void TearDown() override {
@@ -59,7 +62,7 @@ void TearDown() override {
PlatformTest::TearDown();
}
- base::scoped_nsobject<id> helped_mock_;
+ id helped_mock_;
};
TEST_F(OCMockComplexTypeHelperTest, nilObjectStillWorks) {
@@ -68,7 +71,7 @@ void TearDown() override {
}
TEST_F(OCMockComplexTypeHelperTest, anyObjectStillWorks) {
- base::scoped_nsobject<id> someObject([[NSObject alloc] init]);
+ id someObject = [[NSObject alloc] init];
[[helped_mock_ expect] passObject:OCMOCK_ANY];
[helped_mock_ passObject:someObject];
}
« no previous file with comments | « ios/testing/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698