Skip to content

Commit 371d21c

Browse files
authored
Fix tests (#234)
1 parent dcbbee9 commit 371d21c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

casr/tests/tests.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ fn test_return_av_gdb() {
13251325
);
13261326

13271327
// Disassembly test
1328-
assert!(disasm[0].contains("ret "), "Bad disassembly");
1328+
assert!(disasm[0].contains("ret"), "Bad disassembly");
13291329
assert!(
13301330
disasm[1].contains("nop") && disasm[1].contains("[rax+rax*1+0x0]"),
13311331
"Bad disassembly"
@@ -3055,7 +3055,9 @@ fn test_casr_san() {
30553055
.to_string();
30563056

30573057
assert_eq!(
3058-
3 + 2 * (std::env::consts::ARCH == "aarch64") as usize,
3058+
3 + 2
3059+
* (std::env::consts::ARCH == "aarch64"
3060+
|| lsb_release::info().unwrap().version == "24.04") as usize,
30593061
report["Stacktrace"].as_array().unwrap().iter().count()
30603062
);
30613063
assert_eq!(severity_type, "NOT_EXPLOITABLE");
@@ -4488,6 +4490,10 @@ fn test_casr_python_atheris() {
44884490
#[test]
44894491
#[cfg(target_arch = "x86_64")]
44904492
fn test_casr_san_python_df() {
4493+
if lsb_release::info().unwrap().version == "24.04" {
4494+
// Atheris fails to install, see https://github.com/google/atheris/issues/82
4495+
return;
4496+
}
44914497
// Double free python C extension test
44924498
// Copy files to tmp dir
44934499
let work_dir = abs_path("tests/casr_tests/python");
@@ -5914,7 +5920,11 @@ fn test_casr_csharp_native() {
59145920
.unwrap()
59155921
.to_string();
59165922

5917-
assert_eq!(19, report["Stacktrace"].as_array().unwrap().iter().count());
5923+
assert_eq!(
5924+
19 + (lsb_release::info().unwrap().version == "22.04"
5925+
|| lsb_release::info().unwrap().version == "24.04") as usize,
5926+
report["Stacktrace"].as_array().unwrap().iter().count()
5927+
);
59185928
assert_eq!(severity_type, "NOT_EXPLOITABLE");
59195929
assert_eq!(severity_desc, "AccessViolation");
59205930
assert!(report["CrashLine"]

0 commit comments

Comments
 (0)