1
0
mirror of https://github.com/ellmau/adf-obdd.git synced 2025-12-19 09:29:36 +01:00

Fix tests, which are changed due to the new feature flag

This commit is contained in:
Stefan Ellmauthaler 2022-06-23 14:02:53 +02:00
parent 4eabf1692b
commit 0dc35d39d5
Failed to extract signature
3 changed files with 48 additions and 40 deletions

View File

@ -45,4 +45,4 @@ adhoccounting = [] # count paths ad-hoc - disable if counting is not needed
importexport = []
variablelist = [ "HashSet" ]
HashSet = []
adhoccountmodels = [ "adhoccounting" ] # count models as well as paths ad-hoc
adhoccountmodels = [ "adhoccounting" ] # count models as well as paths ad-hoc note that facet methods will need this feature too

View File

@ -1146,6 +1146,7 @@ mod test {
}
}
#[cfg(feature = "adhoccountmodels")]
#[test]
fn formulacounts() {
let parser = AdfParser::default();
@ -1160,7 +1161,7 @@ mod test {
fn adf_default() {
let _adf = Adf::default();
}
#[cfg(feature = "adhoccountmodels")]
#[test]
fn facet_counts() {
let parser = AdfParser::default();

View File

@ -645,6 +645,7 @@ mod test {
let formula3 = bdd.xor(v1, v2);
let formula4 = bdd.and(v3, formula2);
#[cfg(feature = "adhoccountmodels")]
assert_eq!(bdd.models(v1, false), (1, 1).into());
let mut x = bdd.count_cache.get_mut().iter().collect::<Vec<_>>();
x.sort();
@ -653,6 +654,8 @@ mod test {
log::debug!("{:?}", x);
}
log::debug!("{:?}", x);
#[cfg(feature = "adhoccountmodels")]
{
assert_eq!(bdd.models(formula1, false), (3, 1).into());
assert_eq!(bdd.models(formula2, false), (1, 3).into());
assert_eq!(bdd.models(formula3, false), (2, 2).into());
@ -667,6 +670,7 @@ mod test {
assert_eq!(bdd.models(formula4, true), (5, 3).into());
assert_eq!(bdd.models(Term::TOP, true), (0, 1).into());
assert_eq!(bdd.models(Term::BOT, true), (1, 0).into());
}
assert_eq!(bdd.paths(formula1, false), (2, 1).into());
assert_eq!(bdd.paths(formula2, false), (1, 2).into());
@ -709,6 +713,8 @@ mod test {
((1, 0).into(), (1, 0).into(), 0)
);
#[cfg(feature = "adhoccountmodels")]
{
assert_eq!(
bdd.modelcount_naive(formula4),
bdd.modelcount_memoization(formula4)
@ -735,6 +741,7 @@ mod test {
bdd.modelcount_naive(Term::BOT),
bdd.modelcount_memoization(Term::BOT)
);
}
assert_eq!(bdd.max_depth(Term::BOT), 0);
assert_eq!(bdd.max_depth(v1), 1);