Skip to content

Commit

Permalink
Format latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SSoelvsten committed May 30, 2024
1 parent 6df0007 commit f2f0bf9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 56 deletions.
28 changes: 14 additions & 14 deletions src/adiar/bdd/bdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ namespace adiar

//////////////////////////////////////////////////////////////////////////////////////////////////
// Operators
#define __BDD_OPER(out_t, op) \
out_t operator op(__bdd&& lhs, __bdd&& rhs) \
{ \
return bdd(std::move(lhs)) op bdd(std::move(rhs)); \
} \
\
out_t operator op(const bdd& lhs, __bdd&& rhs) \
{ \
return lhs op bdd(std::move(rhs)); \
} \
\
out_t operator op(__bdd&& lhs, const bdd& rhs) \
{ \
return bdd(std::move(lhs)) op rhs; \
#define __BDD_OPER(out_t, op) \
out_t operator op(__bdd&& lhs, __bdd&& rhs) \
{ \
return bdd(std::move(lhs)) op bdd(std::move(rhs)); \
} \
\
out_t operator op(const bdd& lhs, __bdd&& rhs) \
{ \
return lhs op bdd(std::move(rhs)); \
} \
\
out_t operator op(__bdd&& lhs, const bdd& rhs) \
{ \
return bdd(std::move(lhs)) op rhs; \
}

//////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/adiar/zdd/zdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace adiar
// Operators (Assignment)

zdd&
zdd::operator=(const zdd & other)
zdd::operator=(const zdd& other)
{
this->negate = other.negate;
this->file = other.file;
Expand Down
60 changes: 19 additions & 41 deletions test/adiar/zdd/test_zdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ go_bandit([]() {

describe("operators", [&]() {
describe("==, !=", [&]() {
it("rejects Ø == {Ø}",
[&]() { AssertThat(terminal_F, Is().Not().EqualTo(terminal_T)); });
it("rejects Ø == {Ø}", [&]() { AssertThat(terminal_F, Is().Not().EqualTo(terminal_T)); });

it("accepts {{0}} == {{0}} (different files)", [&]() {
shared_levelized_file<zdd::node_type> other_nf;
Expand All @@ -114,13 +113,9 @@ go_bandit([]() {
AssertThat(x0, Is().EqualTo(other));
});

it("rejects {{0}} == {{1}}", [&]() {
AssertThat(x0, Is().Not().EqualTo(x1));
});
it("rejects {{0}} == {{1}}", [&]() { AssertThat(x0, Is().Not().EqualTo(x1)); });

it("rejects {{0}, {1}} == {{0}}", [&]() {
AssertThat(x0_or_x1, Is().Not().EqualTo(x0));
});
it("rejects {{0}, {1}} == {{0}}", [&]() { AssertThat(x0_or_x1, Is().Not().EqualTo(x0)); });
});

describe("~, &, |", [&]() {
Expand Down Expand Up @@ -242,13 +237,10 @@ go_bandit([]() {
AssertThat(A == terminal_F, Is().True());
});

it("computes +{{0}} == {{0}} [zdd&]", [&]() {
AssertThat(+x0 == x0, Is().True());
});
it("computes +{{0}} == {{0}} [zdd&]", [&]() { AssertThat(+x0 == x0, Is().True()); });

it("computes +{{0}} == {{0}} [__zdd&&]", [&]() {
AssertThat(+(x0 & x0_or_x1) == x0, Is().True());
});
it("computes +{{0}} == {{0}} [__zdd&&]",
[&]() { AssertThat(+(x0 & x0_or_x1) == x0, Is().True()); });

it("computes {{0}} + {{1}} == {{0}, {1}}",
[&]() { AssertThat((x0 + x1) == x0_or_x1, Is().True()); });
Expand Down Expand Up @@ -323,21 +315,17 @@ go_bandit([]() {
});

describe("==, !=", [&]() {
it("checks two derivations of same __bdd&& [==]", [&]() {
AssertThat((x0 | x1) == ((x0_or_x1 - x1) | x1), Is().True());
});
it("checks two derivations of same __bdd&& [==]",
[&]() { AssertThat((x0 | x1) == ((x0_or_x1 - x1) | x1), Is().True()); });

it("checks two derivations of same __bdd&& [!=]", [&]() {
AssertThat((x0 | x1) != ((x0_or_x1 - x1) | x1), Is().False());
});
it("checks two derivations of same __bdd&& [!=]",
[&]() { AssertThat((x0 | x1) != ((x0_or_x1 - x1) | x1), Is().False()); });

it("checks two derivations of different __bdd&& [==]", [&]() {
AssertThat((x0 | x1) == (x0_or_x1 - x1), Is().False());
});
it("checks two derivations of different __bdd&& [==]",
[&]() { AssertThat((x0 | x1) == (x0_or_x1 - x1), Is().False()); });

it("checks two derivations of different __bdd&& [!=]", [&]() {
AssertThat((x0 | x1) != (x0_or_x1 - x1), Is().True());
});
it("checks two derivations of different __bdd&& [!=]",
[&]() { AssertThat((x0 | x1) != (x0_or_x1 - x1), Is().True()); });
});

describe("<, <=, >, >=", [&]() {
Expand All @@ -346,9 +334,7 @@ go_bandit([]() {
AssertThat(x0 < (x0 | x1), Is().True());
});

it("checks {{0}} < {{1}}", [&]() {
AssertThat(x0 < x1, Is().False());
});
it("checks {{0}} < {{1}}", [&]() { AssertThat(x0 < x1, Is().False()); });

it("checks {{0}, {1}} < {{0}, {1}}", [&]() {
AssertThat((x0 | x1) < x0_or_x1, Is().False());
Expand All @@ -366,27 +352,19 @@ go_bandit([]() {
AssertThat((x0 | x1) <= (x0 | x1), Is().True());
});

it("checks {{0}} <= {{1}}", [&]() {
AssertThat(x0 <= x1, Is().False());
});
it("checks {{0}} <= {{1}}", [&]() { AssertThat(x0 <= x1, Is().False()); });

it("checks {{0}, {1}} > {{0}}", [&]() {
AssertThat(x0_or_x1 > x0, Is().True());
});
it("checks {{0}, {1}} > {{0}}", [&]() { AssertThat(x0_or_x1 > x0, Is().True()); });

it("checks {{0}} > {{1}}", [&]() {
AssertThat(x0 > x1, Is().False());
});
it("checks {{0}} > {{1}}", [&]() { AssertThat(x0 > x1, Is().False()); });

it("checks {{0}, {1}} > {{0}, {1}}", [&]() {
AssertThat((x0 | x1) > x0_or_x1, Is().False());
AssertThat(x0_or_x1 > (x0 | x1), Is().False());
AssertThat((x0 | x1) > (x0 | x1), Is().False());
});

it("checks {{0}, {1}} >= {{0}}", [&]() {
AssertThat(x0_or_x1 >= x0, Is().True());
});
it("checks {{0}, {1}} >= {{0}}", [&]() { AssertThat(x0_or_x1 >= x0, Is().True()); });

it("checks {{0}, {1}} >= {{0}, {1}}", [&]() {
AssertThat((x0 | x1) >= x0_or_x1, Is().True());
Expand Down

0 comments on commit f2f0bf9

Please sign in to comment.