OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <fcntl.h> | 5 #include <fcntl.h> |
6 #include <poll.h> | 6 #include <poll.h> |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <sys/resource.h> | 9 #include <sys/resource.h> |
10 #include <sys/time.h> | 10 #include <sys/time.h> |
11 #include <unistd.h> | 11 #include <unistd.h> |
12 | 12 |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/third_party/valgrind/valgrind.h" | 14 #include "base/third_party/valgrind/valgrind.h" |
15 #include "sandbox/linux/tests/unit_tests.h" | 15 #include "sandbox/linux/tests/unit_tests.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 std::string TestFailedMessage(const std::string& msg) { | 18 std::string TestFailedMessage(const std::string& msg) { |
19 return msg.empty() ? "" : "Actual test failure: " + msg; | 19 return msg.empty() ? std::string() : "Actual test failure: " + msg; |
20 } | 20 } |
21 | 21 |
22 int GetSubProcessTimeoutTimeInSeconds() { | 22 int GetSubProcessTimeoutTimeInSeconds() { |
23 // 10s ought to be enough for anybody. | 23 // 10s ought to be enough for anybody. |
24 return 10; | 24 return 10; |
25 } | 25 } |
26 | 26 |
27 // Returns the number of threads of the current process or -1. | 27 // Returns the number of threads of the current process or -1. |
28 int CountThreads() { | 28 int CountThreads() { |
29 struct stat task_stat; | 29 struct stat task_stat; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 fflush(stderr); | 219 fflush(stderr); |
220 _exit(kExitWithAssertionFailure); | 220 _exit(kExitWithAssertionFailure); |
221 } | 221 } |
222 | 222 |
223 void UnitTests::IgnoreThisTest() { | 223 void UnitTests::IgnoreThisTest() { |
224 fflush(stderr); | 224 fflush(stderr); |
225 _exit(kIgnoreThisTest); | 225 _exit(kIgnoreThisTest); |
226 } | 226 } |
227 | 227 |
228 } // namespace | 228 } // namespace |
OLD | NEW |