Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
adpaco-aws committed Jun 20, 2023
1 parent b77937e commit ed5d4ef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
26 changes: 20 additions & 6 deletions kani-driver/src/call_cbmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,30 @@ impl GlobalCondition {
}
}

pub fn blame_properties<'a>(&self, properties: &'a[Property]) -> Vec<&'a Property> {
pub fn blame_properties<'a>(&self, properties: &'a [Property]) -> Vec<&'a Property> {
match &self {
Self::ShouldPanic { status, .. } => match *status {
FailedProperties::None => properties.iter().filter(|prop| prop.property_class() == "assertion" && prop.status != CheckStatus::Failure).collect(),
FailedProperties::Other => properties.iter().filter(|prop| prop.property_class() != "assertion" && prop.status == CheckStatus::Failure).collect(),
FailedProperties::None => properties
.iter()
.filter(|prop| {
prop.property_class() == "assertion" && prop.status != CheckStatus::Failure
})
.collect(),
FailedProperties::Other => properties
.iter()
.filter(|prop| {
prop.property_class() != "assertion" && prop.status == CheckStatus::Failure
})
.collect(),
_ => vec![],
},
Self::FailUncoverable { .. } =>
properties.iter().filter(|prop| prop.property_class() == "cover" && prop.status != CheckStatus::Satisfied).collect(),
}
Self::FailUncoverable { .. } => properties
.iter()
.filter(|prop| {
prop.property_class() == "cover" && prop.status != CheckStatus::Satisfied
})
.collect(),
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion kani-driver/src/cbmc_property_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ pub fn format_result(
));
if !cond.passed() {
for prop in blame_properties.unwrap() {
let failure_message = build_failure_message(prop.description.clone(), &prop.trace.clone());
let failure_message =
build_failure_message(prop.description.clone(), &prop.trace.clone());
result_str.push_str(&failure_message);
}
}
Expand Down

0 comments on commit ed5d4ef

Please sign in to comment.