Skip to content

Commit

Permalink
test equals in symmetric way
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf committed Jan 8, 2018
1 parent 1e7d2a8 commit 1dff7cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/unit/base/clone_unittest.cc.jinja2
Expand Up @@ -29,6 +29,7 @@ TEST(SGObject,clone_equals_{{class}})
CSGObject* object2 = create(class_name, PT_NOT_GENERIC);
ASSERT_TRUE(object2 != NULL);
ASSERT_TRUE(object->equals(object2));
ASSERT_TRUE(object2->equals(object));
SG_UNREF(object2);

/* test for .clone() */
Expand All @@ -37,6 +38,7 @@ TEST(SGObject,clone_equals_{{class}})

/* test for .clone() + .equals() */
EXPECT_TRUE(object->equals(clone));
EXPECT_TRUE(clone->equals(object));

SG_UNREF(object);
SG_UNREF(clone);
Expand All @@ -62,6 +64,7 @@ TEST(SGObject,clone_equals_{{class}}_{{type}})
CSGObject* object2 = create(class_name, {{type}});
ASSERT_TRUE(object2 != NULL);
ASSERT_TRUE(object->equals(object2));
ASSERT_TRUE(object2->equals(object));
SG_UNREF(object2);

/* test for .clone() */
Expand All @@ -70,6 +73,7 @@ TEST(SGObject,clone_equals_{{class}}_{{type}})

/* test for .clone() + .equals() */
EXPECT_TRUE(object->equals(clone));
EXPECT_TRUE(clone->equals(object));

SG_UNREF(object);
SG_UNREF(clone);
Expand Down

0 comments on commit 1dff7cf

Please sign in to comment.