Skip to content

Commit

Permalink
Add test for material
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <[email protected]>
  • Loading branch information
luca-della-vedova committed Jul 27, 2022
1 parent 3f16e67 commit fc0de46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion graphics/src/Material_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <gtest/gtest.h>

#include "gz/common/Image.hh"
#include "gz/common/Material.hh"
#include "gz/common/Pbr.hh"

Expand All @@ -33,8 +34,10 @@ TEST_F(MaterialTest, Material)
EXPECT_TRUE(mat.Diffuse() == math::Color(1.0f, 0.5f, 0.2f, 1.0f));
EXPECT_STREQ("gz_material_0", mat.Name().c_str());

mat.SetTextureImage("texture_image");
auto texImg = std::make_shared<common::Image>();
mat.SetTextureImage("texture_image", texImg);
EXPECT_STREQ("texture_image", mat.TextureImage().c_str());
EXPECT_EQ(texImg, mat.TextureData());

mat.SetTextureImage("texture_image", "/path");
std::string texturePath = common::joinPaths("/path", "..",
Expand Down

0 comments on commit fc0de46

Please sign in to comment.