Differences From Artifact [63952be35a]:
- File
tests/OFDataArray/OFDataArray.m
— part of check-in
[2a4aa05a84]
at
2009-05-05 12:05:06
on branch trunk
— Rename OFArray to OFDataArray and add a new OFArray which stores objects.
Additionally, change OFAutoreleasePool to use the new OFArray.And while at it, change #import <config.h> in some files to
#import "config.h". (user: js, size: 4170) [annotate] [blame] [check-ins using]
To Artifact [9fd6b5cc0c]:
- File tests/OFDataArray/OFDataArray.m — part of check-in [64bc94cdb3] at 2009-05-05 17:59:49 on branch trunk — Rename - objects / - items in OFArray / OFDataArray to - count. (user: js, size: 4170) [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 | [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 item: [a count] - 2], 4096) && \ !memcmp([a item: [a count] - 2], p, 4096)) \ puts("[a last], [a item: [a count] - 2] and p match!"); \ else { \ puts("[a last], [a item: [a count] - 2] and p did 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 item: [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++) \ |
︙ | ︙ |