diff --git a/tests/src/test_mesh.cpp b/tests/src/test_mesh.cpp index d0e158da94630965d9667843cd903099a204b63d..e7aa18e58cb2038e2028776459a5b8c0f781e478 100644 --- a/tests/src/test_mesh.cpp +++ b/tests/src/test_mesh.cpp @@ -92,7 +92,7 @@ SCENARIO("The mesh component keeps track of its attributes", for (std::size_t i = 0; i < atts.size(); i++) { REQUIRE(atts[i].size() == texture_coordinates_copy[i].size()); for (std::size_t j = 0; j < atts.size(); j++) { - REQUIRE(atts[i][j] == texture_coordinates_copy[i][j]); + REQUIRE(atts[i][j] == Approx(texture_coordinates_copy[i][j])); } } } diff --git a/tests/src/test_model.cpp b/tests/src/test_model.cpp index 883d5e3b09fff45fb85c2f552b266b76073d4cdd..3add6017f60d571d65a6cfe7e20d021876b9ccfb 100644 --- a/tests/src/test_model.cpp +++ b/tests/src/test_model.cpp @@ -59,6 +59,18 @@ SCENARIO("A Model can be loaded that contains multiple meshes", REQUIRE(model->GetMaterialForMesh(model->GetMeshes()[1]) == model->GetMaterials()[1]); } + THEN("Texture coords are loaded and can be accessed.") { + auto mesh = model->GetMesh("Cube_Cube.001"); + auto textureCoords = mesh->GetTextureCoords(); + REQUIRE(textureCoords[0][0] == Approx(1)); + REQUIRE(textureCoords[0][1] == Approx(0)); + REQUIRE(textureCoords[0][2] == Approx(1)); + REQUIRE(textureCoords[0][3] == Approx(1)); + REQUIRE(textureCoords[0][4] == Approx(0)); + REQUIRE(textureCoords[0][5] == Approx(1)); + REQUIRE(textureCoords[0][6] == Approx(0)); + REQUIRE(textureCoords[0][7] == Approx(0)); + } } } }