From 43982f07ba6a0a9839e32e774855c9d2068e9d5e Mon Sep 17 00:00:00 2001 From: "thomasvl@gmail.com" Date: Tue, 29 Jul 2008 15:07:07 +0000 Subject: fix a bug w/ method check support. mark part of the logger+asl code as not feasible for testing. work around a unittesting marco catch w/ gc and __weak. --- DebugUtils/GTMMethodCheck.h | 2 +- DebugUtils/GTMMethodCheck.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'DebugUtils') diff --git a/DebugUtils/GTMMethodCheck.h b/DebugUtils/GTMMethodCheck.h index 7a6fe9f..7b0919b 100644 --- a/DebugUtils/GTMMethodCheck.h +++ b/DebugUtils/GTMMethodCheck.h @@ -70,7 +70,7 @@ __attribute__ ((constructor, visibility("hidden"))) void GTMMethodCheckMethodChe // look for GTMMethodCheckMethodChecker to enforce linkage of // GTMMethodCheck.m. #define GTM_METHOD_CHECK_INNER_INNER(class, method, line) \ -+ (void)xxGMMethodCheckMethod ## class ## line { \ ++ (void)xxGTMMethodCheckMethod ## class ## line { \ void (*addr)() = GTMMethodCheckMethodChecker; \ if (addr && ![class instancesRespondToSelector:@selector(method)] \ && ![class respondsToSelector:@selector(method)]) { \ diff --git a/DebugUtils/GTMMethodCheck.m b/DebugUtils/GTMMethodCheck.m index 300022b..ef3ee4a 100644 --- a/DebugUtils/GTMMethodCheck.m +++ b/DebugUtils/GTMMethodCheck.m @@ -86,7 +86,7 @@ void GTMMethodCheckMethodChecker(void) { _GTMDevAssert(classes, @"Unable to allocate memory for classes"); newNumClasses = objc_getClassList(classes, numClasses); } - for (i = 0; i < numClasses; ++i) { + for (i = 0; i < numClasses && classes; ++i) { Class cls = classes[i]; // Since we are directly calling objc_msgSend, we need to conform to -- cgit v1.2.3