]> git.saurik.com Git - apple/objc4.git/blob - test/super.m
objc4-781.tar.gz
[apple/objc4.git] / test / super.m
1 // TEST_CONFIG
2
3 #include "test.h"
4 #include "testroot.i"
5 #include <objc/objc-runtime.h>
6
7 @interface Sub : TestRoot @end
8 @implementation Sub @end
9
10 int main()
11 {
12 // [super ...] messages are tested in msgSend.m
13
14 testassert(class_getSuperclass([Sub class]) == [TestRoot class]);
15 testassert(class_getSuperclass(object_getClass([Sub class])) == object_getClass([TestRoot class]));
16 testassert(class_getSuperclass([TestRoot class]) == Nil);
17 testassert(class_getSuperclass(object_getClass([TestRoot class])) == [TestRoot class]);
18 testassert(class_getSuperclass(Nil) == Nil);
19
20 succeed(__FILE__);
21 }