Covery: 152484 Buffer not null terminated

pull/1007/head
wise86Android 2016-09-18 21:37:31 +02:00
parent f51cd4c6d4
commit 99c34961b9
1 changed files with 5 additions and 2 deletions

View File

@ -48,10 +48,13 @@ class BlenderIntermediateTest : public ::testing::Test {
// empty // empty
}; };
#define NAME_1 "name1"
#define NAME_2 "name2"
TEST_F( BlenderIntermediateTest,ConversionData_ObjectCompareTest ) { TEST_F( BlenderIntermediateTest,ConversionData_ObjectCompareTest ) {
Object obj1, obj2; Object obj1, obj2;
strncpy( obj1.id.name, "name1", 5 ); strncpy( obj1.id.name, NAME_1, sizeof(NAME_1) );
strncpy( obj2.id.name, "name2", 5 ); strncpy( obj2.id.name, NAME_2, sizeof(NAME_2) );
Blender::ObjectCompare cmp_false; Blender::ObjectCompare cmp_false;
bool res( cmp_false( &obj1, &obj2 ) ); bool res( cmp_false( &obj1, &obj2 ) );
EXPECT_FALSE( res ); EXPECT_FALSE( res );