blob: 53a6b5257a770187d3b5b1d06a1df79b99779093 [file] [log] [blame]
Ted Kremenek8382cf52009-11-13 18:46:29 +00001// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
2// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
3// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
4// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
Ted Kremenek868210e2009-04-21 23:53:32 +00005
6//===----------------------------------------------------------------------===//
7// Delta-debugging produced forward declarations.
8//===----------------------------------------------------------------------===//
9
10typedef signed char BOOL;
11typedef struct _NSZone NSZone;
12@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
13@protocol NSObject - (BOOL)isEqual:(id)object;
14@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone;
15@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone;
16@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
17@end @interface NSObject <NSObject> {
18}
19@end extern id <NSObject> NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone);
20@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding> - (unsigned)count;
21@end @class NSTimer, NSPort, NSArray;
22@class NSURLHandle, NSMutableArray, NSMutableData, NSData, NSURL;
23@interface NSResponder : NSObject <NSCoding> {
24}
25@end @class NSBitmapImageRep, NSCursor, NSGraphicsContext, NSImage, NSPasteboard, NSScrollView, NSWindow, NSAttributedString;
26@interface NSView : NSResponder {
27 struct __VFlags2 {
28 }
29 _vFlags2;
30}
31@end @class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
32@interface NSBox : NSView {
33}
34@end @class GDataFeedDocList, GDataServiceTicket, GDataServiceTicket, IHGoogleDocsAdapter;
35@protocol IHGoogleDocsAdapterDelegate - (void)googleDocsAdapter:(IHGoogleDocsAdapter*)inGoogleDocsAdapter accountVerifyIsValid:(BOOL)inIsValid error:(NSError *)inError;
36@end @interface IHGoogleDocsAdapter : NSObject {
37}
38- (NSArray *)entries;
39@end extern Class const kGDataUseRegisteredClass ;
40@interface IHGoogleDocsAdapter () - (GDataFeedDocList *)feedDocList;
41- (NSArray *)directoryPathComponents;
42- (unsigned int)currentPathComponentIndex;
43- (void)setCurrentPathComponentIndex:(unsigned int)aCurrentPathComponentIndex;
44- (NSURL *)folderFeedURL;
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000045@end
46
47@implementation IHGoogleDocsAdapter - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject <IHGoogleDocsAdapterDelegate> *)owner { // expected-warning {{incomplete implementation}} \
48// expected-warning {{method definition for 'entries' not found}} \
49// expected-warning {{method definition for 'feedDocList' not found}} \
50// expected-warning {{method definition for 'directoryPathComponents' not found}} \
51// expected-warning {{method definition for 'currentPathComponentIndex' not found}} \
52// expected-warning {{method definition for 'setCurrentPathComponentIndex:' not found}} \
53// expected-warning {{method definition for 'folderFeedURL' not found}}
Mike Stump3a3c6242009-07-21 18:58:50 +000054 return 0;
Ted Kremenek868210e2009-04-21 23:53:32 +000055}
56
57//===----------------------------------------------------------------------===//
58// Actual test case:
59//
60// The analyzer currently doesn't reason about ObjCKVCRefExpr. Have both
61// GRExprEngine::Visit and GRExprEngine::VisitLValue have such expressions
62// evaluate to UnknownVal.
63//===----------------------------------------------------------------------===//
64
65- (void)docListListFetchTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedDocList *)feed {
66 BOOL doGetDir = self.directoryPathComponents != 0 && self.currentPathComponentIndex < [self.directoryPathComponents count];
67 if (doGetDir) {
68 BOOL isDirExisting = [[self.feedDocList entries] count] > 0;
69 if (isDirExisting) {
70 if (self.folderFeedURL != 0) {
71 if (++self.currentPathComponentIndex == [self.directoryPathComponents count]) {
72 }
73 }
74 }
75 }
76}
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000077@end