aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/tests/general_ir_test.cpp
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-07-31 13:51:50 +0300
committerLionel Landwerlin <[email protected]>2019-08-21 09:44:10 +0200
commit3ade8f0040f34be4eccebf042ee7354f2f09a99a (patch)
treea5fae518785a0ecfc0ef4c69dd0b4d9f2abc00c1 /src/compiler/glsl/tests/general_ir_test.cpp
parent41d9873459614ca4a8885a4f4473065241647c99 (diff)
glsl/tests: take refs on glsl types
Much like each driver, tests as standalone entities must take references on the glsl types. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/compiler/glsl/tests/general_ir_test.cpp')
-rw-r--r--src/compiler/glsl/tests/general_ir_test.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/compiler/glsl/tests/general_ir_test.cpp b/src/compiler/glsl/tests/general_ir_test.cpp
index c8bc16b7ad0..e05ecf9c3d5 100644
--- a/src/compiler/glsl/tests/general_ir_test.cpp
+++ b/src/compiler/glsl/tests/general_ir_test.cpp
@@ -26,7 +26,25 @@
#include "main/macros.h"
#include "ir.h"
-TEST(ir_variable_constructor, interface)
+class ir_variable_constructor : public ::testing::Test {
+public:
+ virtual void SetUp();
+ virtual void TearDown();
+};
+
+void
+ir_variable_constructor::SetUp()
+{
+ glsl_type_singleton_init_or_ref();
+}
+
+void
+ir_variable_constructor::TearDown()
+{
+ glsl_type_singleton_decref();
+}
+
+TEST_F(ir_variable_constructor, interface)
{
void *mem_ctx = ralloc_context(NULL);
@@ -52,7 +70,7 @@ TEST(ir_variable_constructor, interface)
EXPECT_EQ(iface, v->get_interface_type());
}
-TEST(ir_variable_constructor, interface_array)
+TEST_F(ir_variable_constructor, interface_array)
{
void *mem_ctx = ralloc_context(NULL);