diff --git a/tests/src/tests/tests.program.cpp b/tests/src/tests/tests.program.cpp index 019f290..b206274 100644 --- a/tests/src/tests/tests.program.cpp +++ b/tests/src/tests/tests.program.cpp @@ -347,4 +347,26 @@ namespace zasm::tests ASSERT_EQ(imm.value(), 3); } + TEST(ProgramTests, TestNodeType) + { + Program program(MachineMode::AMD64); + + auto testIns = Instruction{}.setMnemonic(x86::Mnemonic::Add); + + auto* node = program.createNode(testIns); + ASSERT_NE(node, nullptr); + + ASSERT_TRUE(node->holds()); + + ASSERT_FALSE(node->holds()); + + auto* inst = node->getIf(); + ASSERT_NE(inst, nullptr); + + ASSERT_EQ(testIns, *inst); + + auto* data = node->getIf(); + ASSERT_EQ(data, nullptr); + } + } // namespace zasm::tests