summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/tests/compiler_tests/IntermNode_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/angle/src/tests/compiler_tests/IntermNode_test.cpp')
-rwxr-xr-xgfx/angle/src/tests/compiler_tests/IntermNode_test.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/gfx/angle/src/tests/compiler_tests/IntermNode_test.cpp b/gfx/angle/src/tests/compiler_tests/IntermNode_test.cpp
index 1a14ad86c..b0f7404d3 100755
--- a/gfx/angle/src/tests/compiler_tests/IntermNode_test.cpp
+++ b/gfx/angle/src/tests/compiler_tests/IntermNode_test.cpp
@@ -13,8 +13,6 @@
#include "compiler/translator/IntermNode.h"
#include "compiler/translator/PoolAlloc.h"
-using namespace sh;
-
class IntermNodeTest : public testing::Test
{
public:
@@ -149,8 +147,10 @@ TEST_F(IntermNodeTest, DeepCopyBinaryNode)
{
TType type(EbtFloat, EbpHigh);
- TIntermBinary *original = new TIntermBinary(EOpAdd, createTestSymbol(), createTestSymbol());
+ TIntermBinary *original = new TIntermBinary(EOpAdd);
original->setLine(getTestSourceLoc());
+ original->setLeft(createTestSymbol());
+ original->setRight(createTestSymbol());
TIntermTyped *copyTyped = original->deepCopy();
TIntermBinary *copy = copyTyped->getAsBinaryNode();
ASSERT_NE(nullptr, copy);
@@ -168,8 +168,9 @@ TEST_F(IntermNodeTest, DeepCopyUnaryNode)
{
TType type(EbtFloat, EbpHigh);
- TIntermUnary *original = new TIntermUnary(EOpPreIncrement, createTestSymbol());
+ TIntermUnary *original = new TIntermUnary(EOpPreIncrement);
original->setLine(getTestSourceLoc());
+ original->setOperand(createTestSymbol());
TIntermTyped *copyTyped = original->deepCopy();
TIntermUnary *copy = copyTyped->getAsUnaryNode();
ASSERT_NE(nullptr, copy);
@@ -209,24 +210,24 @@ TEST_F(IntermNodeTest, DeepCopyAggregateNode)
}
}
-// Check that the deep copy of a ternary node is an actual copy with the same attributes as the
+// Check that the deep copy of a selection node is an actual copy with the same attributes as the
// original. Child nodes also need to be copies with the same attributes as the original children.
-TEST_F(IntermNodeTest, DeepCopyTernaryNode)
+TEST_F(IntermNodeTest, DeepCopySelectionNode)
{
TType type(EbtFloat, EbpHigh);
- TIntermTernary *original = new TIntermTernary(createTestSymbol(TType(EbtBool, EbpUndefined)),
- createTestSymbol(), createTestSymbol());
+ TIntermSelection *original = new TIntermSelection(
+ createTestSymbol(TType(EbtBool, EbpUndefined)), createTestSymbol(), createTestSymbol());
original->setLine(getTestSourceLoc());
TIntermTyped *copyTyped = original->deepCopy();
- TIntermTernary *copy = copyTyped->getAsTernaryNode();
+ TIntermSelection *copy = copyTyped->getAsSelectionNode();
ASSERT_NE(nullptr, copy);
ASSERT_NE(original, copy);
checkTestSourceLoc(copy->getLine());
checkTypeEqualWithQualifiers(original->getType(), copy->getType());
checkSymbolCopy(original->getCondition(), copy->getCondition());
- checkSymbolCopy(original->getTrueExpression(), copy->getTrueExpression());
- checkSymbolCopy(original->getFalseExpression(), copy->getFalseExpression());
+ checkSymbolCopy(original->getTrueBlock(), copy->getTrueBlock());
+ checkSymbolCopy(original->getFalseBlock(), copy->getFalseBlock());
}