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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 EXPECT_EQ(kMinidumpStreamTypeMemoryList, directory[4].StreamType); | 283 EXPECT_EQ(kMinidumpStreamTypeMemoryList, directory[4].StreamType); |
284 EXPECT_TRUE(MinidumpWritableAtLocationDescriptor<MINIDUMP_MEMORY_LIST>( | 284 EXPECT_TRUE(MinidumpWritableAtLocationDescriptor<MINIDUMP_MEMORY_LIST>( |
285 string_file.string(), directory[4].Location)); | 285 string_file.string(), directory[4].Location)); |
286 } | 286 } |
287 | 287 |
288 TEST(MinidumpFileWriter, InitializeFromSnapshot_Exception) { | 288 TEST(MinidumpFileWriter, InitializeFromSnapshot_Exception) { |
289 // In a 32-bit environment, this will give a “timestamp out of range” warning, | 289 // In a 32-bit environment, this will give a “timestamp out of range” warning, |
290 // but the test should complete without failure. | 290 // but the test should complete without failure. |
291 const uint32_t kSnapshotTime = 0xfd469ab8; | 291 const uint32_t kSnapshotTime = 0xfd469ab8; |
292 MSVC_SUPPRESS_WARNING(4309); // Truncation of constant value. | 292 MSVC_SUPPRESS_WARNING(4309); // Truncation of constant value. |
| 293 MSVC_SUPPRESS_WARNING(4838); // Narrowing conversion. |
293 const timeval kSnapshotTimeval = { static_cast<time_t>(kSnapshotTime), 0 }; | 294 const timeval kSnapshotTimeval = { static_cast<time_t>(kSnapshotTime), 0 }; |
294 | 295 |
295 TestProcessSnapshot process_snapshot; | 296 TestProcessSnapshot process_snapshot; |
296 process_snapshot.SetSnapshotTime(kSnapshotTimeval); | 297 process_snapshot.SetSnapshotTime(kSnapshotTimeval); |
297 | 298 |
298 auto system_snapshot = make_scoped_ptr(new TestSystemSnapshot()); | 299 auto system_snapshot = make_scoped_ptr(new TestSystemSnapshot()); |
299 system_snapshot->SetCPUArchitecture(kCPUArchitectureX86_64); | 300 system_snapshot->SetCPUArchitecture(kCPUArchitectureX86_64); |
300 system_snapshot->SetOperatingSystem(SystemSnapshot::kOperatingSystemMacOSX); | 301 system_snapshot->SetOperatingSystem(SystemSnapshot::kOperatingSystemMacOSX); |
301 process_snapshot.SetSystem(system_snapshot.Pass()); | 302 process_snapshot.SetSystem(system_snapshot.Pass()); |
302 | 303 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 const uint8_t kStream1Value = 0xa5; | 437 const uint8_t kStream1Value = 0xa5; |
437 auto stream1 = make_scoped_ptr( | 438 auto stream1 = make_scoped_ptr( |
438 new TestStream(kStream1Type, kStream1Size, kStream1Value)); | 439 new TestStream(kStream1Type, kStream1Size, kStream1Value)); |
439 ASSERT_DEATH_CHECK(minidump_file.AddStream(stream1.Pass()), | 440 ASSERT_DEATH_CHECK(minidump_file.AddStream(stream1.Pass()), |
440 "already present"); | 441 "already present"); |
441 } | 442 } |
442 | 443 |
443 } // namespace | 444 } // namespace |
444 } // namespace test | 445 } // namespace test |
445 } // namespace crashpad | 446 } // namespace crashpad |
OLD | NEW |