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

Unified Diff: sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc

Issue 1302043002: sandbox/linux: refactor bpf_dsl dependency on die.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use logging.h instead of errx Created 5 years, 4 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
Index: sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
diff --git a/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc b/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
index e884774146d58738b5cbb4342fc4cb4508081e75..a0eeb3b713a0a7e2747bdd95db20987e28cedca3 100644
--- a/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
+++ b/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
@@ -76,6 +76,15 @@ void EnableUnsafeTraps() {
Die::SuppressInfoMessages(true);
}
+intptr_t KillTrap(const struct arch_seccomp_data& args, void* aux) {
+ BPF_ASSERT(false);
+ for (;;) _exit(1);
+}
+
+ResultExpr Kill(const char *msg) {
+ return Trap(KillTrap, msg);
+}
+
// BPF_TEST does a lot of the boiler-plate code around setting up a
// policy and optional passing data between the caller, the policy and
// any Trap() handlers. This is great for writing short and concise tests,

Powered by Google App Engine
This is Rietveld 408576698