diff --git a/tests/src/test_lookup_table.cpp b/tests/src/test_lookup_table.cpp index e3def80b05714dfdb8d7906a965ce35b19aa56ce..17d21d9878c998a0229c9d7bd1b614a6fbce39ea 100644 --- a/tests/src/test_lookup_table.cpp +++ b/tests/src/test_lookup_table.cpp @@ -20,19 +20,24 @@ // limitations under the License. //------------------------------------------------------------------------------ +#include "catch/catch.hpp" + #include "phx/resources/types/lookup_table.hpp" #include "phx/resources/types/transfer_function.hpp" -#include "catch/catch.hpp" +#include "trompeloeil.hpp" + +#include "mocks/opengl_mock.hpp" SCENARIO("Creating and accesing a Lookup Table", "[phx][phx::LookupTable]") { + OPENGL_MOCK_ALLOW_ANY_CALL GIVEN("A test transfer function") { phx::TransferFunction transfer_function; glm::vec4 red_color{1.0f, 0.0f, 0.0f, 0.0f}; glm::vec4 black_color{0.0f, 0.0f, 0.0f, 0.0f}; transfer_function.SetEntries({{0.0f, red_color}, {1.0f, black_color}}); - WHEN("We create Lookup Table from the given Transfer function") { + WHEN("We create Lookup Table with the given Transfer function") { phx::LookupTable lut(transfer_function, 11); THEN("The Lookup Table is generated correctly") { @@ -48,6 +53,11 @@ SCENARIO("Creating and accesing a Lookup Table", "[phx][phx::LookupTable]") { REQUIRE(lut.GetIndex(1.0f) == 10); REQUIRE(lut.GetIndex(0.56f) == 6); } + + THEN("We can ask for a lookup table as texture1D") { + REQUIRE_CALL(open_gl_mock, glCreateTextures(_, _, _)); + auto lookup_texture = lut.GetTexture1D(); + } } WHEN("We ask for a nearest neighbor interpolated Lookup Table") {