Differences From Artifact [8b8cedb1c1]:
- File
tests/OFSerializationTests.m
— part of check-in
[44f45c2e35]
at
2017-01-09 17:36:36
on branch trunk
— Update copyright
Forgot to add 2017, even though I already did quite some changes in
2017. (user: js, size: 2475) [annotate] [blame] [check-ins using]
To Artifact [5254a89663]:
- File tests/OFSerializationTests.m — part of check-in [c8f7b90082] at 2017-07-22 20:50:27 on branch trunk — Split OFDataArray into OFData and OFMutableData (user: js, size: 2461) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
22 23 24 25 26 27 28 | #import "OFDictionary.h" #import "OFSet.h" #import "OFCountedSet.h" #import "OFList.h" #import "OFNumber.h" #import "OFDate.h" #import "OFURL.h" | | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #import "OFDictionary.h" #import "OFSet.h" #import "OFCountedSet.h" #import "OFList.h" #import "OFNumber.h" #import "OFDate.h" #import "OFURL.h" #import "OFData.h" #import "OFAutoreleasePool.h" #import "OFXMLElement.h" #import "TestsAppDelegate.h" static OFString *module = @"OFSerialization"; @implementation TestsAppDelegate (OFSerializationTests) - (void)serializationTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFMutableDictionary *d = [OFMutableDictionary dictionary]; OFMutableArray *a = [OFMutableArray array]; OFList *l = [OFList list]; OFData *data; OFString *s; [a addObject: @"Qu\"xbar\ntest"]; [a addObject: [OFNumber numberWithInt: 1234]]; [a addObject: [OFNumber numberWithDouble: 1234.5678]]; [a addObject: [OFMutableString stringWithString: @"asd"]]; [a addObject: [OFDate dateWithTimeIntervalSince1970: 1234.5678]]; |
︙ | ︙ | |||
63 64 65 66 67 68 69 | [l appendObject: [OFSet setWithObjects: @"foo", @"foo", @"bar", nil]]; [l appendObject: [OFCountedSet setWithObjects: @"foo", @"foo", @"bar", nil]]; [d setObject: @"list" forKey: l]; | | | | | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | [l appendObject: [OFSet setWithObjects: @"foo", @"foo", @"bar", nil]]; [l appendObject: [OFCountedSet setWithObjects: @"foo", @"foo", @"bar", nil]]; [d setObject: @"list" forKey: l]; data = [OFData dataWithItems: "0123456789:;<ABCDEFGHJIKLMNOPQRSTUVWXYZ" count: 39]; [d setObject: @"data" forKey: data]; TEST(@"-[stringBySerializing]", (s = [d stringBySerializing]) && [s isEqual: [OFString stringWithContentsOfFile: @"serialization.xml"]]) TEST(@"-[objectByDeserializing]", [[s objectByDeserializing] isEqual: d]) [pool drain]; } @end |