3 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out
4 // RUN: FileCheck %s < %t/out
6 // Ensure that XML we generate is not invalid.
7 // RUN: FileCheck %s -check-prefix=WRONG < %t/out
8 // WRONG-NOT: CommentXMLInvalid
11 * \brief This is a protocol definition
16 * \brief MethodMyProto method
17 * \param[in] anObject input value
18 * \param[in] range output value is unsigned int
19 * \result return index
21 - (unsigned int)MethodMyProto:(nullable id)anObject inRange:(unsigned int)range;
23 * \brief PropertyMyProto - This is protocol's property.
25 @property (copy, nonnull) id PropertyMyProto;
27 * \brief ClassMethodMyProto
31 // CHECK: <Declaration>@protocol MyProto\n@end</Declaration>
32 // CHECK: <Declaration>- (unsigned int)MethodMyProto:(nullable id)anObject inRange:(unsigned int)range;</Declaration>
33 // CHECK: <Declaration>@optional\n@property(atomic, copy, readwrite, nonnull) id PropertyMyProto;</Declaration>
34 // CHECK: <Declaration>+ (id)ClassMethodMyProto;</Declaration>
37 * \brief NSObject is the root class.
46 // CHECK: Declaration>@interface NSObject {\n id IvarNSObject;\n}\n@end</Declaration>
47 // CHECK: <Declaration>id IvarNSObject</Declaration>
50 * \brief MyClass - primary class.
52 @interface MyClass : NSObject<MyProto>
55 * \brief IvarMyClass - IvarMyClass of values.
60 * \brief MethodMyClass is instance method.
65 * \brief ClassMethodMyClass is class method.
70 * \brief PropertyMyClass - This is class's property.
72 @property (copy) id PropertyMyClass;
74 // CHECK: <Declaration>@interface MyClass : NSObject <MyProto> {\n id IvarMyClass;\n}\n@end</Declaration>
75 // CHECK: <Declaration>id IvarMyClass</Declaration>
76 // CHECK: <Declaration>- (id)MethodMyClass;</Declaration>
77 // CHECK: <Declaration>+ (id)ClassMethodMyClass;</Declaration>
78 // CHECK: <Declaration>@property(atomic, copy, readwrite) id PropertyMyClass;</Declaration
81 * \brief - This is class extension of MyClass
86 * \brief IvarMyClassExtension - IvarMyClassExtension private to class extension
88 id IvarMyClassExtension;
91 // CHECK: <Declaration>@interface MyClass () {\n id IvarMyClassExtension;\n}\n@end</Declaration>
92 // CHECK: <Declaration>id IvarMyClassExtension</Declaration>
96 * \brief MyClass (Category) is private to MyClass.
98 @interface MyClass (Category)
100 * \brief This is private to MyClass
102 - (void)MethodMyClassCategory;
105 * \brief PropertyMyClassCategory - This is class's private property.
107 @property (copy) id PropertyMyClassCategory;
109 // CHECK: <Declaration>@interface MyClass (Category)\n@end</Declaration>
110 // CHECK: <Declaration>- (void)MethodMyClassCategory;</Declaration>
111 // CHECK: <Declaration>@property(atomic, copy, readwrite) id PropertyMyClassCategory;</Declaration>
112 // CHECK: <Declaration>- (id)PropertyMyClassCategory;</Declaration>
113 // CHECK: <Declaration>- (void)setPropertyMyClassCategory:(id)arg;</Declaration>
115 /// @implementation's
118 * \brief implementation of MyClass class.
120 @implementation MyClass {
122 * \brief IvarPrivateToMyClassImpl.
124 id IvarPrivateToMyClassImpl;
127 * \brief MethodMyClass is instance method implementation.
134 * \brief ClassMethodMyClass is class method implementation.
136 + ClassMethodMyClass {
140 // CHECK: <Declaration>@implementation MyClass {\n id IvarPrivateToMyClassImpl;\n id _PropertyMyClass;\n}\n@end</Declaration>
141 // CHECK: <Declaration>id IvarPrivateToMyClassImpl</Declaration>
142 // CHECK: <Declaration>- (id)MethodMyClass;</Declaration>
143 // CHECK: <Declaration>+ (id)ClassMethodMyClass;</Declaration>
146 * \brief MyClass (Category) is implementation of private to MyClass.
148 @implementation MyClass (Category)
150 * \brief This is private to MyClass
152 - (void)MethodMyClassCategory {}
154 * \brief property getter
156 - (id) PropertyMyClassCategory { return 0; }
159 * \brief property setter
161 - (void) setPropertyMyClassCategory : (id) arg {}
163 // CHECK: <Declaration>@implementation MyClass (Category)\n@end</Declaration>
164 // CHECK: <Declaration>- (void)MethodMyClassCategory;</Declaration>
165 // CHECK: <Declaration>- (id)PropertyMyClassCategory;</Declaration>
166 // CHECK: <Declaration>- (void)setPropertyMyClassCategory:(id)arg;</Declaration>
169 * \brief NSObject implementation
171 @implementation NSObject
173 // CHECK: <Declaration>@implementation NSObject\n@end</Declaration>