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

Unified Diff: sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
diff --git a/sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc b/sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
index d6c88d6fb3a5b27a4c473aa7742c580b31c6cc32..40a99e4b6abd22a875e4c09c95c5caa5ac254f31 100644
--- a/sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
+++ b/sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
@@ -465,9 +465,9 @@ int ArmPrivateSysnoToErrno(int sysno) {
class ArmPrivatePolicy : public Policy {
public:
ArmPrivatePolicy() {}
- virtual ~ArmPrivatePolicy() {}
+ ~ArmPrivatePolicy() override {}
- virtual ResultExpr EvaluateSyscall(int sysno) const override {
+ ResultExpr EvaluateSyscall(int sysno) const override {
DCHECK(SandboxBPF::IsValidSyscallNumber(sysno));
// Start from |__ARM_NR_set_tls + 1| so as not to mess with actual
// ARM private system calls.
@@ -906,7 +906,7 @@ ResultExpr SimpleCondTestPolicy::EvaluateSyscall(int sysno) const {
flags_argument_position = 2;
// Allow opening files for reading, but don't allow writing.
- COMPILE_ASSERT(O_RDONLY == 0, O_RDONLY_must_be_all_zero_bits);
+ static_assert(O_RDONLY == 0, "O_RDONLY must be all zero bits");
const Arg<int> flags(flags_argument_position);
return If((flags & O_ACCMODE) != 0, Error(EROFS)).Else(Allow());
}
@@ -951,9 +951,10 @@ class EqualityStressTest {
// We are actually constructing a graph of ArgValue objects. This
// graph will later be used to a) compute our sandbox policy, and
// b) drive the code that verifies the output from the BPF program.
- COMPILE_ASSERT(
+ static_assert(
kNumTestCases < (int)(MAX_PUBLIC_SYSCALL - MIN_SYSCALL - 10),
- num_test_cases_must_be_significantly_smaller_than_num_system_calls);
+ "kNumTestCases must be significantly smaller than the number "
+ "of system calls");
for (int sysno = MIN_SYSCALL, end = kNumTestCases; sysno < end; ++sysno) {
if (IsReservedSyscall(sysno)) {
// Skip reserved system calls. This ensures that our test frame
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698