aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMStackTraceTest.m
diff options
context:
space:
mode:
authorGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-03-09 21:01:39 +0000
committerGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-03-09 21:01:39 +0000
commita5ada143459a5858341030c33180b36f7542e4d1 (patch)
tree40e57a6084630ec038a1968b9d98ace102239ab2 /Foundation/GTMStackTraceTest.m
parente1bcf5d6a4b813a63d42e6ccb37ca8054775d65b (diff)
Remove some NF comments on code that was being hit.
Added a stack trace test to make sure all code paths are covered.
Diffstat (limited to 'Foundation/GTMStackTraceTest.m')
-rw-r--r--Foundation/GTMStackTraceTest.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/Foundation/GTMStackTraceTest.m b/Foundation/GTMStackTraceTest.m
index 457f3e9..f1c1247 100644
--- a/Foundation/GTMStackTraceTest.m
+++ b/Foundation/GTMStackTraceTest.m
@@ -45,6 +45,30 @@
stacktrace);
}
+-(void)testGetStackAddressDescriptors {
+ struct GTMAddressDescriptor descs[100];
+ size_t depth = sizeof(descs) / sizeof(struct GTMAddressDescriptor);
+ depth = GTMGetStackAddressDescriptors(descs, depth);
+ // Got atleast 4...
+ STAssertGreaterThan(depth, (size_t)4, nil);
+ // All that we got have symbols
+ for (NSUInteger lp = 0 ; lp < depth ; ++lp) {
+ STAssertNotNULL(descs[lp].symbol, @"didn't get a symble at depth %lu", lp);
+ }
+
+ // Do it again, but don't give it enough space (to make sure it handles that)
+ size_t fullDepth = depth;
+ STAssertGreaterThan(fullDepth, (size_t)4, nil);
+ depth -= 2;
+ depth = GTMGetStackAddressDescriptors(descs, depth);
+ STAssertLessThan(depth, fullDepth, nil);
+ // All that we got have symbols
+ for (NSUInteger lp = 0 ; lp < depth ; ++lp) {
+ STAssertNotNULL(descs[lp].symbol, @"didn't get a symble at depth %lu", lp);
+ }
+
+}
+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
- (void)helperThatThrows {