forked from Naville/class-dump-utf8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestCDArchFromName.m
75 lines (57 loc) · 2.13 KB
/
TestCDArchFromName.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
// -*- mode: ObjC -*-
// This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files.
// Copyright (C) 1997-2019 Steve Nygard.
#import <XCTest/XCTest.h>
#import "CDFile.h"
@interface TestCDArchFromName : XCTestCase
@end
@implementation TestCDArchFromName
- (void)setUp;
{
[super setUp];
// Set-up code here.
}
- (void)tearDown;
{
// Tear-down code here.
[super tearDown];
}
#pragma mark - ARM
- (void)test_armv6;
{
CDArch arch = CDArchFromName(@"armv6");
XCTAssertEqual(arch.cputype, CPU_TYPE_ARM, @"The cputype for 'armv6' should be ARM");
XCTAssertEqual(arch.cpusubtype, CPU_SUBTYPE_ARM_V6, @"The cpusubtype for 'armv6' should be ARM_V6");
}
- (void)test_armv7;
{
CDArch arch = CDArchFromName(@"armv7");
XCTAssertEqual(arch.cputype, CPU_TYPE_ARM, @"The cputype for 'armv7' should be ARM");
XCTAssertEqual(arch.cpusubtype, CPU_SUBTYPE_ARM_V7, @"The cpusubtype for 'armv7' should be ARM_V7");
}
- (void)test_armv7s;
{
CDArch arch = CDArchFromName(@"armv7s");
XCTAssertEqual(arch.cputype, CPU_TYPE_ARM, @"The cputype for 'armv7s' should be ARM");
XCTAssertEqual(arch.cpusubtype, 11, @"The cpusubtype for 'armv7s' should be 11");
}
- (void)test_arm64;
{
CDArch arch = CDArchFromName(@"arm64");
XCTAssertEqual(arch.cputype, CPU_TYPE_ARM | CPU_ARCH_ABI64, @"The cputype for 'arm64' should be ARM with 64-bit mask");
XCTAssertEqual(arch.cpusubtype, CPU_SUBTYPE_ARM_ALL, @"The cpusubtype for 'arm64' should be CPU_SUBTYPE_ARM_ALL");
}
#pragma mark - Intel x86
- (void)test_i386;
{
CDArch arch = CDArchFromName(@"i386");
XCTAssertEqual(arch.cputype, CPU_TYPE_X86, @"The cputype for 'i386' should be X86");
XCTAssertEqual(arch.cpusubtype, CPU_SUBTYPE_386, @"The cpusubtype for 'i386' should be 386");
}
- (void)test_x86_64;
{
CDArch arch = CDArchFromName(@"x86_64");
XCTAssertEqual(arch.cputype, CPU_TYPE_X86_64, @"The cputype for 'x86_64' should be X86_64");
XCTAssertEqual(arch.cpusubtype, CPU_SUBTYPE_386, @"The cpusubtype for 'x86_64' should be 386");
}
@end