Created
August 23, 2013 11:54
-
-
Save vigsterkr/6318518 to your computer and use it in GitHub Desktop.
new clone_equals test
This file contains hidden or 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
TEST(SGObject,clone_equals_{{class}}) | |
{ | |
const char* class_name="{{class}}"; | |
CSGObject* object = new_sgserializable(class_name, PT_NOT_GENERIC); | |
ASSERT_TRUE(object != NULL); | |
/* test for get_name() */ | |
ASSERT_TRUE(strcmp(object->get_name(), class_name) == 0); | |
/* test for .equals() */ | |
CSGObject* object2 = new_sgserializable(class_name, PT_NOT_GENERIC); | |
ASSERT_TRUE(object2 != NULL); | |
ASSERT_TRUE(object->equals(object2)); | |
SG_UNREF(object2); | |
/* test for .clone() */ | |
CSGObject* clone = object->clone(); | |
ASSERT_TRUE(clone != NULL); | |
/* test for .clone() + .equals() */ | |
EXPECT_TRUE(object->equals(clone)); | |
SG_UNREF(object); | |
SG_UNREF(clone); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment