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

Unified Diff: syzygy/agent/asan/runtime_unittest.cc

Issue 1992773002: [SyzyAsan] Enable Crashpad reporter as a 50/50 experiment. (Closed) Base URL: https://github.com/google/syzygy.git@master
Patch Set: Cleanup + unittests. Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: syzygy/agent/asan/runtime_unittest.cc
diff --git a/syzygy/agent/asan/runtime_unittest.cc b/syzygy/agent/asan/runtime_unittest.cc
index 091f8ab3efec6db5c2d11c36a8acadbff2deb8ff..4a3c2cf000b3a8adf5bdea3cfafbee6690f1eade 100644
--- a/syzygy/agent/asan/runtime_unittest.cc
+++ b/syzygy/agent/asan/runtime_unittest.cc
@@ -288,22 +288,12 @@ TEST_F(AsanRuntimeTest, PropagateFeatureSet) {
ASSERT_NO_FATAL_FAILURE(
asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
- AsanFeatureSet valid_feature_sets[] = {
- 0,
- ASAN_FEATURE_ENABLE_LARGE_BLOCK_HEAP,
- ASAN_FEATURE_ENABLE_PAGE_PROTECTIONS,
- ASAN_FEATURE_ENABLE_PAGE_PROTECTIONS |
- ASAN_FEATURE_ENABLE_LARGE_BLOCK_HEAP};
-
- size_t number_of_valid_features = 0U;
- for (size_t i = 0; i < sizeof(kAsanValidFeatures) * 8; ++i) {
- if ((kAsanDeprecatedFeatures & (1 << i)) != 0U)
- number_of_valid_features++;
- }
-
- EXPECT_EQ(arraysize(valid_feature_sets), 1 << number_of_valid_features);
+ for (uint32_t feature_set = 0; feature_set < ASAN_FEATURE_MAX;
+ ++feature_set) {
+ // Skip feature sets that enable deprecated features.
+ if (feature_set & kAsanDeprecatedFeatures)
+ continue;
- for (auto feature_set : valid_feature_sets) {
asan_runtime_.PropagateFeatureSet(feature_set);
::common::AsanParameters expected_params = {};
::common::SetDefaultAsanParameters(&expected_params);
@@ -315,6 +305,11 @@ TEST_F(AsanRuntimeTest, PropagateFeatureSet) {
static_cast<TestBlockHeapManager*>(asan_runtime_.heap_manager_.get());
EXPECT_EQ(test_block_heap_manager->enable_page_protections_,
((feature_set & ASAN_FEATURE_ENABLE_PAGE_PROTECTIONS) != 0U));
+
+ // Expect the Crashpad bit to always be cleared, as the crash reporter
+ // can't be initialized without a Crashpad server running.
+ EXPECT_EQ(0u,
+ asan_runtime_.GetEnabledFeatureSet() & ASAN_FEATURE_ENABLE_CRASHPAD);
}
ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());

Powered by Google App Engine
This is Rietveld 408576698