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

Side by Side Diff: syzygy/agent/asan/rtl_impl_unittest.cc

Issue 2576003002: Add the ability to defer the initialization of the SyzyAsan crash reporter. (Closed)
Patch Set: Add an entry point to reinitialize the crash reporter. Created 4 years 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
OLDNEW
1 // Copyright 2012 Google Inc. All Rights Reserved. 1 // Copyright 2012 Google Inc. 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,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 #include "syzygy/agent/asan/rtl_impl.h" 15 #include "syzygy/agent/asan/rtl_impl.h"
16 16
17 #include <windows.h> // NOLINT 17 #include <windows.h> // NOLINT
18 18
19 #include "base/rand_util.h" 19 #include "base/rand_util.h"
20 #include "gtest/gtest.h" 20 #include "gtest/gtest.h"
21 #include "syzygy/agent/asan/reporter.h"
21 #include "syzygy/agent/asan/runtime.h" 22 #include "syzygy/agent/asan/runtime.h"
22 #include "syzygy/agent/asan/shadow.h" 23 #include "syzygy/agent/asan/shadow.h"
23 #include "syzygy/agent/asan/unittest_util.h" 24 #include "syzygy/agent/asan/unittest_util.h"
24 #include "syzygy/core/unittest_util.h" 25 #include "syzygy/core/unittest_util.h"
25 26
26 namespace { 27 namespace {
27 28
28 class AsanRtlImplTest : public testing::TestWithAsanLogger { 29 class AsanRtlImplTest : public testing::TestWithAsanLogger {
29 public: 30 public:
30 AsanRtlImplTest() : heap_(NULL) { 31 AsanRtlImplTest() : heap_(NULL) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 &compat_flag, sizeof(compat_flag))); 145 &compat_flag, sizeof(compat_flag)));
145 } 146 }
146 147
147 TEST_F(AsanRtlImplTest, SetInformationWithNullHeapPtr) { 148 TEST_F(AsanRtlImplTest, SetInformationWithNullHeapPtr) {
148 // The documentation of HeapSetInformation specify that the heap handle is 149 // The documentation of HeapSetInformation specify that the heap handle is
149 // optional. 150 // optional.
150 ASSERT_TRUE( 151 ASSERT_TRUE(
151 asan_HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, 152 asan_HeapSetInformation(NULL, HeapEnableTerminationOnCorruption,
152 NULL, 0)); 153 NULL, 0));
153 } 154 }
155
156 TEST_F(AsanRtlImplTest, ReinitializeCrashHandler) {
157 agent::asan::ReporterInterface* reporter = asan_runtime_.crash_reporter();
Sébastien Marchand 2016/12/14 22:56:25 This test doesn't work as this test fixture can't
158 EXPECT_NE(nullptr, reporter);
159 asan_ReinitializeCrashHandler();
160 EXPECT_NE(nullptr, asan_runtime_.crash_reporter());
161 EXPECT_NE(reporter, asan_runtime_.crash_reporter());
162 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698