Addressed asan failures caused by misuse of APIs within unit tests.
parent
1095ec454b
commit
29e46e4bb8
|
@ -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();
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue