Exemple #1
0
        public void CheckMainArguments()
        {
            StackFrame         mainFrame = GetFrame($"{DefaultModuleName}!main");
            VariableCollection arguments = mainFrame.Arguments;

            Assert.IsTrue(arguments.ContainsName("argc"));
            Assert.IsTrue(arguments.ContainsName("argv"));
            Assert.AreEqual(1, (int)arguments["argc"]);

            Assert.AreEqual(2, arguments.Count);
            for (int i = 0; i < arguments.Count; i++)
            {
                Variable argument = arguments[i];

                Assert.IsFalse(argument.IsNullPointer());
            }

            Variable p;

            Assert.IsFalse(arguments.TryGetValue("p", out p));
            Assert.IsNull(arguments.Names.FirstOrDefault(n => n == "p"));
            Assert.IsNull(arguments.FirstOrDefault(a => a.GetName() == "p"));
        }