diff --git a/test/unit/utFBXImporterExporter.cpp b/test/unit/utFBXImporterExporter.cpp index ecba5ee1e..1c7117319 100644 --- a/test/unit/utFBXImporterExporter.cpp +++ b/test/unit/utFBXImporterExporter.cpp @@ -185,7 +185,7 @@ TEST_F(utFBXImporterExporter, importCubesComplexTransform) { ASSERT_STREQ(node->mName.C_Str(), chainStr[i]); parent = node; } - ASSERT_EQ(0, parent->mNumChildren) << "Leaf node"; + ASSERT_EQ(0u, parent->mNumChildren) << "Leaf node"; } TEST_F( utFBXImporterExporter, importPhongMaterial ) { @@ -244,7 +244,7 @@ TEST_F(utFBXImporterExporter, importEmbeddedAsciiTest) { EXPECT_EQ(aiReturn_SUCCESS, mat->GetTexture(aiTextureType_DIFFUSE, 0, &path, nullptr, nullptr, nullptr, nullptr, modes)); ASSERT_STREQ(path.C_Str(), "..\\..\\..\\Desktop\\uv_test.png"); - ASSERT_EQ(1, scene->mNumTextures); + ASSERT_EQ(1u, scene->mNumTextures); ASSERT_TRUE(scene->mTextures[0]->pcData); ASSERT_EQ(439176u, scene->mTextures[0]->mWidth) << "FBX ASCII base64 compression splits data by 512Kb, it should be two parts for this texture"; } @@ -255,7 +255,7 @@ TEST_F(utFBXImporterExporter, importEmbeddedFragmentedAsciiTest) { const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/FBX/embedded_ascii/box_embedded_texture_fragmented.fbx", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); - EXPECT_EQ(1, scene->mNumMaterials); + EXPECT_EQ(1u, scene->mNumMaterials); aiMaterial *mat = scene->mMaterials[0]; ASSERT_NE(nullptr, mat); @@ -264,7 +264,7 @@ TEST_F(utFBXImporterExporter, importEmbeddedFragmentedAsciiTest) { ASSERT_EQ(aiReturn_SUCCESS, mat->GetTexture(aiTextureType_DIFFUSE, 0, &path, nullptr, nullptr, nullptr, nullptr, modes)); ASSERT_STREQ(path.C_Str(), "paper.png"); - ASSERT_EQ(1, scene->mNumTextures); + ASSERT_EQ(1u, scene->mNumTextures); ASSERT_TRUE(scene->mTextures[0]->pcData); ASSERT_EQ(968029u, scene->mTextures[0]->mWidth) << "FBX ASCII base64 compression splits data by 512Kb, it should be two parts for this texture"; } diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 4104fe6b7..2399f3371 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -157,9 +157,9 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeLinesLoopWithoutIndices) { //Lines loop without indices const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/glTF-Asset-Generator/Mesh_PrimitiveMode/Mesh_PrimitiveMode_02.gltf", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); - EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4); + EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4u); - std::array l1 = {{ 0, 1, 2, 3, 0 }}; + std::array l1 = {{ 0u, 1u, 2u, 3u, 0u }}; EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 2u); for (unsigned int i = 0; i < scene->mMeshes[0]->mNumFaces; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[i].mNumIndices, 2u); @@ -173,9 +173,9 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeLinesStripWithoutIndices) { //Lines strip without indices const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/glTF-Asset-Generator/Mesh_PrimitiveMode/Mesh_PrimitiveMode_03.gltf", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); - EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 5); + EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 5u); - EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 2); + EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 2u); for (unsigned int i = 0; i < scene->mMeshes[0]->mNumFaces; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[i].mNumIndices, 2u); EXPECT_EQ(scene->mMeshes[0]->mFaces[i].mIndices[0], i); @@ -190,7 +190,7 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeTrianglesStripWithoutIndices EXPECT_NE(nullptr, scene); EXPECT_EQ(scene->mMeshes[0]->mNumFaces, 2u); EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4u); - std::array f1 = {{ 0, 1, 2 }}; + std::array f1 = {{ 0u, 1u, 2u }}; EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 3u); for (unsigned int i = 0; i < 3; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mIndices[i], f1[i]); @@ -210,13 +210,13 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeTrianglesFanWithoutIndices) EXPECT_NE(nullptr, scene); EXPECT_EQ(scene->mMeshes[0]->mNumFaces, 2u); EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4u); - std::array f1 = {{ 0, 1, 2 }}; + std::array f1 = {{ 0u, 1u, 2u }}; EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 3u); for (size_t i = 0; i < 3; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mIndices[i], f1[i]); } - std::array f2 = {{ 0, 2, 3 }}; + std::array f2 = {{ 0u, 2u, 3u }}; EXPECT_EQ(scene->mMeshes[0]->mFaces[1].mNumIndices, 3u); for (size_t i = 0; i < 3; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[1].mIndices[i], f2[i]); @@ -260,8 +260,8 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeLines) { //Lines const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/glTF-Asset-Generator/Mesh_PrimitiveMode/Mesh_PrimitiveMode_08.gltf", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); - EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4); - std::array l1 = {{ 0, 3, 2, 1, 0 }}; + EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4u); + std::array l1 = {{ 0u, 3u, 2u, 1u, 0u }}; EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 2u); for (unsigned int i = 0; i < scene->mMeshes[0]->mNumFaces; ++i) { @@ -275,9 +275,9 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeLineLoop) { //Line loop const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/glTF-Asset-Generator/Mesh_PrimitiveMode/Mesh_PrimitiveMode_09.gltf", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); - EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4); - std::array l1 = {{ 0, 3, 2, 1, 0 }}; - EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 2); + EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4u); + std::array l1 = {{ 0, 3u, 2u, 1u, 0u }}; + EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 2u); for (unsigned int i = 0; i < scene->mMeshes[0]->mNumFaces; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[i].mIndices[0], l1[i]); @@ -290,11 +290,10 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeLineStrip) { //Lines Strip const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/glTF-Asset-Generator/Mesh_PrimitiveMode/Mesh_PrimitiveMode_10.gltf", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); - EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4); - std::array l1 = {{ 0, 3, 2, 1, 0 }}; - EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 2); - for (unsigned int i = 0; i < scene->mMeshes[0]->mNumFaces; ++i) - { + EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4u); + std::array l1 = {{ 0u, 3u, 2u, 1u, 0u }}; + EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 2u); + for (unsigned int i = 0; i < scene->mMeshes[0]->mNumFaces; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[i].mIndices[0], l1[i]); EXPECT_EQ(scene->mMeshes[0]->mFaces[i].mIndices[1], l1[i + 1]); } @@ -305,19 +304,17 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeTrianglesStrip) { //Triangles strip const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/glTF-Asset-Generator/Mesh_PrimitiveMode/Mesh_PrimitiveMode_11.gltf", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); - EXPECT_EQ(scene->mMeshes[0]->mNumFaces, 2); - EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4); - std::array f1 = {{ 0, 3, 1 }}; - EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 3); - for (int i = 0; i < 3; ++i) - { + EXPECT_EQ(scene->mMeshes[0]->mNumFaces, 2u); + EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4u); + std::array f1 = {{ 0u, 3u, 1u }}; + EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 3u); + for (size_t i = 0; i < 3; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mIndices[i], f1[i]); } - std::array f2 = {{ 1, 3, 2 }}; - EXPECT_EQ(scene->mMeshes[0]->mFaces[1].mNumIndices, 3); - for (int i = 0; i < 3; ++i) - { + std::array f2 = {{ 1u, 3u, 2u }}; + EXPECT_EQ(scene->mMeshes[0]->mFaces[1].mNumIndices, 3u); + for (size_t i = 0; i < 3; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[1].mIndices[i], f2[i]); } } @@ -327,16 +324,16 @@ TEST_F(utglTF2ImportExport, importglTF2PrimitiveModeTrianglesFan) { //Triangles fan const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/glTF-Asset-Generator/Mesh_PrimitiveMode/Mesh_PrimitiveMode_12.gltf", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); - EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4); - EXPECT_EQ(scene->mMeshes[0]->mNumFaces, 2); - std::array f1 = {{ 0, 3, 2 }}; + EXPECT_EQ(scene->mMeshes[0]->mNumVertices, 4u); + EXPECT_EQ(scene->mMeshes[0]->mNumFaces, 2u); + std::array f1 = {{ 0u, 3u, 2u }}; EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mNumIndices, 3); for (size_t i = 0; i < 3; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[0].mIndices[i], f1[i]); } - std::array f2 = {{ 0, 2, 1 }}; - EXPECT_EQ(scene->mMeshes[0]->mFaces[1].mNumIndices, 3); + std::array f2 = {{ 0u, 2u, 1u }}; + EXPECT_EQ(scene->mMeshes[0]->mFaces[1].mNumIndices, 3u ); for (size_t i = 0; i < 3; ++i) { EXPECT_EQ(scene->mMeshes[0]->mFaces[1].mIndices[i], f2[i]); } @@ -373,7 +370,8 @@ TEST_F(utglTF2ImportExport, importglTF2FromMemory) { TEST_F( utglTF2ImportExport, bug_import_simple_skin ) { Assimp::Importer importer; - const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/glTF2/simple_skin/simple_skin.gltf", aiProcess_ValidateDataStructure ); + const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/glTF2/simple_skin/simple_skin.gltf", + aiProcess_ValidateDataStructure ); EXPECT_NE( nullptr, scene ); }