Differences From Artifact [a5da935c08]:
- File tests/OFDataArray/OFDataArray.m — part of check-in [9c435fddfc] at 2009-05-18 19:38:27 on branch trunk — Add test for OFArray. (user: js, size: 4178) [annotate] [blame] [check-ins using]
To Artifact [6aad159bdb]:
- File
tests/OFDataArray/OFDataArray.m
— part of check-in
[a29d403286]
at
2009-05-23 16:50:44
on branch trunk
— A few renames in OFArray, OFDataArray and OFDictionary.
OFArray:
* Rename - object: to - objectAtIndex:.OFDataArray:
* Rename - item: to - itemAtIndex:.OFDictionary:
* Rename - get: to - objectForKey:.
* Rename - set:to: to - setObject:forKey:.
* Rename - remove: to - removeObjectForKey:. (user: js, size: 4255) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
66 67 68 69 70 71 72 | [a freeMem: q]; \ \ puts("Adding multiple items at once..."); \ p = [a allocWithSize: 8192]; \ memset(p, 64, 8192); \ [a addNItems: 2 \ fromCArray: p]; \ | | | | > | > > | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | [a freeMem: q]; \ \ puts("Adding multiple items at once..."); \ p = [a allocWithSize: 8192]; \ memset(p, 64, 8192); \ [a addNItems: 2 \ fromCArray: p]; \ if (!memcmp([a last], [a itemAtIndex: [a count] - 2], 4096) && \ !memcmp([a itemAtIndex: [a count] - 2], p, 4096)) \ puts("[a last], [a itemAtIndex: [a count] - 2] and p " \ "match!"); \ else { \ puts("[a last], [a itemAtIndex: [a count] - 2] and p " \ "do not match!"); \ abort(); \ } \ [a freeMem: p]; \ \ i = [a count]; \ puts("Removing 2 items..."); \ [a removeNItems: 2]; \ if ([a count] + 2 != i) { \ puts("[a count] + 2 != i!"); \ abort(); \ } \ \ puts("Trying to remove more data than we added..."); \ CATCH_EXCEPTION([a removeNItems: [a count] + 1], \ OFOutOfRangeException); \ \ puts("Trying to access an index that does not exist..."); \ CATCH_EXCEPTION([a itemAtIndex: [a count]], \ OFOutOfRangeException); \ \ [a release]; \ \ puts("Creating new array and using it to build a string..."); \ a = [[type alloc] initWithItemSize: 1]; \ \ for (i = 0; i < strlen(str); i++) \ |
︙ | ︙ |