Differences From Artifact [cc12013248]:
- File
tests/OFObjectTests.m
— part of check-in
[dc0c6c34ab]
at
2019-02-17 22:44:23
on branch trunk
— tests: Only import ObjFW.h
This prevents forgetting to add an import to ObjFW.h, as the tests would
then not compile. (user: js, size: 8663) [annotate] [blame] [check-ins using]
To Artifact [d457d186e1]:
- File tests/OFObjectTests.m — part of check-in [d7824704f9] at 2019-03-23 22:03:15 on branch trunk — Add -[valueForKeyPath:] / -[setValue:forKeyPath:] (user: js, size: 9251) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
246 247 248 249 250 251 252 253 254 255 | [m floatValue] == 110 && [m doubleValue] == 120) EXPECT_EXCEPTION(@"Catch -[setValue:forKey:] with nil key for scalar", OFInvalidArgumentException, [m setValue: (id _Nonnull)nil forKey: @"intValue"]) [pool drain]; } @end | > > > > > > > > > > > > > > | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | [m floatValue] == 110 && [m doubleValue] == 120) EXPECT_EXCEPTION(@"Catch -[setValue:forKey:] with nil key for scalar", OFInvalidArgumentException, [m setValue: (id _Nonnull)nil forKey: @"intValue"]) TEST(@"-[valueForKeyPath:]", (m = [[[MyObj alloc] init] autorelease]) && (m.objectValue = [[[MyObj alloc] init] autorelease]) && R([m.objectValue setObjectValue: [[[MyObj alloc] init] autorelease]]) && R([[m.objectValue objectValue] setDoubleValue: 0.5]) && [[m valueForKeyPath: @"objectValue.objectValue.doubleValue"] doubleValue] == 0.5) TEST(@"[-setValue:forKeyPath:]", R([m setValue: [OFNumber numberWithDouble: 0.75] forKeyPath: @"objectValue.objectValue.doubleValue"]) && [[[m objectValue] objectValue] doubleValue] == 0.75) [pool drain]; } @end |