2022-09-06 19:14:07 -04:00
|
|
|
// Copyright 2014 The Crashpad Authors
|
2014-10-24 14:44:55 -04:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2014-10-24 14:58:53 -04:00
|
|
|
#include "minidump/minidump_module_crashpad_info_writer.h"
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-02-04 17:30:03 -08:00
|
|
|
#include <windows.h>
|
2014-10-24 14:44:55 -04:00
|
|
|
#include <dbghelp.h>
|
|
|
|
|
2022-02-28 20:57:19 -08:00
|
|
|
#include <iterator>
|
2015-12-09 17:36:32 -05:00
|
|
|
#include <utility>
|
|
|
|
|
2014-10-24 14:44:55 -04:00
|
|
|
#include "gtest/gtest.h"
|
2017-11-01 17:06:18 -04:00
|
|
|
#include "minidump/minidump_annotation_writer.h"
|
2014-10-24 14:44:55 -04:00
|
|
|
#include "minidump/minidump_simple_string_dictionary_writer.h"
|
2017-11-01 17:06:18 -04:00
|
|
|
#include "minidump/test/minidump_byte_array_writer_test_util.h"
|
2014-10-24 14:44:55 -04:00
|
|
|
#include "minidump/test/minidump_file_writer_test_util.h"
|
|
|
|
#include "minidump/test/minidump_string_writer_test_util.h"
|
|
|
|
#include "minidump/test/minidump_writable_test_util.h"
|
2014-10-28 17:00:46 -04:00
|
|
|
#include "snapshot/test/test_module_snapshot.h"
|
2015-02-18 14:15:38 -05:00
|
|
|
#include "util/file/string_file.h"
|
2014-10-24 14:44:55 -04:00
|
|
|
|
|
|
|
namespace crashpad {
|
|
|
|
namespace test {
|
|
|
|
namespace {
|
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
const MinidumpModuleCrashpadInfoList* MinidumpModuleCrashpadInfoListAtStart(
|
|
|
|
const std::string& file_contents,
|
|
|
|
size_t count) {
|
|
|
|
MINIDUMP_LOCATION_DESCRIPTOR location_descriptor;
|
2015-03-06 16:05:34 -08:00
|
|
|
location_descriptor.DataSize =
|
|
|
|
static_cast<uint32_t>(sizeof(MinidumpModuleCrashpadInfoList) +
|
|
|
|
count * sizeof(MinidumpModuleCrashpadInfoLink));
|
2015-03-04 10:53:34 -05:00
|
|
|
location_descriptor.Rva = 0;
|
|
|
|
|
|
|
|
const MinidumpModuleCrashpadInfoList* list =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfoList>(
|
|
|
|
file_contents, location_descriptor);
|
|
|
|
if (!list) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (list->count != count) {
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(list->count, count);
|
2015-03-04 10:53:34 -05:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2014-10-24 14:44:55 -04:00
|
|
|
TEST(MinidumpModuleCrashpadInfoWriter, EmptyList) {
|
2015-02-18 14:15:38 -05:00
|
|
|
StringFile string_file;
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
auto module_list_writer =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpModuleCrashpadInfoListWriter>();
|
2015-03-04 10:53:34 -05:00
|
|
|
EXPECT_FALSE(module_list_writer->IsUseful());
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
EXPECT_TRUE(module_list_writer->WriteEverything(&string_file));
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(string_file.string().size(),
|
|
|
|
sizeof(MinidumpModuleCrashpadInfoList));
|
2014-10-24 14:44:55 -04:00
|
|
|
|
|
|
|
const MinidumpModuleCrashpadInfoList* module_list =
|
2015-03-04 10:53:34 -05:00
|
|
|
MinidumpModuleCrashpadInfoListAtStart(string_file.string(), 0);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(MinidumpModuleCrashpadInfoWriter, EmptyModule) {
|
2015-02-18 14:15:38 -05:00
|
|
|
StringFile string_file;
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
auto module_list_writer =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpModuleCrashpadInfoListWriter>();
|
|
|
|
auto module_writer = std::make_unique<MinidumpModuleCrashpadInfoWriter>();
|
2014-10-28 17:00:46 -04:00
|
|
|
EXPECT_FALSE(module_writer->IsUseful());
|
2015-12-09 17:36:32 -05:00
|
|
|
module_list_writer->AddModule(std::move(module_writer), 0);
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
EXPECT_TRUE(module_list_writer->IsUseful());
|
2014-11-07 11:38:13 -05:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
EXPECT_TRUE(module_list_writer->WriteEverything(&string_file));
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(string_file.string().size(),
|
|
|
|
sizeof(MinidumpModuleCrashpadInfoList) +
|
2015-03-04 10:53:34 -05:00
|
|
|
sizeof(MinidumpModuleCrashpadInfoLink) +
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
sizeof(MinidumpModuleCrashpadInfo));
|
2014-10-24 14:44:55 -04:00
|
|
|
|
|
|
|
const MinidumpModuleCrashpadInfoList* module_list =
|
2015-03-04 10:53:34 -05:00
|
|
|
MinidumpModuleCrashpadInfoListAtStart(string_file.string(), 1);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module_list);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_list->modules[0].minidump_module_list_index, 0u);
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpModuleCrashpadInfo* module =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
2015-03-04 10:53:34 -05:00
|
|
|
string_file.string(), module_list->modules[0].location);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module->version, MinidumpModuleCrashpadInfo::kVersion);
|
|
|
|
EXPECT_EQ(module->list_annotations.DataSize, 0u);
|
|
|
|
EXPECT_EQ(module->list_annotations.Rva, 0u);
|
|
|
|
EXPECT_EQ(module->simple_annotations.DataSize, 0u);
|
|
|
|
EXPECT_EQ(module->simple_annotations.Rva, 0u);
|
2017-11-01 17:06:18 -04:00
|
|
|
EXPECT_EQ(module->annotation_objects.DataSize, 0u);
|
|
|
|
EXPECT_EQ(module->annotation_objects.Rva, 0u);
|
2014-10-24 14:44:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(MinidumpModuleCrashpadInfoWriter, FullModule) {
|
2017-07-25 19:15:48 -04:00
|
|
|
constexpr uint32_t kMinidumpModuleListIndex = 1;
|
2017-07-25 13:34:04 -04:00
|
|
|
static constexpr char kKey[] = "key";
|
|
|
|
static constexpr char kValue[] = "value";
|
|
|
|
static constexpr char kEntry[] = "entry";
|
2014-11-07 10:01:17 -05:00
|
|
|
std::vector<std::string> vector(1, std::string(kEntry));
|
2017-11-01 17:06:18 -04:00
|
|
|
const AnnotationSnapshot annotation("one", 42, {'t', 'e', 's', 't'});
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-02-18 14:15:38 -05:00
|
|
|
StringFile string_file;
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
auto module_list_writer =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpModuleCrashpadInfoListWriter>();
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2017-10-12 12:42:28 -04:00
|
|
|
auto module_writer = std::make_unique<MinidumpModuleCrashpadInfoWriter>();
|
|
|
|
auto string_list_writer = std::make_unique<MinidumpUTF8StringListWriter>();
|
2014-11-07 10:01:17 -05:00
|
|
|
string_list_writer->InitializeFromVector(vector);
|
2015-12-09 17:36:32 -05:00
|
|
|
module_writer->SetListAnnotations(std::move(string_list_writer));
|
2014-10-27 15:01:39 -04:00
|
|
|
auto simple_string_dictionary_writer =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpSimpleStringDictionaryWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
auto simple_string_dictionary_entry_writer =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpSimpleStringDictionaryEntryWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
simple_string_dictionary_entry_writer->SetKeyValue(kKey, kValue);
|
|
|
|
simple_string_dictionary_writer->AddEntry(
|
2015-12-09 17:36:32 -05:00
|
|
|
std::move(simple_string_dictionary_entry_writer));
|
2015-11-30 14:20:54 -08:00
|
|
|
module_writer->SetSimpleAnnotations(
|
2015-12-09 17:36:32 -05:00
|
|
|
std::move(simple_string_dictionary_writer));
|
2017-11-01 17:06:18 -04:00
|
|
|
auto annotation_list_writer =
|
|
|
|
std::make_unique<MinidumpAnnotationListWriter>();
|
|
|
|
annotation_list_writer->InitializeFromList({annotation});
|
|
|
|
module_writer->SetAnnotationObjects(std::move(annotation_list_writer));
|
2014-10-28 17:00:46 -04:00
|
|
|
EXPECT_TRUE(module_writer->IsUseful());
|
2015-12-09 17:36:32 -05:00
|
|
|
module_list_writer->AddModule(std::move(module_writer),
|
2015-11-30 14:20:54 -08:00
|
|
|
kMinidumpModuleListIndex);
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
EXPECT_TRUE(module_list_writer->IsUseful());
|
2014-11-07 11:38:13 -05:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
EXPECT_TRUE(module_list_writer->WriteEverything(&string_file));
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(string_file.string().size(),
|
|
|
|
sizeof(MinidumpModuleCrashpadInfoList) +
|
2015-03-04 10:53:34 -05:00
|
|
|
sizeof(MinidumpModuleCrashpadInfoLink) +
|
2017-11-01 17:06:18 -04:00
|
|
|
sizeof(MinidumpModuleCrashpadInfo) + sizeof(MinidumpRVAList) +
|
|
|
|
sizeof(RVA) + sizeof(MinidumpSimpleStringDictionary) +
|
2014-10-24 14:44:55 -04:00
|
|
|
sizeof(MinidumpSimpleStringDictionaryEntry) +
|
2017-11-01 17:06:18 -04:00
|
|
|
sizeof(MinidumpAnnotationList) + 2 + // padding
|
|
|
|
sizeof(MinidumpAnnotation) + sizeof(MinidumpUTF8String) +
|
2022-02-28 20:57:19 -08:00
|
|
|
std::size(kEntry) + 2 + // padding
|
|
|
|
sizeof(MinidumpUTF8String) + std::size(kKey) +
|
|
|
|
sizeof(MinidumpUTF8String) + std::size(kValue) +
|
2017-11-01 17:06:18 -04:00
|
|
|
sizeof(MinidumpUTF8String) + annotation.name.size() + 1 +
|
|
|
|
sizeof(MinidumpByteArray) + annotation.value.size());
|
2014-10-24 14:44:55 -04:00
|
|
|
|
|
|
|
const MinidumpModuleCrashpadInfoList* module_list =
|
2015-03-04 10:53:34 -05:00
|
|
|
MinidumpModuleCrashpadInfoListAtStart(string_file.string(), 1);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module_list);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_list->modules[0].minidump_module_list_index,
|
|
|
|
kMinidumpModuleListIndex);
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpModuleCrashpadInfo* module =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
2015-03-04 10:53:34 -05:00
|
|
|
string_file.string(), module_list->modules[0].location);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module->version, MinidumpModuleCrashpadInfo::kVersion);
|
|
|
|
EXPECT_NE(module->list_annotations.DataSize, 0u);
|
|
|
|
EXPECT_NE(module->list_annotations.Rva, 0u);
|
|
|
|
EXPECT_NE(module->simple_annotations.DataSize, 0u);
|
|
|
|
EXPECT_NE(module->simple_annotations.Rva, 0u);
|
2017-11-01 17:06:18 -04:00
|
|
|
EXPECT_NE(module->annotation_objects.DataSize, 0u);
|
|
|
|
EXPECT_NE(module->annotation_objects.Rva, 0u);
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2014-11-07 10:01:17 -05:00
|
|
|
const MinidumpRVAList* list_annotations =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpRVAList>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module->list_annotations);
|
2014-11-07 10:01:17 -05:00
|
|
|
ASSERT_TRUE(list_annotations);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(list_annotations->count, 1u);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(string_file.string(),
|
|
|
|
list_annotations->children[0]),
|
|
|
|
kEntry);
|
2014-11-07 10:01:17 -05:00
|
|
|
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpSimpleStringDictionary* simple_annotations =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module->simple_annotations);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(simple_annotations);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(simple_annotations->count, 1u);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(string_file.string(),
|
|
|
|
simple_annotations->entries[0].key),
|
|
|
|
kKey);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations->entries[0].value),
|
|
|
|
kValue);
|
2017-11-01 17:06:18 -04:00
|
|
|
|
|
|
|
const MinidumpAnnotationList* annotation_objects =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
|
|
|
|
string_file.string(), module->annotation_objects);
|
|
|
|
ASSERT_TRUE(annotation_objects);
|
|
|
|
|
|
|
|
ASSERT_EQ(annotation_objects->count, 1u);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), annotation_objects->objects[0].name),
|
|
|
|
annotation.name);
|
|
|
|
EXPECT_EQ(annotation_objects->objects[0].type, 42u);
|
|
|
|
EXPECT_EQ(annotation_objects->objects[0].reserved, 0u);
|
|
|
|
EXPECT_EQ(MinidumpByteArrayAtRVA(string_file.string(),
|
|
|
|
annotation_objects->objects[0].value),
|
|
|
|
annotation.value);
|
2014-10-24 14:44:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(MinidumpModuleCrashpadInfoWriter, ThreeModules) {
|
2017-07-25 19:15:48 -04:00
|
|
|
constexpr uint32_t kMinidumpModuleListIndex0 = 0;
|
2017-07-25 13:34:04 -04:00
|
|
|
static constexpr char kKey0[] = "key";
|
|
|
|
static constexpr char kValue0[] = "value";
|
2017-11-01 17:06:18 -04:00
|
|
|
const AnnotationSnapshot annotation0("name", 0x8FFF, {'t', '\0', 't'});
|
2017-07-25 19:15:48 -04:00
|
|
|
constexpr uint32_t kMinidumpModuleListIndex1 = 2;
|
|
|
|
constexpr uint32_t kMinidumpModuleListIndex2 = 5;
|
2017-07-25 13:34:04 -04:00
|
|
|
static constexpr char kKey2A[] = "K";
|
|
|
|
static constexpr char kValue2A[] = "VVV";
|
|
|
|
static constexpr char kKey2B[] = "river";
|
|
|
|
static constexpr char kValue2B[] = "hudson";
|
2017-11-01 17:06:18 -04:00
|
|
|
const AnnotationSnapshot annotation2a("A2", 0xDDDD, {2, 4, 6, 8});
|
|
|
|
const AnnotationSnapshot annotation2b("A3", 0xDDDF, {'m', 'o', 'o'});
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-02-18 14:15:38 -05:00
|
|
|
StringFile string_file;
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
auto module_list_writer =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpModuleCrashpadInfoListWriter>();
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2017-10-12 12:42:28 -04:00
|
|
|
auto module_writer_0 = std::make_unique<MinidumpModuleCrashpadInfoWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
auto simple_string_dictionary_writer_0 =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpSimpleStringDictionaryWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
auto simple_string_dictionary_entry_writer_0 =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpSimpleStringDictionaryEntryWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
simple_string_dictionary_entry_writer_0->SetKeyValue(kKey0, kValue0);
|
|
|
|
simple_string_dictionary_writer_0->AddEntry(
|
2015-12-09 17:36:32 -05:00
|
|
|
std::move(simple_string_dictionary_entry_writer_0));
|
2014-10-27 15:01:39 -04:00
|
|
|
module_writer_0->SetSimpleAnnotations(
|
2015-12-09 17:36:32 -05:00
|
|
|
std::move(simple_string_dictionary_writer_0));
|
2017-11-01 17:06:18 -04:00
|
|
|
auto annotation_list_writer_0 =
|
|
|
|
std::make_unique<MinidumpAnnotationListWriter>();
|
|
|
|
auto annotation_writer_0 = std::make_unique<MinidumpAnnotationWriter>();
|
|
|
|
annotation_writer_0->InitializeFromSnapshot(annotation0);
|
|
|
|
annotation_list_writer_0->AddObject(std::move(annotation_writer_0));
|
|
|
|
module_writer_0->SetAnnotationObjects(std::move(annotation_list_writer_0));
|
2014-10-28 17:00:46 -04:00
|
|
|
EXPECT_TRUE(module_writer_0->IsUseful());
|
2015-12-09 17:36:32 -05:00
|
|
|
module_list_writer->AddModule(std::move(module_writer_0),
|
2015-03-04 10:53:34 -05:00
|
|
|
kMinidumpModuleListIndex0);
|
2014-10-27 15:01:39 -04:00
|
|
|
|
2017-10-12 12:42:28 -04:00
|
|
|
auto module_writer_1 = std::make_unique<MinidumpModuleCrashpadInfoWriter>();
|
2014-10-28 17:00:46 -04:00
|
|
|
EXPECT_FALSE(module_writer_1->IsUseful());
|
2015-12-09 17:36:32 -05:00
|
|
|
module_list_writer->AddModule(std::move(module_writer_1),
|
2015-03-04 10:53:34 -05:00
|
|
|
kMinidumpModuleListIndex1);
|
2014-10-27 15:01:39 -04:00
|
|
|
|
2017-10-12 12:42:28 -04:00
|
|
|
auto module_writer_2 = std::make_unique<MinidumpModuleCrashpadInfoWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
auto simple_string_dictionary_writer_2 =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpSimpleStringDictionaryWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
auto simple_string_dictionary_entry_writer_2a =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpSimpleStringDictionaryEntryWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
simple_string_dictionary_entry_writer_2a->SetKeyValue(kKey2A, kValue2A);
|
|
|
|
simple_string_dictionary_writer_2->AddEntry(
|
2015-12-09 17:36:32 -05:00
|
|
|
std::move(simple_string_dictionary_entry_writer_2a));
|
2014-10-27 15:01:39 -04:00
|
|
|
auto simple_string_dictionary_entry_writer_2b =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpSimpleStringDictionaryEntryWriter>();
|
2014-10-27 15:01:39 -04:00
|
|
|
simple_string_dictionary_entry_writer_2b->SetKeyValue(kKey2B, kValue2B);
|
|
|
|
simple_string_dictionary_writer_2->AddEntry(
|
2015-12-09 17:36:32 -05:00
|
|
|
std::move(simple_string_dictionary_entry_writer_2b));
|
2014-10-27 15:01:39 -04:00
|
|
|
module_writer_2->SetSimpleAnnotations(
|
2015-12-09 17:36:32 -05:00
|
|
|
std::move(simple_string_dictionary_writer_2));
|
2017-11-01 17:06:18 -04:00
|
|
|
auto annotation_list_writer_2 =
|
|
|
|
std::make_unique<MinidumpAnnotationListWriter>();
|
|
|
|
auto annotation_writer_2a = std::make_unique<MinidumpAnnotationWriter>();
|
|
|
|
annotation_writer_2a->InitializeFromSnapshot(annotation2a);
|
|
|
|
auto annotation_writer_2b = std::make_unique<MinidumpAnnotationWriter>();
|
|
|
|
annotation_writer_2b->InitializeFromSnapshot(annotation2b);
|
|
|
|
annotation_list_writer_2->AddObject(std::move(annotation_writer_2a));
|
|
|
|
annotation_list_writer_2->AddObject(std::move(annotation_writer_2b));
|
|
|
|
module_writer_2->SetAnnotationObjects(std::move(annotation_list_writer_2));
|
2014-10-28 17:00:46 -04:00
|
|
|
EXPECT_TRUE(module_writer_2->IsUseful());
|
2015-12-09 17:36:32 -05:00
|
|
|
module_list_writer->AddModule(std::move(module_writer_2),
|
2015-03-04 10:53:34 -05:00
|
|
|
kMinidumpModuleListIndex2);
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
EXPECT_TRUE(module_list_writer->IsUseful());
|
2014-11-07 11:38:13 -05:00
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
EXPECT_TRUE(module_list_writer->WriteEverything(&string_file));
|
2014-10-24 14:44:55 -04:00
|
|
|
|
|
|
|
const MinidumpModuleCrashpadInfoList* module_list =
|
2015-03-04 10:53:34 -05:00
|
|
|
MinidumpModuleCrashpadInfoListAtStart(string_file.string(), 3);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module_list);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_list->modules[0].minidump_module_list_index,
|
|
|
|
kMinidumpModuleListIndex0);
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpModuleCrashpadInfo* module_0 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
2015-03-04 10:53:34 -05:00
|
|
|
string_file.string(), module_list->modules[0].location);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module_0);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_0->version, MinidumpModuleCrashpadInfo::kVersion);
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2014-11-07 10:01:17 -05:00
|
|
|
const MinidumpRVAList* list_annotations_0 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpRVAList>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_0->list_annotations);
|
2014-11-07 10:01:17 -05:00
|
|
|
EXPECT_FALSE(list_annotations_0);
|
|
|
|
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpSimpleStringDictionary* simple_annotations_0 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_0->simple_annotations);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(simple_annotations_0);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(simple_annotations_0->count, 1u);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_0->entries[0].key),
|
|
|
|
kKey0);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_0->entries[0].value),
|
|
|
|
kValue0);
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2017-11-01 17:06:18 -04:00
|
|
|
const MinidumpAnnotationList* annotation_list_0 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
|
|
|
|
string_file.string(), module_0->annotation_objects);
|
|
|
|
ASSERT_TRUE(annotation_list_0);
|
|
|
|
|
|
|
|
ASSERT_EQ(annotation_list_0->count, 1u);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(string_file.string(),
|
|
|
|
annotation_list_0->objects[0].name),
|
|
|
|
annotation0.name);
|
|
|
|
EXPECT_EQ(annotation_list_0->objects[0].type, annotation0.type);
|
|
|
|
EXPECT_EQ(annotation_list_0->objects[0].reserved, 0u);
|
|
|
|
EXPECT_EQ(MinidumpByteArrayAtRVA(string_file.string(),
|
|
|
|
annotation_list_0->objects[0].value),
|
|
|
|
annotation0.value);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_list->modules[1].minidump_module_list_index,
|
|
|
|
kMinidumpModuleListIndex1);
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpModuleCrashpadInfo* module_1 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
2015-03-04 10:53:34 -05:00
|
|
|
string_file.string(), module_list->modules[1].location);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module_1);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_1->version, MinidumpModuleCrashpadInfo::kVersion);
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2014-11-07 10:01:17 -05:00
|
|
|
const MinidumpRVAList* list_annotations_1 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpRVAList>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_1->list_annotations);
|
2014-11-07 10:01:17 -05:00
|
|
|
EXPECT_FALSE(list_annotations_1);
|
|
|
|
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpSimpleStringDictionary* simple_annotations_1 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_1->simple_annotations);
|
2014-10-24 14:44:55 -04:00
|
|
|
EXPECT_FALSE(simple_annotations_1);
|
|
|
|
|
2017-11-01 17:06:18 -04:00
|
|
|
const MinidumpAnnotationList* annotation_list_1 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
|
|
|
|
string_file.string(), module_1->annotation_objects);
|
|
|
|
EXPECT_FALSE(annotation_list_1);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_list->modules[2].minidump_module_list_index,
|
|
|
|
kMinidumpModuleListIndex2);
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpModuleCrashpadInfo* module_2 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
2015-03-04 10:53:34 -05:00
|
|
|
string_file.string(), module_list->modules[2].location);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(module_2);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_2->version, MinidumpModuleCrashpadInfo::kVersion);
|
2014-10-24 14:44:55 -04:00
|
|
|
|
2014-11-07 10:01:17 -05:00
|
|
|
const MinidumpRVAList* list_annotations_2 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpRVAList>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_2->list_annotations);
|
2014-11-07 10:01:17 -05:00
|
|
|
EXPECT_FALSE(list_annotations_2);
|
|
|
|
|
2014-10-24 14:44:55 -04:00
|
|
|
const MinidumpSimpleStringDictionary* simple_annotations_2 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_2->simple_annotations);
|
2014-10-24 14:44:55 -04:00
|
|
|
ASSERT_TRUE(simple_annotations_2);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(simple_annotations_2->count, 2u);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_2->entries[0].key),
|
|
|
|
kKey2A);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_2->entries[0].value),
|
|
|
|
kValue2A);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_2->entries[1].key),
|
|
|
|
kKey2B);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_2->entries[1].value),
|
|
|
|
kValue2B);
|
2017-11-01 17:06:18 -04:00
|
|
|
|
|
|
|
const MinidumpAnnotationList* annotation_list_2 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
|
|
|
|
string_file.string(), module_2->annotation_objects);
|
|
|
|
ASSERT_TRUE(annotation_list_2);
|
|
|
|
|
|
|
|
ASSERT_EQ(annotation_list_2->count, 2u);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(string_file.string(),
|
|
|
|
annotation_list_2->objects[0].name),
|
|
|
|
annotation2a.name);
|
|
|
|
EXPECT_EQ(annotation_list_2->objects[0].type, annotation2a.type);
|
|
|
|
EXPECT_EQ(annotation_list_2->objects[0].reserved, 0u);
|
|
|
|
EXPECT_EQ(MinidumpByteArrayAtRVA(string_file.string(),
|
|
|
|
annotation_list_2->objects[0].value),
|
|
|
|
annotation2a.value);
|
|
|
|
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(string_file.string(),
|
|
|
|
annotation_list_2->objects[1].name),
|
|
|
|
annotation2b.name);
|
|
|
|
EXPECT_EQ(annotation_list_2->objects[1].type, annotation2b.type);
|
|
|
|
EXPECT_EQ(annotation_list_2->objects[1].reserved, 0u);
|
|
|
|
EXPECT_EQ(MinidumpByteArrayAtRVA(string_file.string(),
|
|
|
|
annotation_list_2->objects[1].value),
|
|
|
|
annotation2b.value);
|
2014-10-24 14:44:55 -04:00
|
|
|
}
|
|
|
|
|
2014-10-28 17:00:46 -04:00
|
|
|
TEST(MinidumpModuleCrashpadInfoWriter, InitializeFromSnapshot) {
|
2017-07-25 13:34:04 -04:00
|
|
|
static constexpr char kKey0A[] = "k";
|
|
|
|
static constexpr char kValue0A[] = "value";
|
|
|
|
static constexpr char kKey0B[] = "hudson";
|
|
|
|
static constexpr char kValue0B[] = "estuary";
|
|
|
|
static constexpr char kKey2[] = "k";
|
|
|
|
static constexpr char kValue2[] = "different_value";
|
|
|
|
static constexpr char kEntry3A[] = "list";
|
|
|
|
static constexpr char kEntry3B[] = "erine";
|
2017-11-01 17:06:18 -04:00
|
|
|
const AnnotationSnapshot annotation(
|
|
|
|
"market", 1, {'2', '3', 'r', 'd', ' ', 'S', 't', '.'});
|
2014-10-28 17:00:46 -04:00
|
|
|
|
|
|
|
std::vector<const ModuleSnapshot*> module_snapshots;
|
|
|
|
|
|
|
|
TestModuleSnapshot module_snapshot_0;
|
|
|
|
std::map<std::string, std::string> annotations_simple_map_0;
|
|
|
|
annotations_simple_map_0[kKey0A] = kValue0A;
|
|
|
|
annotations_simple_map_0[kKey0B] = kValue0B;
|
|
|
|
module_snapshot_0.SetAnnotationsSimpleMap(annotations_simple_map_0);
|
|
|
|
module_snapshots.push_back(&module_snapshot_0);
|
|
|
|
|
|
|
|
// module_snapshot_1 is not expected to be written because it would not carry
|
|
|
|
// any MinidumpModuleCrashpadInfo data.
|
|
|
|
TestModuleSnapshot module_snapshot_1;
|
|
|
|
module_snapshots.push_back(&module_snapshot_1);
|
|
|
|
|
|
|
|
TestModuleSnapshot module_snapshot_2;
|
|
|
|
std::map<std::string, std::string> annotations_simple_map_2;
|
|
|
|
annotations_simple_map_2[kKey2] = kValue2;
|
|
|
|
module_snapshot_2.SetAnnotationsSimpleMap(annotations_simple_map_2);
|
|
|
|
module_snapshots.push_back(&module_snapshot_2);
|
|
|
|
|
2014-11-07 10:01:17 -05:00
|
|
|
TestModuleSnapshot module_snapshot_3;
|
|
|
|
std::vector<std::string> annotations_vector_3;
|
|
|
|
annotations_vector_3.push_back(kEntry3A);
|
|
|
|
annotations_vector_3.push_back(kEntry3B);
|
|
|
|
module_snapshot_3.SetAnnotationsVector(annotations_vector_3);
|
|
|
|
module_snapshots.push_back(&module_snapshot_3);
|
|
|
|
|
2017-11-01 17:06:18 -04:00
|
|
|
TestModuleSnapshot module_snapshot_4;
|
|
|
|
module_snapshot_4.SetAnnotationObjects({annotation});
|
|
|
|
module_snapshots.push_back(&module_snapshot_4);
|
|
|
|
|
2015-03-04 10:53:34 -05:00
|
|
|
auto module_list_writer =
|
2017-10-12 12:42:28 -04:00
|
|
|
std::make_unique<MinidumpModuleCrashpadInfoListWriter>();
|
2015-03-04 10:53:34 -05:00
|
|
|
module_list_writer->InitializeFromSnapshot(module_snapshots);
|
|
|
|
EXPECT_TRUE(module_list_writer->IsUseful());
|
2014-10-28 17:00:46 -04:00
|
|
|
|
2015-02-18 14:15:38 -05:00
|
|
|
StringFile string_file;
|
2015-03-04 10:53:34 -05:00
|
|
|
ASSERT_TRUE(module_list_writer->WriteEverything(&string_file));
|
2014-10-28 17:00:46 -04:00
|
|
|
|
|
|
|
const MinidumpModuleCrashpadInfoList* module_list =
|
2017-11-01 17:06:18 -04:00
|
|
|
MinidumpModuleCrashpadInfoListAtStart(string_file.string(), 4);
|
2014-10-28 17:00:46 -04:00
|
|
|
ASSERT_TRUE(module_list);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_list->modules[0].minidump_module_list_index, 0u);
|
2014-10-28 17:00:46 -04:00
|
|
|
const MinidumpModuleCrashpadInfo* module_0 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
2015-03-04 10:53:34 -05:00
|
|
|
string_file.string(), module_list->modules[0].location);
|
2014-10-28 17:00:46 -04:00
|
|
|
ASSERT_TRUE(module_0);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_0->version, MinidumpModuleCrashpadInfo::kVersion);
|
2014-10-28 17:00:46 -04:00
|
|
|
|
2014-11-07 10:01:17 -05:00
|
|
|
const MinidumpRVAList* list_annotations_0 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpRVAList>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_0->list_annotations);
|
2014-11-07 10:01:17 -05:00
|
|
|
EXPECT_FALSE(list_annotations_0);
|
|
|
|
|
2014-10-28 17:00:46 -04:00
|
|
|
const MinidumpSimpleStringDictionary* simple_annotations_0 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_0->simple_annotations);
|
2014-10-28 17:00:46 -04:00
|
|
|
ASSERT_TRUE(simple_annotations_0);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(simple_annotations_0->count, annotations_simple_map_0.size());
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_0->entries[0].key),
|
|
|
|
kKey0B);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_0->entries[0].value),
|
|
|
|
kValue0B);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_0->entries[1].key),
|
|
|
|
kKey0A);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_0->entries[1].value),
|
|
|
|
kValue0A);
|
|
|
|
|
2017-11-01 17:06:18 -04:00
|
|
|
EXPECT_FALSE(MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
|
|
|
|
string_file.string(), module_0->annotation_objects));
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_list->modules[1].minidump_module_list_index, 2u);
|
2014-10-28 17:00:46 -04:00
|
|
|
const MinidumpModuleCrashpadInfo* module_2 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
2015-03-04 10:53:34 -05:00
|
|
|
string_file.string(), module_list->modules[1].location);
|
2014-10-28 17:00:46 -04:00
|
|
|
ASSERT_TRUE(module_2);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_2->version, MinidumpModuleCrashpadInfo::kVersion);
|
2014-10-28 17:00:46 -04:00
|
|
|
|
2014-11-07 10:01:17 -05:00
|
|
|
const MinidumpRVAList* list_annotations_2 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpRVAList>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_2->list_annotations);
|
2014-11-07 10:01:17 -05:00
|
|
|
EXPECT_FALSE(list_annotations_2);
|
|
|
|
|
2014-10-28 17:00:46 -04:00
|
|
|
const MinidumpSimpleStringDictionary* simple_annotations_2 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_2->simple_annotations);
|
2014-10-28 17:00:46 -04:00
|
|
|
ASSERT_TRUE(simple_annotations_2);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(simple_annotations_2->count, annotations_simple_map_2.size());
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_2->entries[0].key),
|
|
|
|
kKey2);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(
|
|
|
|
string_file.string(), simple_annotations_2->entries[0].value),
|
|
|
|
kValue2);
|
2014-11-07 10:01:17 -05:00
|
|
|
|
2017-11-01 17:06:18 -04:00
|
|
|
EXPECT_FALSE(MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
|
|
|
|
string_file.string(), module_2->annotation_objects));
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_list->modules[2].minidump_module_list_index, 3u);
|
2014-11-07 10:01:17 -05:00
|
|
|
const MinidumpModuleCrashpadInfo* module_3 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
2015-03-04 10:53:34 -05:00
|
|
|
string_file.string(), module_list->modules[2].location);
|
2014-11-07 10:01:17 -05:00
|
|
|
ASSERT_TRUE(module_3);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
EXPECT_EQ(module_3->version, MinidumpModuleCrashpadInfo::kVersion);
|
2014-11-07 10:01:17 -05:00
|
|
|
|
|
|
|
const MinidumpRVAList* list_annotations_3 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpRVAList>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_3->list_annotations);
|
2014-11-07 10:01:17 -05:00
|
|
|
ASSERT_TRUE(list_annotations_3);
|
|
|
|
|
test: Use (actual, [un]expected) in gtest {ASSERT,EXPECT}_{EQ,NE}
gtest used to require (expected, actual) ordering for arguments to
EXPECT_EQ and ASSERT_EQ, and in failed test assertions would identify
each side as “expected” or “actual.” Tests in Crashpad adhered to this
traditional ordering. After a gtest change in February 2016, it is now
agnostic with respect to the order of these arguments.
This change mechanically updates all uses of these macros to (actual,
expected) by reversing them. This provides consistency with our use of
the logging CHECK_EQ and DCHECK_EQ macros, and makes for better
readability by ordinary native speakers. The rough (but working!)
conversion tool is
https://chromium-review.googlesource.com/c/466727/1/rewrite_expectassert_eq.py,
and “git cl format” cleaned up its output.
EXPECT_NE and ASSERT_NE never had a preferred ordering. gtest never made
a judgment that one side or the other needed to provide an “unexpected”
value. Consequently, some code used (unexpected, actual) while other
code used (actual, unexpected). For consistency with the new EXPECT_EQ
and ASSERT_EQ usage, as well as consistency with CHECK_NE and DCHECK_NE,
this change also updates these use sites to (actual, unexpected) where
one side can be called “unexpected” as, for example, std::string::npos
can be. Unfortunately, this portion was a manual conversion.
References:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#binary-comparison
https://github.com/google/googletest/commit/77d6b173380332b1c1bc540532641f410ec82d65
https://github.com/google/googletest/pull/713
Change-Id: I978fef7c94183b8b1ef63f12f5ab4d6693626be3
Reviewed-on: https://chromium-review.googlesource.com/466727
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-04-04 00:35:21 -04:00
|
|
|
ASSERT_EQ(list_annotations_3->count, annotations_vector_3.size());
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(string_file.string(),
|
|
|
|
list_annotations_3->children[0]),
|
|
|
|
kEntry3A);
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(string_file.string(),
|
|
|
|
list_annotations_3->children[1]),
|
|
|
|
kEntry3B);
|
2014-11-07 10:01:17 -05:00
|
|
|
|
|
|
|
const MinidumpSimpleStringDictionary* simple_annotations_3 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
|
2015-02-18 14:15:38 -05:00
|
|
|
string_file.string(), module_3->simple_annotations);
|
2014-11-07 10:01:17 -05:00
|
|
|
EXPECT_FALSE(simple_annotations_3);
|
2017-11-01 17:06:18 -04:00
|
|
|
|
|
|
|
EXPECT_FALSE(MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
|
|
|
|
string_file.string(), module_3->annotation_objects));
|
|
|
|
|
|
|
|
EXPECT_EQ(module_list->modules[3].minidump_module_list_index, 4u);
|
|
|
|
const MinidumpModuleCrashpadInfo* module_4 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfo>(
|
|
|
|
string_file.string(), module_list->modules[3].location);
|
|
|
|
ASSERT_TRUE(module_4);
|
|
|
|
|
|
|
|
EXPECT_EQ(module_4->version, MinidumpModuleCrashpadInfo::kVersion);
|
|
|
|
|
|
|
|
EXPECT_FALSE(MinidumpWritableAtLocationDescriptor<MinidumpRVAList>(
|
|
|
|
string_file.string(), module_4->list_annotations));
|
|
|
|
EXPECT_FALSE(
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>(
|
|
|
|
string_file.string(), module_4->simple_annotations));
|
|
|
|
|
|
|
|
auto* annotation_list_4 =
|
|
|
|
MinidumpWritableAtLocationDescriptor<MinidumpAnnotationList>(
|
|
|
|
string_file.string(), module_4->annotation_objects);
|
|
|
|
ASSERT_TRUE(annotation_list_4);
|
|
|
|
|
|
|
|
ASSERT_EQ(annotation_list_4->count, 1u);
|
|
|
|
|
|
|
|
EXPECT_EQ(MinidumpUTF8StringAtRVAAsString(string_file.string(),
|
|
|
|
annotation_list_4->objects[0].name),
|
|
|
|
annotation.name);
|
|
|
|
EXPECT_EQ(annotation_list_4->objects[0].type, annotation.type);
|
|
|
|
EXPECT_EQ(annotation_list_4->objects[0].reserved, 0u);
|
|
|
|
EXPECT_EQ(MinidumpByteArrayAtRVA(string_file.string(),
|
|
|
|
annotation_list_4->objects[0].value),
|
|
|
|
annotation.value);
|
2014-10-28 17:00:46 -04:00
|
|
|
}
|
|
|
|
|
2014-10-24 14:44:55 -04:00
|
|
|
} // namespace
|
|
|
|
} // namespace test
|
|
|
|
} // namespace crashpad
|