Fix a memory leak in expect_equal(). Found by Coverity Scan.
[movit] / alpha_multiplication_effect_test.cpp
1 // Unit tests for AlphaMultiplicationEffect.
2
3 #include "test_util.h"
4 #include "gtest/gtest.h"
5
6 TEST(AlphaMultiplicationEffectTest, SimpleTest) {
7         const int size = 3;
8         float data[4 * size] = {
9                 1.0f, 0.2f, 0.2f, 0.0f,
10                 0.2f, 1.0f, 0.2f, 0.5f,
11                 0.2f, 0.2f, 1.0f, 1.0f,
12         };
13         float expected_data[4 * size] = {
14                 0.0f, 0.0f, 0.0f, 0.0f,
15                 0.1f, 0.5f, 0.1f, 0.5f,
16                 0.2f, 0.2f, 1.0f, 1.0f,
17         };
18         float out_data[4 * size];
19         EffectChainTester tester(data, 1, size, FORMAT_RGBA_POSTMULTIPLIED_ALPHA, COLORSPACE_sRGB, GAMMA_LINEAR);
20         tester.run(out_data, GL_RGBA, COLORSPACE_sRGB, GAMMA_LINEAR, OUTPUT_ALPHA_PREMULTIPLIED);
21
22         expect_equal(expected_data, out_data, 4, size);
23 }