-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Simplify Boolean Expression test file diff
- Loading branch information
1 parent
b0aabe4
commit 2b3d6ef
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |