Add tests for pointer comparison

This commit is contained in:
2018-02-14 16:11:59 +01:00
parent 498a78cd9f
commit 6c30e282ef
2 changed files with 23 additions and 0 deletions

View File

@@ -46,3 +46,23 @@ TEST(FAIL_two_equal_strings)
{
ASSERT_EQ_STR("Hello", "World", 5);
}
int a, b;
TEST(two_equal_pointers)
{
ASSERT_EQ_PTR(&a, &a);
}
TEST(FAIL_two_equal_pointers)
{
ASSERT_EQ_PTR(&a, &b);
}
TEST(two_different_pointers)
{
ASSERT_NEQ_PTR(&a, &b);
}
TEST(FAIL_two_different_pointers)
{
ASSERT_NEQ_PTR(&a, &a);
}