X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain_test.cpp;h=673e9cc3665fd1acac09d9815eaa84947d416e22;hp=b1f0815cc62d80b604ca5a4fc0f1618d941ca913;hb=fd37781d89f729ed23901df3e58a4c2bd417dc1d;hpb=e9f0fb5e6ae193a5a853ac5aef82927b6a81267a diff --git a/effect_chain_test.cpp b/effect_chain_test.cpp index b1f0815..673e9cc 100644 --- a/effect_chain_test.cpp +++ b/effect_chain_test.cpp @@ -223,7 +223,7 @@ private: GammaCurve overridden_gamma_curve; }; -TEST(EffectChainTester, HandlesInputChangingColorspace) { +TEST(EffectChainTest, HandlesInputChangingColorspace) { const int size = 4; float data[size] = { @@ -983,7 +983,7 @@ TEST(EffectChainTest, IdentityWithOwnPool) { 0.75f, 1.0f, 1.0f, 0.0f, 0.25f, 0.3f, }; - float out_data[6]; + float out_data[6], temp[6 * 4]; EffectChain chain(width, height); movit_debug_level = MOVIT_DEBUG_ON; @@ -1002,7 +1002,7 @@ TEST(EffectChainTest, IdentityWithOwnPool) { check_error(); glBindTexture(GL_TEXTURE_2D, texnum); check_error(); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_RGBA, GL_FLOAT, NULL); check_error(); glGenFramebuffers(1, &fbo); @@ -1024,7 +1024,12 @@ TEST(EffectChainTest, IdentityWithOwnPool) { chain.render_to_fbo(fbo, width, height); glBindFramebuffer(GL_FRAMEBUFFER, fbo); - glReadPixels(0, 0, width, height, GL_RED, GL_FLOAT, out_data); + check_error(); + glReadPixels(0, 0, width, height, GL_RGBA, GL_FLOAT, temp); + check_error(); + for (unsigned i = 0; i < 6; ++i) { + out_data[i] = temp[i * 4]; + } expect_equal(expected_data, out_data, width, height);