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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 daylight_time_name_utf16.c_str(), | 655 daylight_time_name_utf16.c_str(), |
656 arraysize(expect_misc_info.TimeZone.DaylightName)); | 656 arraysize(expect_misc_info.TimeZone.DaylightName)); |
657 expect_misc_info.TimeZone.DaylightBias = -60; | 657 expect_misc_info.TimeZone.DaylightBias = -60; |
658 c16lcpy(expect_misc_info.BuildString, | 658 c16lcpy(expect_misc_info.BuildString, |
659 build_string_utf16.c_str(), | 659 build_string_utf16.c_str(), |
660 arraysize(expect_misc_info.BuildString)); | 660 arraysize(expect_misc_info.BuildString)); |
661 c16lcpy(expect_misc_info.DbgBldStr, | 661 c16lcpy(expect_misc_info.DbgBldStr, |
662 debug_build_string_utf16.c_str(), | 662 debug_build_string_utf16.c_str(), |
663 arraysize(expect_misc_info.DbgBldStr)); | 663 arraysize(expect_misc_info.DbgBldStr)); |
664 | 664 |
665 const timeval kStartTime = { expect_misc_info.ProcessCreateTime, 0 }; | 665 const timeval kStartTime = |
666 const timeval kUserCPUTime = { expect_misc_info.ProcessUserTime, 0 }; | 666 { implicit_cast<time_t>(expect_misc_info.ProcessCreateTime), 0 }; |
667 const timeval kSystemCPUTime = { expect_misc_info.ProcessKernelTime, 0 }; | 667 const timeval kUserCPUTime = |
| 668 { implicit_cast<time_t>(expect_misc_info.ProcessUserTime), 0 }; |
| 669 const timeval kSystemCPUTime = |
| 670 { implicit_cast<time_t>(expect_misc_info.ProcessKernelTime), 0 }; |
668 | 671 |
669 TestProcessSnapshot process_snapshot; | 672 TestProcessSnapshot process_snapshot; |
670 process_snapshot.SetProcessID(expect_misc_info.ProcessId); | 673 process_snapshot.SetProcessID(expect_misc_info.ProcessId); |
671 process_snapshot.SetProcessStartTime(kStartTime); | 674 process_snapshot.SetProcessStartTime(kStartTime); |
672 process_snapshot.SetProcessCPUTimes(kUserCPUTime, kSystemCPUTime); | 675 process_snapshot.SetProcessCPUTimes(kUserCPUTime, kSystemCPUTime); |
673 | 676 |
674 auto system_snapshot = make_scoped_ptr(new TestSystemSnapshot()); | 677 auto system_snapshot = make_scoped_ptr(new TestSystemSnapshot()); |
675 const uint64_t kHzPerMHz = 1E6; | 678 const uint64_t kHzPerMHz = 1E6; |
676 system_snapshot->SetCPUFrequency( | 679 system_snapshot->SetCPUFrequency( |
677 expect_misc_info.ProcessorCurrentMhz * kHzPerMHz, | 680 expect_misc_info.ProcessorCurrentMhz * kHzPerMHz, |
(...skipping 20 matching lines...) Expand all Loading... |
698 | 701 |
699 const MINIDUMP_MISC_INFO_4* misc_info; | 702 const MINIDUMP_MISC_INFO_4* misc_info; |
700 ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &misc_info)); | 703 ASSERT_NO_FATAL_FAILURE(GetMiscInfoStream(file_writer.string(), &misc_info)); |
701 | 704 |
702 ExpectMiscInfoEqual(&expect_misc_info, misc_info); | 705 ExpectMiscInfoEqual(&expect_misc_info, misc_info); |
703 } | 706 } |
704 | 707 |
705 } // namespace | 708 } // namespace |
706 } // namespace test | 709 } // namespace test |
707 } // namespace crashpad | 710 } // namespace crashpad |
OLD | NEW |