@@ -137,48 +137,48 @@ o = [[[OFObject alloc] init] autorelease]; m = [[[MyObj alloc] init] autorelease]; TEST(@"-[description]", - [[o description] isEqual: @""] && - [[m description] isEqual: @""]) + [o.description isEqual: @""] && + [m.description isEqual: @""]) - [m setObjectValue: @"Hello"]; - [m setClassValue: [m class]]; + m.objectValue = @"Hello"; + m.classValue = [m class]; TEST(@"-[valueForKey:]", [[m valueForKey: @"objectValue"] isEqual: @"Hello"] && - [[m valueForKey: @"classValue"] isEqual: [m class]] && - [[m valueForKey: @"class"] isEqual: [m class]]) + [[m valueForKey: @"classValue"] isEqual: m.class] && + [[m valueForKey: @"class"] isEqual: m.class]) EXPECT_EXCEPTION(@"-[valueForKey:] with undefined key", OFUndefinedKeyException, [m valueForKey: @"undefined"]) TEST(@"-[setValue:forKey:]", R([m setValue: @"World" forKey: @"objectValue"]) && R([m setValue: [OFObject class] forKey: @"classValue"]) && - [[m objectValue] isEqual: @"World"] && - [[m classValue] isEqual: [OFObject class]]) + [m.objectValue isEqual: @"World"] && + [m.classValue isEqual: [OFObject class]]) EXPECT_EXCEPTION(@"-[setValue:forKey:] with undefined key", OFUndefinedKeyException, [m setValue: @"x" forKey: @"undefined"]) - [m setBoolValue: 1]; - [m setCharValue: 2]; - [m setShortValue: 3]; - [m setIntValue: 4]; - [m setLongValue: 5 ]; - [m setLongLongValue: 6]; - [m setUnsignedCharValue: 7]; - [m setUnsignedShortValue: 8]; - [m setUnsignedIntValue: 9]; - [m setUnsignedLongValue: 10]; - [m setUnsignedLongLongValue: 11]; - [m setFloatValue: 12]; - [m setDoubleValue: 13]; + m.boolValue = 1; + m.charValue = 2; + m.shortValue = 3; + m.intValue = 4; + m.longValue = 5; + m.longLongValue = 6; + m.unsignedCharValue = 7; + m.unsignedShortValue = 8; + m.unsignedIntValue = 9; + m.unsignedLongValue = 10; + m.unsignedLongLongValue = 11; + m.floatValue = 12; + m.doubleValue = 13; TEST(@"Auto-wrapping of -[valueForKey:]", [[m valueForKey: @"boolValue"] isEqual: [OFNumber numberWithBool: 1]] && [[m valueForKey: @"charValue"] isEqual: [OFNumber numberWithChar: 2]] && @@ -230,23 +230,16 @@ forKey: @"unsignedLongLongValue"]) && R([m setValue: [OFNumber numberWithFloat: 110] forKey: @"floatValue"]) && R([m setValue: [OFNumber numberWithDouble: 120] forKey: @"doubleValue"]) && - [m isBoolValue] == 0 && - [m charValue] == 10 && - [m shortValue] == 20 && - [m intValue] == 30 && - [m longValue] == 40 && - [m longLongValue] == 50 && - [m unsignedCharValue] == 60 && - [m unsignedShortValue] == 70 && - [m unsignedIntValue] == 80 && - [m unsignedLongValue] == 90 && - [m unsignedLongLongValue] == 100 && - [m floatValue] == 110 && - [m doubleValue] == 120) + m.isBoolValue == 0 && m.charValue == 10 && m.shortValue == 20 && + m.intValue == 30 && m.longValue == 40 && m.longLongValue == 50 && + m.unsignedCharValue == 60 && m.unsignedShortValue == 70 && + m.unsignedIntValue == 80 && m.unsignedLongValue == 90 && + m.unsignedLongLongValue == 100 && m.floatValue == 110 && + m.doubleValue == 120) EXPECT_EXCEPTION(@"Catch -[setValue:forKey:] with nil key for scalar", OFInvalidArgumentException, [m setValue: (id _Nonnull)nil forKey: @"intValue"]) @@ -260,10 +253,10 @@ doubleValue] == 0.5) TEST(@"[-setValue:forKeyPath:]", R([m setValue: [OFNumber numberWithDouble: 0.75] forKeyPath: @"objectValue.objectValue.doubleValue"]) && - [[[m objectValue] objectValue] doubleValue] == 0.75) + [[m.objectValue objectValue] doubleValue] == 0.75) [pool drain]; } @end