#import <Foundation/Foundation.h>

@interface KVCTest : NSObject {}
- (SEL) selectorTest;
- (void) run;
@end

@implementation KVCTest
- (SEL) selectorTest {
	return NULL;
}
- (void) setSelectorTest: (SEL)x {
}
- (id) valueForUndefinedKey: (id)key {
	return @"valueForUndefinedKey: called";
}
- (void) setValue: (id)val forUndefinedKey: (id)key{
	NSLog(@"setValue:forUndefinedKey: called");
}
- (void)run {
	NSAssert([[self valueForKey: @"selectorTest"] isEqual:  @"valueForUndefinedKey: called"], @"get failed");
	[self setValue: @"x" forKey: @"selectorTest"];
	NSLog(@"Test finished.");
}
@end

int main() {
	[[NSAutoreleasePool alloc] init];
	[[[KVCTest alloc] init] run];
	return 0;
}
