| 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 18 matching lines...) Expand all Loading... |
| 29 #include "gtest/gtest.h" | 29 #include "gtest/gtest.h" |
| 30 #include "util/mac/mach_o_image_segment_reader.h" | 30 #include "util/mac/mach_o_image_segment_reader.h" |
| 31 #include "util/mac/process_reader.h" | 31 #include "util/mac/process_reader.h" |
| 32 #include "util/mac/process_types.h" | 32 #include "util/mac/process_types.h" |
| 33 #include "util/misc/uuid.h" | 33 #include "util/misc/uuid.h" |
| 34 #include "util/test/mac/dyld.h" | 34 #include "util/test/mac/dyld.h" |
| 35 | 35 |
| 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 { |
| 40 namespace test { |
| 39 namespace { | 41 namespace { |
| 40 | 42 |
| 41 using namespace crashpad; | |
| 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 typedef mach_header_64 MachHeader; |
| 47 const uint32_t kMachMagic = MH_MAGIC_64; | 47 const uint32_t kMachMagic = MH_MAGIC_64; |
| 48 typedef segment_command_64 SegmentCommand; | 48 typedef segment_command_64 SegmentCommand; |
| 49 const uint32_t kSegmentCommand = LC_SEGMENT_64; | 49 const uint32_t kSegmentCommand = LC_SEGMENT_64; |
| 50 typedef section_64 Section; | 50 typedef section_64 Section; |
| 51 typedef nlist_64 Nlist; | 51 typedef nlist_64 Nlist; |
| 52 #else | 52 #else |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 expected_uuid.InitializeFromBytes(dyld_image->imageUUID); | 652 expected_uuid.InitializeFromBytes(dyld_image->imageUUID); |
| 653 UUID actual_uuid; | 653 UUID actual_uuid; |
| 654 image_reader.UUID(&actual_uuid); | 654 image_reader.UUID(&actual_uuid); |
| 655 EXPECT_EQ(expected_uuid, actual_uuid); | 655 EXPECT_EQ(expected_uuid, actual_uuid); |
| 656 } | 656 } |
| 657 } | 657 } |
| 658 #endif | 658 #endif |
| 659 } | 659 } |
| 660 | 660 |
| 661 } // namespace | 661 } // namespace |
| 662 } // namespace test |
| 663 } // namespace crashpad |
| OLD | NEW |