OLD | NEW |
(Empty) | |
| 1 // This file is part of class-dump, a utility for examining the Objective-C seg
ment of Mach-O files. |
| 2 // Copyright (C) 1997-1998, 2000-2001, 2004-2010 Steve Nygard. |
| 3 |
| 4 #import "CDPathUnitTest.h" |
| 5 |
| 6 #import <Foundation/Foundation.h> |
| 7 #import "CDClassDump.h" |
| 8 |
| 9 @implementation CDPathUnitTest |
| 10 |
| 11 - (void)setUp; |
| 12 { |
| 13 classDump = [[CDClassDump alloc] init]; |
| 14 } |
| 15 |
| 16 - (void)tearDown; |
| 17 { |
| 18 [classDump release]; |
| 19 classDump = nil; |
| 20 } |
| 21 |
| 22 - (void)testPrivateSyncFramework; |
| 23 { |
| 24 NSString *path = @"/System/Library/PrivateFrameworks/SyndicationUI.framework
"; |
| 25 NSBundle *bundle; |
| 26 |
| 27 bundle = [NSBundle bundleWithPath:path]; |
| 28 STAssertNotNil(bundle, @"%@ doesn't seem to exist, we can remove this test n
ow.", path); |
| 29 if (bundle != nil) { |
| 30 STAssertNil([bundle executablePath], @"This fails on 10.5. It's fixed i
f you see this! Executable path for %@", path); |
| 31 //STAssertNotNil([bundle executablePath], @"This fails on 10.5. Executa
ble path for %@", path); |
| 32 } |
| 33 } |
| 34 |
| 35 - (void)testBundlePathWithoutTrailingSlash; |
| 36 { |
| 37 BOOL result; |
| 38 |
| 39 result = [classDump processFilename:@"/System/Library/Frameworks/AppKit.fram
ework"]; |
| 40 STAssertEquals(YES, result, @"Couldn't process AppKit.framework"); |
| 41 STAssertEqualObjects(@"/System/Library/Frameworks/AppKit.framework/Versions/
C", [classDump executablePath], @""); |
| 42 } |
| 43 |
| 44 - (void)testBundlePathWithTrailingSlash; |
| 45 { |
| 46 BOOL result; |
| 47 |
| 48 result = [classDump processFilename:@"/System/Library/Frameworks/AppKit.fram
ework/"]; |
| 49 STAssertEquals(YES, result, @"Couldn't process AppKit.framework"); |
| 50 STAssertEqualObjects(@"/System/Library/Frameworks/AppKit.framework/Versions/
C", [classDump executablePath], @""); |
| 51 } |
| 52 |
| 53 - (void)testExecutableSymlinkPath; |
| 54 { |
| 55 BOOL result; |
| 56 |
| 57 result = [classDump processFilename:@"/System/Library/Frameworks/AppKit.fram
ework/AppKit"]; |
| 58 STAssertEquals(YES, result, @"Couldn't process AppKit.framework"); |
| 59 STAssertEqualObjects(@"/System/Library/Frameworks/AppKit.framework/Versions/
C", [classDump executablePath], @""); |
| 60 } |
| 61 |
| 62 - (void)testExecutableFullPath; |
| 63 { |
| 64 BOOL result; |
| 65 |
| 66 result = [classDump processFilename:@"/System/Library/Frameworks/AppKit.fram
ework/Versions/C/AppKit"]; |
| 67 STAssertEquals(YES, result, @"Couldn't process AppKit.framework"); |
| 68 STAssertEqualObjects(@"/System/Library/Frameworks/AppKit.framework/Versions/
C", [classDump executablePath], @""); |
| 69 } |
| 70 |
| 71 @end |
OLD | NEW |