Exemplo n.º 1
0
        public void Test_StaticFlow_IsBranchPoint_1()
        {
            string programStr =
                "           mov     rax,        10     ;line 0         " + Environment.NewLine +
                "label1:                               ;line 1         " + Environment.NewLine +
                "           mov     rbx,        1      ;line 2         " + Environment.NewLine +
                "           dec     rax                ;line 3         " + Environment.NewLine +
                "           jnz     label1             ;line 4         " + Environment.NewLine +
                "           mov     rcx,        1      ;line 5         ";
            StaticFlow flow = new StaticFlow(new Tools());

            flow.Update(programStr);
            if (logToDisplay)
            {
                Console.WriteLine(flow);
            }

            Assert.IsFalse(flow.Is_Branch_Point(0));
            Assert.IsFalse(flow.Is_Branch_Point(1));
            Assert.IsFalse(flow.Is_Branch_Point(2));
            Assert.IsFalse(flow.Is_Branch_Point(3));
            Assert.IsTrue(flow.Is_Branch_Point(4));
            Assert.IsFalse(flow.Is_Branch_Point(5));
        }