libpanic_unwind: Unconfigure tests during normal build
This commit is contained in:
parent
f53fc21ba0
commit
7d511cca5c
@ -6,6 +6,9 @@
|
||||
// are compiling it everywhere to avoid regressions.
|
||||
#![allow(unused)]
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
pub mod eh;
|
||||
|
||||
use core::mem;
|
||||
@ -68,21 +71,3 @@ impl DwarfReader {
|
||||
result as i64
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dwarf_reader() {
|
||||
let encoded: &[u8] = &[1, 2, 3, 4, 5, 6, 7, 0xE5, 0x8E, 0x26, 0x9B, 0xF1, 0x59, 0xFF, 0xFF];
|
||||
|
||||
let mut reader = DwarfReader::new(encoded.as_ptr());
|
||||
|
||||
unsafe {
|
||||
assert!(reader.read::<u8>() == u8::to_be(1u8));
|
||||
assert!(reader.read::<u16>() == u16::to_be(0x0203));
|
||||
assert!(reader.read::<u32>() == u32::to_be(0x04050607));
|
||||
|
||||
assert!(reader.read_uleb128() == 624485);
|
||||
assert!(reader.read_sleb128() == -624485);
|
||||
|
||||
assert!(reader.read::<i8>() == i8::to_be(-1));
|
||||
}
|
||||
}
|
||||
|
19
src/libpanic_unwind/dwarf/tests.rs
Normal file
19
src/libpanic_unwind/dwarf/tests.rs
Normal file
@ -0,0 +1,19 @@
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn dwarf_reader() {
|
||||
let encoded: &[u8] = &[1, 2, 3, 4, 5, 6, 7, 0xE5, 0x8E, 0x26, 0x9B, 0xF1, 0x59, 0xFF, 0xFF];
|
||||
|
||||
let mut reader = DwarfReader::new(encoded.as_ptr());
|
||||
|
||||
unsafe {
|
||||
assert!(reader.read::<u8>() == u8::to_be(1u8));
|
||||
assert!(reader.read::<u16>() == u16::to_be(0x0203));
|
||||
assert!(reader.read::<u32>() == u32::to_be(0x04050607));
|
||||
|
||||
assert!(reader.read_uleb128() == 624485);
|
||||
assert!(reader.read_sleb128() == -624485);
|
||||
|
||||
assert!(reader.read::<i8>() == i8::to_be(-1));
|
||||
}
|
||||
}
|
@ -27,7 +27,6 @@ pub fn check(root_path: &Path, bad: &mut bool) {
|
||||
};
|
||||
let fixme = [
|
||||
"liballoc",
|
||||
"libpanic_unwind/dwarf",
|
||||
"librustc",
|
||||
"librustc_data_structures",
|
||||
"librustc_incremental/persist",
|
||||
|
Loading…
Reference in New Issue
Block a user