forked from Polidea/ios-class-guard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestFatFile_armv7_v7s.m
76 lines (59 loc) · 1.9 KB
/
TestFatFile_armv7_v7s.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// -*- mode: ObjC -*-
// This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files.
// Copyright (C) 1997-1998, 2000-2001, 2004-2014 Steve Nygard.
#import <XCTest/XCTest.h>
#import "CDFatArch.h"
#import "CDFatFile.h"
#import "CDMachOFile.h"
@interface TestFatFile_armv7_v7s : XCTestCase
@end
@implementation TestFatFile_armv7_v7s
{
CDFatFile *_fatFile;
CDFatArch *_arch_v7;
CDFatArch *_arch_v7s;
CDMachOFile *_macho_v7;
CDMachOFile *_macho_v7s;
}
- (void)setUp;
{
[super setUp];
// Set-up code here.
_fatFile = [[CDFatFile alloc] init];
_macho_v7 = [[CDMachOFile alloc] init];
_macho_v7.cputype = CPU_TYPE_ARM;
_macho_v7.cpusubtype = CPU_SUBTYPE_ARM_V7;
_arch_v7 = [[CDFatArch alloc] initWithMachOFile:_macho_v7];
[_fatFile addArchitecture:_arch_v7];
_macho_v7s = [[CDMachOFile alloc] init];
_macho_v7s.cputype = CPU_TYPE_ARM;
_macho_v7s.cpusubtype = 11;
_arch_v7s = [[CDFatArch alloc] initWithMachOFile:_macho_v7s];
[_fatFile addArchitecture:_arch_v7s];
}
- (void)tearDown;
{
// Tear-down code here.
_fatFile = nil;
_arch_v7 = nil;
_arch_v7s = nil;
_macho_v7 = nil;
_macho_v7s = nil;
[super tearDown];
}
#pragma mark -
- (void)test_machOFileWithArch_armv7;
{
CDArch arch = { CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7 };
CDMachOFile *machOFile = [_fatFile machOFileWithArch:arch];
XCTAssertNotNil(machOFile, @"The Mach-O file shouldn't be nil", NULL);
XCTAssertEqual(machOFile, _macho_v7, @"Didn't find correct Mach-O file");
}
- (void)test_machOFileWithArch_armv7s;
{
CDArch arch = { CPU_TYPE_ARM, 11 };
CDMachOFile *machOFile = [_fatFile machOFileWithArch:arch];
XCTAssertNotNil(machOFile, @"The Mach-O file shouldn't be nil");
XCTAssertEqual(machOFile, _macho_v7s, @"Didn't find correct Mach-O file");
}
@end