Skip to content

Commit bce065e

Browse files
committed
Fix test attempt
1 parent 596eb8e commit bce065e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use-arc.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ @implementation SomeObj {
4545
SomeObj *_other;
4646
}
4747

48+
+ (SomeObj *)sharedInstance {
49+
return nil;
50+
}
51+
4852
- (instancetype)_init {
4953
self = [super init];
5054
_number = nil;
@@ -61,6 +65,10 @@ - (SomeObj *)mutableCopy {
6165
return copy;
6266
}
6367

68+
- (BOOL)isEqual:(SomeObj *)other {
69+
return self.value == other.value && self.next == other.next && _other == other.other;
70+
}
71+
6472
- (SomeObj *)copyWithValue:(int)value {
6573
auto *copy = [[SomeObj alloc] init];
6674
[copy setValue:_number];

clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ - (SomeObj *)mutableCopy {
7474
return copy;
7575
}
7676

77+
- (BOOL)isEqual:(SomeObj *)other {
78+
return self.value == other.value && self.next == other.next && _other == other.other;
79+
}
80+
7781
- (SomeObj *)copyWithValue:(int)value {
7882
auto *copy = [[SomeObj alloc] init];
7983
// expected-warning@-1{{The return value is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}

0 commit comments

Comments
 (0)