Skip to content
Snippets Groups Projects
Commit 02b63b42 authored by Ted Kremenek's avatar Ted Kremenek
Browse files

Add test case illustrating special handling of 'SenTestCase' subclasses for...

Add test case illustrating special handling of 'SenTestCase' subclasses for the missing -dealloc check.

llvm-svn: 64494
parent 7f14efe6
No related branches found
No related tags found
No related merge requests found
// RUN: clang -analyze -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify // RUN: clang -analyze -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify
typedef signed char BOOL; typedef signed char BOOL;
@protocol NSObject - (BOOL)isEqual:(id)object; @end @protocol NSObject
- (BOOL)isEqual:(id)object;
- (Class)class;
@end
@interface NSObject <NSObject> {} @interface NSObject <NSObject> {}
- (void)dealloc; - (void)dealloc;
- (id)init; - (id)init;
...@@ -83,3 +87,31 @@ IBOutlet NSWindow *window; ...@@ -83,3 +87,31 @@ IBOutlet NSWindow *window;
[super dealloc]; [super dealloc];
} }
@end @end
//===------------------------------------------------------------------------===
// PR 3187: http://llvm.org/bugs/show_bug.cgi?id=3187
// - Disable the missing -dealloc check for classes that subclass SenTestCase
@class NSString;
@interface SenTestCase : NSObject {}
@end
@interface MyClassTest : SenTestCase {
NSString *resourcePath;
}
@end
@interface NSBundle : NSObject {}
+ (NSBundle *)bundleForClass:(Class)aClass;
- (NSString *)resourcePath;
@end
@implementation MyClassTest
- (void)setUp {
resourcePath = [[NSBundle bundleForClass:[self class]] resourcePath];
}
- (void)testXXX {
// do something which uses resourcepath
}
@end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment