Overview
Comment: | More exception testing stuff for OFObject. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8b2f3fab960cee16477f9b69e7563b42 |
User & Date: | js on 2008-09-14 19:35:50 |
Other Links: | manifest | tags |
Context
2008-09-14
| ||
19:38 | %zd -> %zu. check-in: 7cc77e2a1b user: js tags: trunk | |
19:35 | More exception testing stuff for OFObject. check-in: 8b2f3fab96 user: js tags: trunk | |
19:03 | More exceptions stuff. check-in: 98fe076bd8 user: js tags: trunk | |
Changes
Modified src/OFExceptions.m from [2ea46496b5] to [7125d2d9c0].
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + | return [[OFNoMemException alloc] init: obj withSize: size]; } - init: (id)obj withSize: (size_t)size { |
︙ |
Modified tests/OFObject/OFObject.m from [b4bf13ad01] to [201b5d89a5].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 11 12 13 14 15 16 17 18 19 20 21 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 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 77 78 79 80 81 82 83 84 85 | + + + + + + + + + + + + + - - - + - - - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - + - - - - - + - - - + + + | #import <stdio.h> #import <stdlib.h> #import <stdbool.h> #import "OFObject.h" #import "OFExceptions.h" #define CATCH_EXCEPTION(code, exception) \ caught = false; \ @try { \ code; \ } @catch (exception *e) { \ caught = true; \ puts("CAUGHT! Resuming..."); \ } \ if (!caught) { \ puts("NOT CAUGHT!"); \ return 1; \ } int main() { OFObject *obj = [OFObject new]; bool caught; void *p, *q, *r; /* Test freeing memory not allocated by obj */ puts("Freeing memory not allocated by object (should throw an " "exception)..."); |