Differences From Artifact [c0ded8afa9]:
- File
tests/OFSerializationTests.m
— part of check-in
[14f1e22d79]
at
2021-05-08 23:22:59
on branch trunk
— tests: Align more with ObjFW style
ObjFW's style changed over the years, but the tests were never adjusted
to it. (user: js, size: 2186) [annotate] [blame] [check-ins using] [more...]
To Artifact [1a4c0ebd86]:
- File tests/OFSerializationTests.m — part of check-in [fe84b53fd3] at 2021-10-23 12:28:13 on branch trunk — OFUUID: Add serialization support (user: js, size: 2326) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | { void *pool = objc_autoreleasePoolPush(); OFMutableDictionary *dict = [OFMutableDictionary dictionary]; OFMutableArray *array = [OFMutableArray array]; OFList *list = [OFList list]; OFData *data; OFString *string; [array addObject: @"Qu\"xbar\ntest"]; [array addObject: [OFNumber numberWithInt: 1234]]; [array addObject: [OFNumber numberWithDouble: 1234.5678]]; [array addObject: [OFMutableString stringWithString: @"asd"]]; [array addObject: [OFDate dateWithTimeIntervalSince1970: 1234.5678]]; | > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | { void *pool = objc_autoreleasePoolPush(); OFMutableDictionary *dict = [OFMutableDictionary dictionary]; OFMutableArray *array = [OFMutableArray array]; OFList *list = [OFList list]; OFData *data; OFString *string; OFUUID *UUID; [array addObject: @"Qu\"xbar\ntest"]; [array addObject: [OFNumber numberWithInt: 1234]]; [array addObject: [OFNumber numberWithDouble: 1234.5678]]; [array addObject: [OFMutableString stringWithString: @"asd"]]; [array addObject: [OFDate dateWithTimeIntervalSince1970: 1234.5678]]; |
︙ | ︙ | |||
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | [dict setObject: @"list" forKey: list]; data = [OFData dataWithItems: "0123456789:;<ABCDEFGHJIKLMNOPQRSTUVWXYZ" count: 39]; [dict setObject: @"data" forKey: data]; TEST(@"-[stringBySerializing]", (string = dict.stringBySerializing) && [string isEqual: [OFString stringWithContentsOfFile: @"serialization.xml"]]) TEST(@"-[objectByDeserializing]", [string.objectByDeserializing isEqual: dict]) objc_autoreleasePoolPop(pool); } @end | > > > > | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | [dict setObject: @"list" forKey: list]; data = [OFData dataWithItems: "0123456789:;<ABCDEFGHJIKLMNOPQRSTUVWXYZ" count: 39]; [dict setObject: @"data" forKey: data]; UUID = [OFUUID UUIDWithUUIDString: @"01234567-89AB-CDEF-FEDC-BA9876543210"]; [dict setObject: @"uuid" forKey: UUID]; TEST(@"-[stringBySerializing]", (string = dict.stringBySerializing) && [string isEqual: [OFString stringWithContentsOfFile: @"serialization.xml"]]) TEST(@"-[objectByDeserializing]", [string.objectByDeserializing isEqual: dict]) objc_autoreleasePoolPop(pool); } @end |