Exemple #1
0
        public void FlowGraphWithChildren()
        {
            var node = CFlowParser.Parse(new List <string>(TestConstants.TwoLevelGraphFlow.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)));

            // Function object is main
            AssertHelper.AssertFunctionNode(node.Function,
                                            @"main",
                                            @"int (void)",
                                            @"c:\Users\Morten\Documents\Atmel Studio\7.0\LEDflasher0\LEDflasher0\led_flasher_main.c",
                                            6);

            // This graph is a root node with 3 childrens
            Assert.AreEqual(3, node.Children.Count);

            // Children
            AssertHelper.AssertFunctionNode(node.Children[0].Function,
                                            @"system_init",
                                            @"void (void)",
                                            @"C:\Users\Morten\Documents\Atmel Studio\7.0\LEDflasher0\LEDflasher0\atmel_start.c",
                                            70);
            AssertHelper.AssertFunctionNode(node.Children[1].Function,
                                            @"delay_ms",
                                            string.Empty,
                                            string.Empty,
                                            0);
            AssertHelper.AssertFunctionNode(node.Children[2].Function,
                                            @"gpio_toggle_pin_level",
                                            string.Empty,
                                            string.Empty,
                                            0);
        }
Exemple #2
0
        public void SimpleFlowGraph()
        {
            var node = CFlowParser.Parse(new List <string>(TestConstants.NoGraph.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)));

            // Function object is main
            AssertHelper.AssertFunctionNode(node.Function,
                                            @"main",
                                            @"int (void)",
                                            @"c:\Users\Morten\Documents\Atmel Studio\7.0\GccApplication1\GccApplication1\main.cpp",
                                            14);

            // This graph is 1 root node, no children
            Assert.AreEqual(0, node.Children.Count);
        }