diff options
author | Timothy Arceri <[email protected]> | 2016-02-03 09:39:10 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-02-06 14:34:35 +1100 |
commit | c1bbaff1e83f901d67d78f9e1ddfe8291dd09bfa (patch) | |
tree | f0ae24d875ab9663b45492e2584c91d3dc32068c /src/compiler/glsl/tests/varyings_test.cpp | |
parent | e377037bef521a985dc801371f195ada327ec304 (diff) |
glsl: replace unreachable code with an assert()
All interface blocks will have been lowered by this point so just
use an assert. Returning false would have caused all sorts of
problems if they were not lowered yet and there is an assert to
catch this later anyway.
We also update the tests to reflect this change.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/tests/varyings_test.cpp')
-rw-r--r-- | src/compiler/glsl/tests/varyings_test.cpp | 78 |
1 files changed, 30 insertions, 48 deletions
diff --git a/src/compiler/glsl/tests/varyings_test.cpp b/src/compiler/glsl/tests/varyings_test.cpp index 0c4e0a471b8..9be5e8344b4 100644 --- a/src/compiler/glsl/tests/varyings_test.cpp +++ b/src/compiler/glsl/tests/varyings_test.cpp @@ -156,11 +156,11 @@ TEST_F(link_varyings, single_simple_input) ir.push_tail(v); - ASSERT_TRUE(linker::populate_consumer_input_sets(mem_ctx, - &ir, - consumer_inputs, - consumer_interface_inputs, - junk)); + linker::populate_consumer_input_sets(mem_ctx, + &ir, + consumer_inputs, + consumer_interface_inputs, + junk); EXPECT_EQ((void *) v, hash_table_find(consumer_inputs, "a")); EXPECT_EQ(1u, num_elements(consumer_inputs)); @@ -183,11 +183,11 @@ TEST_F(link_varyings, gl_ClipDistance) ir.push_tail(clipdistance); - ASSERT_TRUE(linker::populate_consumer_input_sets(mem_ctx, - &ir, - consumer_inputs, - consumer_interface_inputs, - junk)); + linker::populate_consumer_input_sets(mem_ctx, + &ir, + consumer_inputs, + consumer_interface_inputs, + junk); EXPECT_EQ(clipdistance, junk[VARYING_SLOT_CLIP_DIST0]); EXPECT_TRUE(is_empty(consumer_inputs)); @@ -205,11 +205,11 @@ TEST_F(link_varyings, single_interface_input) ir.push_tail(v); - ASSERT_TRUE(linker::populate_consumer_input_sets(mem_ctx, - &ir, - consumer_inputs, - consumer_interface_inputs, - junk)); + linker::populate_consumer_input_sets(mem_ctx, + &ir, + consumer_inputs, + consumer_interface_inputs, + junk); char *const full_name = interface_field_name(simple_interface); EXPECT_EQ((void *) v, hash_table_find(consumer_interface_inputs, full_name)); @@ -236,11 +236,11 @@ TEST_F(link_varyings, one_interface_and_one_simple_input) ir.push_tail(iface); - ASSERT_TRUE(linker::populate_consumer_input_sets(mem_ctx, - &ir, - consumer_inputs, - consumer_interface_inputs, - junk)); + linker::populate_consumer_input_sets(mem_ctx, + &ir, + consumer_inputs, + consumer_interface_inputs, + junk); char *const iface_field_name = interface_field_name(simple_interface); @@ -252,24 +252,6 @@ TEST_F(link_varyings, one_interface_and_one_simple_input) EXPECT_EQ(1u, num_elements(consumer_inputs)); } -TEST_F(link_varyings, invalid_interface_input) -{ - ir_variable *const v = - new(mem_ctx) ir_variable(simple_interface, - "named_interface", - ir_var_shader_in); - - ASSERT_EQ(simple_interface, v->get_interface_type()); - - ir.push_tail(v); - - EXPECT_FALSE(linker::populate_consumer_input_sets(mem_ctx, - &ir, - consumer_inputs, - consumer_interface_inputs, - junk)); -} - TEST_F(link_varyings, interface_field_doesnt_match_noninterface) { char *const iface_field_name = interface_field_name(simple_interface); @@ -283,11 +265,11 @@ TEST_F(link_varyings, interface_field_doesnt_match_noninterface) ir.push_tail(in_v); - ASSERT_TRUE(linker::populate_consumer_input_sets(mem_ctx, - &ir, - consumer_inputs, - consumer_interface_inputs, - junk)); + linker::populate_consumer_input_sets(mem_ctx, + &ir, + consumer_inputs, + consumer_interface_inputs, + junk); /* Create an output variable, "v", that is part of an interface block named * "a". They should not match. @@ -325,11 +307,11 @@ TEST_F(link_varyings, interface_field_doesnt_match_noninterface_vice_versa) ir.push_tail(in_v); - ASSERT_TRUE(linker::populate_consumer_input_sets(mem_ctx, - &ir, - consumer_inputs, - consumer_interface_inputs, - junk)); + linker::populate_consumer_input_sets(mem_ctx, + &ir, + consumer_inputs, + consumer_interface_inputs, + junk); /* Create an output variable "a.v". They should not match. */ |