PageRenderTime 21ms CodeModel.GetById 7ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/google-toolbox-for-mac/DebugUtils/GTMMethodCheckTest.m

http://macfuse.googlecode.com/
Objective C | 54 lines | 25 code | 9 blank | 20 comment | 0 complexity | 48b8ed9a998a7193be5424ef0363b338 MD5 | raw file
 1//
 2//  GTMMethodCheckTest.m
 3//  Copyright 2006-2008 Google Inc.
 4//
 5//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 6//  use this file except in compliance with the License.  You may obtain a copy
 7//  of the License at
 8//
 9//  http://www.apache.org/licenses/LICENSE-2.0
10//
11//  Unless required by applicable law or agreed to in writing, software
12//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14//  License for the specific language governing permissions and limitations under
15//  the License.
16//
17
18#import "GTMSenTestCase.h"
19#import "GTMMethodCheck.h"
20
21static BOOL gTestCheckVar = NO;
22
23@interface GTMMethodCheckTest : GTMTestCase
24+ (void)GTMMethodCheckTestClassMethod;
25- (void)GTMMethodCheckTestMethod;
26@end
27
28@implementation GTMMethodCheckTest
29GTM_METHOD_CHECK(GTMMethodCheckTest, GTMMethodCheckTestMethod);
30GTM_METHOD_CHECK(GTMMethodCheckTest, GTMMethodCheckTestClassMethod);
31
32- (void)GTMMethodCheckTestMethod {
33}
34
35+ (void)GTMMethodCheckTestClassMethod {
36}
37
38+ (void)xxGTMMethodCheckMethodTestCheck {
39  // This gets called because of its special name by GMMethodCheck
40  // Look at the Macros in GMMethodCheck.h for details.
41  gTestCheckVar = YES;
42}
43
44- (void)testGTMMethodCheck {
45#ifdef DEBUG
46  // GTMMethodCheck only runs in debug
47  STAssertTrue(gTestCheckVar, @"Should be true");
48#endif
49
50  // Next two calls just verify our code coverage
51  [self GTMMethodCheckTestMethod];
52  [[self class] GTMMethodCheckTestClassMethod];
53}
54@end