Skip to content

Commit

Permalink
- Remaining tests for three-valued logical operators.
Browse files Browse the repository at this point in the history
-  No tests yet for boolean equality.

	modified:   c-examples/tests/ExpressionsBoolean_Tests.cpp
  • Loading branch information
Victor Bandur committed Apr 29, 2016
1 parent 4bfcba9 commit 1ee90ea
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions c-examples/tests/ExpressionsBoolean_Tests.cpp
Expand Up @@ -136,6 +136,12 @@ TEST(Expression_Boolean, xorExp)
EXPECT_EQ (true,res->value.boolVal);
vdmFree(res);

vdmFree(t);
t = NULL;
res = vdmXor(t, t1);
EXPECT_EQ(NULL, res);

vdmFree(res);
vdmFree(t);
vdmFree(t1);
}
Expand All @@ -151,6 +157,30 @@ TEST(Expression_Boolean, implicationExp)
EXPECT_EQ (false,res->value.boolVal);
vdmFree(res);

vdmFree(t);
t = NULL;
res = vdmImplies(t, t1);
EXPECT_EQ(NULL, res);
vdmFree(res);

vdmFree(t1);
t = newBool(true);
t1 = NULL;
res = vdmImplies(t, t1);
EXPECT_EQ(NULL, res);
vdmFree(res);

t1 = newBool(false);
res = vdmImplies(t, t1);
EXPECT_EQ(false, res->value.boolVal);
vdmFree(res);

vdmFree(t);
t = NULL;
res = vdmImplies(t1, t);
EXPECT_EQ(true, res->value.boolVal);

vdmFree(res);
vdmFree(t);
vdmFree(t1);
}
Expand All @@ -170,6 +200,11 @@ TEST(Expression_Boolean, biimplicationExp)

vdmFree(t);
vdmFree(t1);
t = NULL;
t1 = NULL;
res = vdmBiimplication(t, t1);
EXPECT_EQ(NULL, res);
res = vdmBiimplication(t1, t);
}

TEST(Expression_Boolean, equalityExp)
Expand Down

0 comments on commit 1ee90ea

Please sign in to comment.