Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: minidump/minidump_misc_info_writer_test.cc

Issue 711603002: Fix MinidumpMiscInfoWriter test compilation with 32-bit time_t (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698