Merge branch 'master' into kimkulling/close_memleak-issue-3416

kimkulling/close_memleak-issue-3416
Kim Kulling 2023-02-03 17:57:11 +01:00 committed by GitHub
commit c25b13e692
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 11 deletions

View File

@ -230,8 +230,8 @@ void TerragenImporter::InternReadFile(const std::string &pFile,
} }
// Get to the next chunk (4 byte aligned) // Get to the next chunk (4 byte aligned)
unsigned dtt = reader.GetCurrentPos(); unsigned dtt = reader.GetCurrentPos() & 0x3;
if (dtt & 0x3) { if (dtt) {
reader.IncPtr(4 - dtt); reader.IncPtr(4 - dtt);
} }
} }

View File

@ -48,13 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
class utTerragenImportExport : public AbstractImportExportBase { class utTerragenImportExport : public AbstractImportExportBase {
public: public:
virtual bool importerTest() { virtual bool importerTest() {
/*Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/TER/RealisticTerrain.ter", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/TER/RealisticTerrain.ter", aiProcess_ValidateDataStructure);
return nullptr != scene;*/ return nullptr != scene;
return true;
} }
}; };
TEST_F(utTerragenImportExport, importX3DFromFileTest) { TEST_F(utTerragenImportExport, importFromFileTest) {
EXPECT_TRUE(importerTest()); EXPECT_TRUE(importerTest());
} }

View File

@ -212,7 +212,7 @@ TEST_F( utMetadata, copy_test ) {
// int32_t test // int32_t test
{ {
int32_t v = 0; int32_t v = 127;
bool ok = copy.Get( "int32", v ); bool ok = copy.Get( "int32", v );
EXPECT_TRUE( ok ); EXPECT_TRUE( ok );
EXPECT_EQ( i32v, v ); EXPECT_EQ( i32v, v );
@ -220,7 +220,7 @@ TEST_F( utMetadata, copy_test ) {
// uint64_t test // uint64_t test
{ {
uint64_t v; uint64_t v = 255;
bool ok = copy.Get( "uint64", v ); bool ok = copy.Get( "uint64", v );
EXPECT_TRUE( ok ); EXPECT_TRUE( ok );
EXPECT_EQ( ui64v, v ); EXPECT_EQ( ui64v, v );
@ -228,14 +228,14 @@ TEST_F( utMetadata, copy_test ) {
// float test // float test
{ {
float v; float v = -9.9999f;
EXPECT_TRUE( copy.Get( "float", v ) ); EXPECT_TRUE( copy.Get( "float", v ) );
EXPECT_EQ( fv, v ); EXPECT_EQ( fv, v );
} }
// double test // double test
{ {
double v; double v = -99.99;
EXPECT_TRUE( copy.Get( "double", v ) ); EXPECT_TRUE( copy.Get( "double", v ) );
EXPECT_EQ( dv, v ); EXPECT_EQ( dv, v );
} }

View File

@ -81,7 +81,7 @@ TEST_F(SharedPPDataTest, testPODProperty)
EXPECT_FALSE(shared->GetProperty("test2",o)); EXPECT_FALSE(shared->GetProperty("test2",o));
EXPECT_EQ(5, o); EXPECT_EQ(5, o);
float f = 12.f, m; float f = 12.f, m = -98.7654f;
shared->AddProperty("test",f); shared->AddProperty("test",f);
EXPECT_TRUE(shared->GetProperty("test",m)); EXPECT_TRUE(shared->GetProperty("test",m));
EXPECT_EQ(12.f, m); EXPECT_EQ(12.f, m);