mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-14 17:30:09 +08:00
Remove use of MSVC_SUPPRESS_WARNING
Upstreaming of https://chromium-review.googlesource.com/c/chromium/src/+/1290574. Change-Id: I4e37879f34b6db7ee93b04b999bbae1ac4d645ae Reviewed-on: https://chromium-review.googlesource.com/c/1291054 Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
parent
95b177e793
commit
2dee96b841
@ -20,7 +20,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "build/build_config.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "minidump/minidump_user_extension_stream_data_source.h"
|
||||
@ -392,21 +392,16 @@ TEST(MinidumpFileWriter, InitializeFromSnapshot_Basic) {
|
||||
}
|
||||
|
||||
TEST(MinidumpFileWriter, InitializeFromSnapshot_Exception) {
|
||||
// In a 32-bit environment, this will give a “timestamp out of range” warning,
|
||||
// In a 32-bit environment, this will give a “timestamp out of range” warning,
|
||||
// but the test should complete without failure.
|
||||
constexpr uint32_t kSnapshotTime = 0xfd469ab8;
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wconstant-conversion"
|
||||
#define DISABLED_WCONSTANT_CONVERSION
|
||||
#endif // __clang__
|
||||
MSVC_SUPPRESS_WARNING(4309); // Truncation of constant value.
|
||||
MSVC_SUPPRESS_WARNING(4838); // Narrowing conversion.
|
||||
constexpr timeval kSnapshotTimeval = {static_cast<time_t>(kSnapshotTime), 0};
|
||||
#if defined(DISABLED_WCONSTANT_CONVERSION)
|
||||
#pragma clang diagnostic pop
|
||||
#undef DISABLED_WCONSTANT_CONVERSION
|
||||
#endif // DISABLED_WCONSTANT_CONVERSION
|
||||
constexpr timeval kSnapshotTimeval = {
|
||||
#ifdef OS_WIN
|
||||
static_cast<long>(kSnapshotTime),
|
||||
#else
|
||||
static_cast<time_t>(kSnapshotTime),
|
||||
#endif
|
||||
0};
|
||||
|
||||
TestProcessSnapshot process_snapshot;
|
||||
process_snapshot.SetSnapshotTime(kSnapshotTimeval);
|
||||
|
Loading…
x
Reference in New Issue
Block a user