Skip to content

Commit

Permalink
Add Simplify Boolean Expression test file diff
Browse files Browse the repository at this point in the history
  • Loading branch information
LegalizeAdulthood committed Jan 10, 2024
1 parent b0aabe4 commit 2b3d6ef
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions results/file-diffs/SB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
diff --git a/RefactorTest/SimplifyBooleanExpression.cpp b/RefactorTest/SimplifyBooleanExpression.cpp
index 22c075d..5860bae 100644
--- a/RefactorTest/SimplifyBooleanExpression.cpp
+++ b/RefactorTest/SimplifyBooleanExpression.cpp
@@ -28,55 +28,55 @@ void TestSimplifyBooleanExpression()
{
bool b1 = true;
// #TEST#: SB1 Simplify boolean rhs to b1
- bool b2 = true && b1;
+ bool b2 = b1;
REQUIRE_EQUAL(true, b2);

// #TEST#: SB2 Simplify boolean rhs to false
- bool b3 = false && b1;
+ bool b3 = false;
REQUIRE_EQUAL(true, !b3);

// #TEST#: SB3 Simplify boolean rhs to true
- bool b4 = true || b1;
+ bool b4 = true;
REQUIRE_EQUAL(true, b4);

// #TEST#: SB4 Simplify boolean rhs to b1
- bool b5 = false || b1;
+ bool b5 = b1;
REQUIRE_EQUAL(true, b5);

// #TEST#: SB5 Simplify boolean rhs to b1
- bool b6 = b1 && (true && (false || true));
+ bool b6 = b1;
REQUIRE_EQUAL(true, b6);

// #TEST#: SB6 Simplify boolean rhs to b1
- bool b7 = b1 == true;
+ bool b7 = b1;
REQUIRE_EQUAL(true, b7);

// #TEST#: SB7 Simplify boolean rhs to !b1
- bool b8 = b1 == false;
+ bool b8 = !b1;
REQUIRE_EQUAL(true, !b8);

// #TEST#: SB8 Simplify boolean rhs to b1
- bool b9 = b1 && b1;
+ bool b9 = b1;
REQUIRE_EQUAL(true, b9);

// #TEST#: SB9 Simplify boolean rhs to b1
- bool b10 = b1 || b1;
+ bool b10 = b1;
REQUIRE_EQUAL(true, b10);

// #TEST#: SB10 Simplify boolean rhs to (i == 3)
int const i = getSomething();
- bool b11 = !(i != 3);
+ bool b11 = i == 3;
REQUIRE_EQUAL(true, b11);

// #TEST#: SB11 Simplify boolean rhs to (i != 3)
- bool b12 = !(i == 3);
+ bool b12 = i != 3;
REQUIRE_EQUAL(true, !b12);

// #TEST#: SB12 Simplify boolean rhs to (i > 3)
- bool b13 = !(i <= 3);
+ bool b13 = i > 3;
REQUIRE_EQUAL(true, !b13);

// #TEST#: SB13 Simplify boolean rhs to (i < 3)
- bool b14 = !(i >= 3);
+ bool b14 = i < 3;
REQUIRE_EQUAL(true, !b14);
}

0 comments on commit 2b3d6ef

Please sign in to comment.