Differences From Artifact [c4671d9ef0]:
- File tests/OFArray/OFArray.m — part of check-in [ffd26c8238] at 2009-02-27 11:17:54 on branch trunk — Add - hash for OFArray and OFString, main implementation in OFMacros. (user: js, size: 4100) [annotate] [blame] [check-ins using]
To Artifact [a61450d3be]:
- File
tests/OFArray/OFArray.m
— part of check-in
[e959fed010]
at
2009-04-26 12:44:20
on branch trunk
— A few renames in OFObject.
getMemWithSize: -> allocWithSize:
getMemForNItems:ofSize: -> allocNItems:withSize:
resizeMem:toNItems:ofSize: -> resizeMem:toNItems:withSize: (user: js, size: 4097) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
38 39 40 41 42 43 44 | puts("Trying to add too much to an array..."); \ a = [[type alloc] initWithItemSize: 4096]; \ CATCH_EXCEPTION([a addNItems: SIZE_MAX \ fromCArray: NULL], \ OFOutOfRangeException) \ \ puts("Trying to add something after that error..."); \ | | | | | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | puts("Trying to add too much to an array..."); \ a = [[type alloc] initWithItemSize: 4096]; \ CATCH_EXCEPTION([a addNItems: SIZE_MAX \ fromCArray: NULL], \ OFOutOfRangeException) \ \ puts("Trying to add something after that error..."); \ p = [a allocWithSize: 4096]; \ memset(p, 255, 4096); \ [a add: p]; \ if (!memcmp([a last], p, 4096)) \ puts("[a last] matches with p!"); \ else { \ puts("[a last] does not match p!"); \ abort(); \ } \ [a freeMem: p]; \ \ puts("Adding more data..."); \ q = [a allocWithSize: 4096]; \ memset(q, 42, 4096); \ [a add: q]; \ if (!memcmp([a last], q, 4096)) \ puts("[a last] matches with q!"); \ else { \ puts("[a last] does not match q!"); \ abort(); \ } \ [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 items] - 2], 4096) && \ !memcmp([a item: [a items] - 2], p, 4096)) \ puts("[a last], [a item: [a items] - 2] and p match!"); \ else { \ |
︙ | ︙ |