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

Side by Side Diff: util/mach/exception_ports_test.cc

Issue 635883002: Don’t use using directives (“using namespace”) in tests (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « util/mach/exception_behaviors_test.cc ('k') | util/mach/mach_extensions_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 15 matching lines...) Expand all
26 #include "base/strings/stringprintf.h" 26 #include "base/strings/stringprintf.h"
27 #include "gtest/gtest.h" 27 #include "gtest/gtest.h"
28 #include "util/file/fd_io.h" 28 #include "util/file/fd_io.h"
29 #include "util/mach/exc_server_variants.h" 29 #include "util/mach/exc_server_variants.h"
30 #include "util/mach/mach_extensions.h" 30 #include "util/mach/mach_extensions.h"
31 #include "util/misc/scoped_forbid_return.h" 31 #include "util/misc/scoped_forbid_return.h"
32 #include "util/synchronization/semaphore.h" 32 #include "util/synchronization/semaphore.h"
33 #include "util/test/mac/mach_errors.h" 33 #include "util/test/mac/mach_errors.h"
34 #include "util/test/mac/mach_multiprocess.h" 34 #include "util/test/mac/mach_multiprocess.h"
35 35
36 namespace crashpad {
37 namespace test {
36 namespace { 38 namespace {
37 39
38 using namespace crashpad;
39 using namespace crashpad::test;
40
41 // Calls GetExceptionPorts() on its |exception_ports| argument to look up the 40 // Calls GetExceptionPorts() on its |exception_ports| argument to look up the
42 // EXC_MASK_CRASH handler. If |expect_port| is not MACH_PORT_NULL, it expects to 41 // EXC_MASK_CRASH handler. If |expect_port| is not MACH_PORT_NULL, it expects to
43 // find a handler for this mask whose port matches |expect_port| and whose 42 // find a handler for this mask whose port matches |expect_port| and whose
44 // behavior matches |expect_behavior| exactly. In this case, if 43 // behavior matches |expect_behavior| exactly. In this case, if
45 // |expect_behavior| is a state-carrying behavior, the looked-up thread state 44 // |expect_behavior| is a state-carrying behavior, the looked-up thread state
46 // flavor is expected to be MACHINE_THREAD_STATE, otherwise, it is expected to 45 // flavor is expected to be MACHINE_THREAD_STATE, otherwise, it is expected to
47 // be THREAD_STATE_NONE. If |expect_port| is MACH_PORT_NULL, no handler for 46 // be THREAD_STATE_NONE. If |expect_port| is MACH_PORT_NULL, no handler for
48 // EXC_MASK_CRASH is expected to be found. 47 // EXC_MASK_CRASH is expected to be found.
49 // 48 //
50 // A second GetExceptionPorts() lookup is also performed on a wider exception 49 // A second GetExceptionPorts() lookup is also performed on a wider exception
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 rv = implicit_host_ports.GetExceptionPorts( 566 rv = implicit_host_ports.GetExceptionPorts(
568 ExcMaskAll() | EXC_MASK_CRASH, &handlers); 567 ExcMaskAll() | EXC_MASK_CRASH, &handlers);
569 if (geteuid() == 0) { 568 if (geteuid() == 0) {
570 EXPECT_TRUE(rv); 569 EXPECT_TRUE(rv);
571 } else { 570 } else {
572 EXPECT_FALSE(rv); 571 EXPECT_FALSE(rv);
573 } 572 }
574 } 573 }
575 574
576 } // namespace 575 } // namespace
576 } // namespace test
577 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/mach/exception_behaviors_test.cc ('k') | util/mach/mach_extensions_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698