aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMSignalHandlerTest.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-06-04 15:35:57 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-06-04 15:35:57 +0000
commit6c2f14bc180418cfad42582be6ef1cc6a5413368 (patch)
tree3b2b46d62d4889ba0e57f0fcbbc27e400ab5a22a /Foundation/GTMSignalHandlerTest.m
parent8ceff783b1fd62b67c7a6301228af9f7266e183b (diff)
[Author: dmaclach]
Turns on the undeclared-selector warning. This may cause builds to fail if they are using our configs. Also cleaned up some whitespace issues. R=thomasvl DELTA=94 (71 added, 22 deleted, 1 changed)
Diffstat (limited to 'Foundation/GTMSignalHandlerTest.m')
-rw-r--r--Foundation/GTMSignalHandlerTest.m23
1 files changed, 13 insertions, 10 deletions
diff --git a/Foundation/GTMSignalHandlerTest.m b/Foundation/GTMSignalHandlerTest.m
index 191d67f..f284860 100644
--- a/Foundation/GTMSignalHandlerTest.m
+++ b/Foundation/GTMSignalHandlerTest.m
@@ -6,9 +6,9 @@
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
-//
+//
// http://www.apache.org/licenses/LICENSE-2.0
-//
+//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -65,6 +65,9 @@
@end
@implementation GTMSignalHandlerTest
+- (void)nomnomnom:(int)blah {
+ STFail(@"Should never be called!");
+}
- (void)testNillage {
GTMSignalHandler *handler;
@@ -76,7 +79,7 @@
STAssertNil(handler, nil);
// Zero signal should return nil as well.
- handler = [[[GTMSignalHandler alloc]
+ handler = [[[GTMSignalHandler alloc]
initWithSignal:0
target:self
action:@selector(nomnomnom:)] autorelease];
@@ -87,7 +90,7 @@
- (void)testSingleHandler {
SignalCounter *counter = [SignalCounter signalCounter];
STAssertNotNil(counter, nil);
-
+
GTMSignalHandler *handler = [[[GTMSignalHandler alloc]
initWithSignal:SIGWINCH
target:counter
@@ -95,31 +98,31 @@
autorelease];
STAssertNotNil(handler, nil);
raise(SIGWINCH);
-
+
NSRunLoop *rl = [NSRunLoop currentRunLoop];
[rl gtm_runUpToSixtySecondsWithContext:counter];
STAssertEquals([counter count], 1, nil);
STAssertEquals([counter lastSeen], SIGWINCH, nil);
[counter resetShouldStop];
-
+
raise(SIGWINCH);
[rl gtm_runUpToSixtySecondsWithContext:counter];
STAssertEquals([counter count], 2, nil);
STAssertEquals([counter lastSeen], SIGWINCH, nil);
[counter resetShouldStop];
-
+
// create a second one to make sure we're seding data where we want
SignalCounter *counter2 = [SignalCounter signalCounter];
STAssertNotNil(counter2, nil);
[[[GTMSignalHandler alloc] initWithSignal:SIGUSR1
target:counter2
action:@selector(countSignal:)] autorelease];
-
+
raise(SIGUSR1);
[rl gtm_runUpToSixtySecondsWithContext:counter2];
-
+
STAssertEquals([counter count], 2, nil);
STAssertEquals([counter lastSeen], SIGWINCH, nil);
STAssertEquals([counter2 count], 1, nil);
@@ -131,7 +134,7 @@
// the handler method should not get called.
raise(SIGWINCH);
[rl runUntilDate:[NSDate dateWithTimeIntervalSinceNow:.2]];
-
+
STAssertEquals([counter count], 2, nil);
STAssertEquals([counter lastSeen], SIGWINCH, nil);
STAssertEquals([counter2 count], 1, nil);