Add a test that forces a crash. This makes it easy to manually check the output of a segfault with a complicated backtrace; the actual automation doesn't help us except to verify that the crash continues to happen as excepted.

This commit is contained in:
Josh Matthews 2016-05-31 17:14:52 -04:00
parent d4a5b45242
commit 99e436eb05
6 changed files with 33 additions and 0 deletions

View file

@ -571,6 +571,15 @@ impl TestBindingMethods for TestBinding {
fn FuncControlledAttributeEnabled(&self) -> bool { false }
fn FuncControlledMethodDisabled(&self) {}
fn FuncControlledMethodEnabled(&self) {}
#[allow(unsafe_code)]
fn CrashHard(&self) {
static READ_ONLY_VALUE: i32 = 0;
unsafe {
let p: *mut u32 = &READ_ONLY_VALUE as *const _ as *mut _;
ptr::write_volatile(p, 0xbaadc0de);
}
}
}
impl TestBinding {

View file

@ -456,3 +456,8 @@ interface TestBinding {
[Func="TestBinding::condition_satisfied"]
const unsigned short funcControlledConstEnabled = 0;
};
partial interface TestBinding {
[Pref="dom.testable_crash.enabled"]
void crashHard();
};