Addressed asan failures caused by misuse of APIs within unit tests.

pull/1432/head
Jared Mulconry 2017-10-01 19:25:43 +11:00 committed by Turo Lamminen
parent 1095ec454b
commit 29e46e4bb8
2 changed files with 3 additions and 2 deletions

View File

@ -106,8 +106,9 @@ TEST_F( utObjTools, countComponents_TwoLines_Success ) {
TestObjFileParser test_parser;
std::string data( "-2.061493116917992e-15 -0.9009688496589661 \\\n-0.4338837265968323" );
std::vector<char> buffer;
buffer.resize( data.size() );
buffer.resize( data.size() + 1 );
::memcpy( &buffer[ 0 ], &data[ 0 ], data.size() );
buffer[ buffer.size() - 1 ] = '\0';
test_parser.setBuffer( buffer );
size_t numComps = test_parser.testGetNumComponentsInDataDefinition();

View File

@ -92,7 +92,7 @@ TEST_F(SharedPPDataTest, testPODProperty)
// ------------------------------------------------------------------------------------------------
TEST_F(SharedPPDataTest, testPropertyPointer)
{
int *i = new int[35];
int *i = new int;
shared->AddProperty("test16",i);
int* o;
EXPECT_TRUE(shared->GetProperty("test16",o));