OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 25 matching lines...) Expand all Loading... |
36 // This file is responsible for testing MachOImageReader, | 36 // This file is responsible for testing MachOImageReader, |
37 // MachOImageSegmentReader, and MachOImageSymbolTableReader. | 37 // MachOImageSegmentReader, and MachOImageSymbolTableReader. |
38 | 38 |
39 namespace crashpad { | 39 namespace crashpad { |
40 namespace test { | 40 namespace test { |
41 namespace { | 41 namespace { |
42 | 42 |
43 // Native types and constants, in cases where the 32-bit and 64-bit versions | 43 // Native types and constants, in cases where the 32-bit and 64-bit versions |
44 // are different. | 44 // are different. |
45 #if defined(ARCH_CPU_64_BITS) | 45 #if defined(ARCH_CPU_64_BITS) |
46 typedef mach_header_64 MachHeader; | 46 using MachHeader = mach_header_64; |
47 const uint32_t kMachMagic = MH_MAGIC_64; | 47 const uint32_t kMachMagic = MH_MAGIC_64; |
48 typedef segment_command_64 SegmentCommand; | 48 using SegmentCommand = segment_command_64; |
49 const uint32_t kSegmentCommand = LC_SEGMENT_64; | 49 const uint32_t kSegmentCommand = LC_SEGMENT_64; |
50 typedef section_64 Section; | 50 using Section = section_64; |
51 typedef nlist_64 Nlist; | 51 using Nlist = nlist_64; |
52 #else | 52 #else |
53 typedef mach_header MachHeader; | 53 using MachHeader = mach_header; |
54 const uint32_t kMachMagic = MH_MAGIC; | 54 const uint32_t kMachMagic = MH_MAGIC; |
55 typedef segment_command SegmentCommand; | 55 using SegmentCommand = segment_command; |
56 const uint32_t kSegmentCommand = LC_SEGMENT; | 56 const uint32_t kSegmentCommand = LC_SEGMENT; |
57 typedef section Section; | 57 using Section = section; |
58 | 58 |
59 // This needs to be called “struct nlist” because “nlist” without the struct | 59 // This needs to be called “struct nlist” because “nlist” without the struct |
60 // refers to the nlist() function. | 60 // refers to the nlist() function. |
61 typedef struct nlist Nlist; | 61 using Nlist = struct nlist; |
62 #endif | 62 #endif |
63 | 63 |
64 #if defined(ARCH_CPU_X86_64) | 64 #if defined(ARCH_CPU_X86_64) |
65 const int kCPUType = CPU_TYPE_X86_64; | 65 const int kCPUType = CPU_TYPE_X86_64; |
66 #elif defined(ARCH_CPU_X86) | 66 #elif defined(ARCH_CPU_X86) |
67 const int kCPUType = CPU_TYPE_X86; | 67 const int kCPUType = CPU_TYPE_X86; |
68 #endif | 68 #endif |
69 | 69 |
70 // Verifies that |expect_section| and |actual_section| agree. | 70 // Verifies that |expect_section| and |actual_section| agree. |
71 void ExpectSection(const Section* expect_section, | 71 void ExpectSection(const Section* expect_section, |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 image_reader.UUID(&actual_uuid); | 631 image_reader.UUID(&actual_uuid); |
632 EXPECT_EQ(expected_uuid, actual_uuid); | 632 EXPECT_EQ(expected_uuid, actual_uuid); |
633 } | 633 } |
634 } | 634 } |
635 #endif | 635 #endif |
636 } | 636 } |
637 | 637 |
638 } // namespace | 638 } // namespace |
639 } // namespace test | 639 } // namespace test |
640 } // namespace crashpad | 640 } // namespace crashpad |
OLD | NEW |