Skip to content

Commit

Permalink
added Shader Tests for single shader building
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacey committed Sep 29, 2023
1 parent 396a2c7 commit ed1c408
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Text::Text(std::string_view _name, int _size)
Text::~Text()
{
// our dtor should clear out the textures and remove the VAO's
for(auto &[c,font] : m_characters)
for(const auto &[c,font] : m_characters)
{
glDeleteTextures(1, &font.textureID);
}
Expand Down
24 changes: 24 additions & 0 deletions tests/ShaderLibTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,27 @@ TEST(ShaderLib,editShader)

}

TEST(Shader,create)
{
auto shader=ngl::Shader("Test",ngl::ShaderType::VERTEX);
shader.load("files/vert.glsl");
EXPECT_TRUE(shader.compile());
EXPECT_TRUE(shader.isCompiled());
}


TEST(Shader,loadFromString)
{
auto shader=ngl::Shader("Test",ngl::ShaderType::VERTEX);
shader.loadFromString("#version 410 core\nvoid main(){}");
EXPECT_TRUE(shader.compile());
EXPECT_TRUE(shader.isCompiled());
}


TEST(Shader,editShader)
{

}


0 comments on commit ed1c408

Please sign in to comment.