aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-07-29 15:07:07 +0000
committerGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-07-29 15:07:07 +0000
commit43982f07ba6a0a9839e32e774855c9d2068e9d5e (patch)
tree238f1a607b086c036be1f05cc760dd332f70ecfb
parent4963c8a9d57501b5ffb0fe52fbfe60cd71b3b916 (diff)
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.
-rw-r--r--DebugUtils/GTMMethodCheck.h2
-rw-r--r--DebugUtils/GTMMethodCheck.m2
-rw-r--r--Foundation/GTMLogger+ASL.m2
-rw-r--r--Foundation/GTMLogger.h3
-rw-r--r--Foundation/GTMLoggerRingBufferWriterTest.m2
5 files changed, 5 insertions, 6 deletions
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
diff --git a/Foundation/GTMLogger+ASL.m b/Foundation/GTMLogger+ASL.m
index 1a49406..2213df6 100644
--- a/Foundation/GTMLogger+ASL.m
+++ b/Foundation/GTMLogger+ASL.m
@@ -93,8 +93,10 @@
if ((self = [super init])) {
client_ = asl_open(NULL, NULL, 0);
if (client_ == nil) {
+ // COV_NF_START - no real way to test this
[self release];
return nil;
+ // COV_NF_END
}
}
return self;
diff --git a/Foundation/GTMLogger.h b/Foundation/GTMLogger.h
index 0565462..8fdb0fa 100644
--- a/Foundation/GTMLogger.h
+++ b/Foundation/GTMLogger.h
@@ -43,9 +43,6 @@
// certain text, or filter nothing out at all. This gives the caller the
// flexibility to dynamically enable debug logging in Release builds.
//
-// A class diagram showing the relationship between these key abstractions can
-// be found at: http://www.corp.google.com/eng/designdocs/maceng/GTMLogger.png
-//
// This file also declares some classes to handle the common log writer, log
// formatter, and log filter cases. Callers can also create their own writers,
// formatters, and filters and they can even build them on top of the ones
diff --git a/Foundation/GTMLoggerRingBufferWriterTest.m b/Foundation/GTMLoggerRingBufferWriterTest.m
index 41b78e2..6e64cc0 100644
--- a/Foundation/GTMLoggerRingBufferWriterTest.m
+++ b/Foundation/GTMLoggerRingBufferWriterTest.m
@@ -117,7 +117,7 @@
[GTMLoggerRingBufferWriter ringBufferWriterWithCapacity:32
writer:countingWriter_];
STAssertEquals([writer capacity], 32, nil);
- STAssertEquals([writer writer], countingWriter_, nil);
+ STAssertTrue([writer writer] == countingWriter_, nil);
STAssertEquals([writer count], 0, nil);
STAssertEquals([writer droppedLogCount], 0, nil);
STAssertEquals([writer totalLogged], 0, nil);