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

Side by Side Diff: util/mac/mac_util_test.mm

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/mac/launchd_test.mm ('k') | util/mac/mach_o_image_reader_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 16 matching lines...) Expand all
27 // When C++ exceptions are disabled, libstdc++ from GCC 4.2 defines |try| and 27 // When C++ exceptions are disabled, libstdc++ from GCC 4.2 defines |try| and
28 // |catch| so as to allow exception-expecting C++ code to build properly when 28 // |catch| so as to allow exception-expecting C++ code to build properly when
29 // language support for exceptions is not present. These macros interfere with 29 // language support for exceptions is not present. These macros interfere with
30 // the use of |@try| and |@catch| in Objective-C files such as this one. 30 // the use of |@try| and |@catch| in Objective-C files such as this one.
31 // Undefine these macros here, after everything has been #included, since there 31 // Undefine these macros here, after everything has been #included, since there
32 // will be no C++ uses and only Objective-C uses from this point on. 32 // will be no C++ uses and only Objective-C uses from this point on.
33 #undef try 33 #undef try
34 #undef catch 34 #undef catch
35 #endif 35 #endif
36 36
37 namespace crashpad {
38 namespace test {
37 namespace { 39 namespace {
38 40
39 using namespace crashpad;
40
41 // Runs /usr/bin/sw_vers with a single argument, |argument|, and places the 41 // Runs /usr/bin/sw_vers with a single argument, |argument|, and places the
42 // command’s standard output into |output| after stripping the trailing newline. 42 // command’s standard output into |output| after stripping the trailing newline.
43 // Fatal gtest assertions report tool failures, which the caller should check 43 // Fatal gtest assertions report tool failures, which the caller should check
44 // for with testing::Test::HasFatalFailure(). 44 // for with testing::Test::HasFatalFailure().
45 void SwVers(NSString* argument, std::string* output) { 45 void SwVers(NSString* argument, std::string* output) {
46 @autoreleasepool { 46 @autoreleasepool {
47 base::scoped_nsobject<NSPipe> pipe([[NSPipe alloc] init]); 47 base::scoped_nsobject<NSPipe> pipe([[NSPipe alloc] init]);
48 base::scoped_nsobject<NSTask> task([[NSTask alloc] init]); 48 base::scoped_nsobject<NSTask> task([[NSTask alloc] init]);
49 [task setStandardOutput:pipe]; 49 [task setStandardOutput:pipe];
50 [task setLaunchPath:@"/usr/bin/sw_vers"]; 50 [task setLaunchPath:@"/usr/bin/sw_vers"];
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // MacModelAndBoard() gets the data, so it wouldn’t be a very useful test. 140 // MacModelAndBoard() gets the data, so it wouldn’t be a very useful test.
141 std::string model; 141 std::string model;
142 std::string board; 142 std::string board;
143 MacModelAndBoard(&model, &board); 143 MacModelAndBoard(&model, &board);
144 144
145 EXPECT_FALSE(model.empty()); 145 EXPECT_FALSE(model.empty());
146 EXPECT_FALSE(board.empty()); 146 EXPECT_FALSE(board.empty());
147 } 147 }
148 148
149 } // namespace 149 } // namespace
150 } // namespace test
151 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/mac/launchd_test.mm ('k') | util/mac/mach_o_image_reader_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698