| 1 |
/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */ |
| 2 |
|
| 3 |
#include <stdlib.h> |
| 4 |
#include <objc/Protocol.h> |
| 5 |
#include "../../objc-obj-c++-shared/runtime.h" |
| 6 |
|
| 7 |
/* Test defining a protocol, and accessing it using @protocol */ |
| 8 |
|
| 9 |
@protocol Evaluating |
| 10 |
- (int) importance; |
| 11 |
@end |
| 12 |
|
| 13 |
/* Without a class adopting the protocol - this doesn't work |
| 14 |
with gcc-2.95.2 as well */ |
| 15 |
|
| 16 |
int main (void) |
| 17 |
{ |
| 18 |
Protocol *protocol = @protocol (Evaluating); |
| 19 |
|
| 20 |
if (strcmp (protocol_getName(protocol), "Evaluating")) |
| 21 |
{ |
| 22 |
abort (); |
| 23 |
} |
| 24 |
|
| 25 |
return 0; |
| 26 |
} |
| 27 |
|