當前位置: 首頁>>代碼示例>>C#>>正文


C# Analyzer.Run方法代碼示例

本文整理匯總了C#中Analyzer.Run方法的典型用法代碼示例。如果您正苦於以下問題:C# Analyzer.Run方法的具體用法?C# Analyzer.Run怎麽用?C# Analyzer.Run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Analyzer的用法示例。


在下文中一共展示了Analyzer.Run方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: NoReportItems

 public void NoReportItems()
 {
     analyzer = new Analyzer(CreateMockParser(0));
     Assert.AreEqual(0, analyzer.ActualReportItems.Count);
     analyzer.Run();
     Assert.AreEqual(0, analyzer.ExpectedReportItems.Count);
 }
開發者ID:matthargett,項目名稱:bugreport,代碼行數:7,代碼來源:AnalyzerTest.cs

示例2: VerifyExpectedAndActualReports

        public void VerifyExpectedAndActualReports()
        {
            analyzer = new FakeAnalyzer(CreateMockParser(2), 2);
            analyzer.Run();
            Assert.AreEqual(analyzer.ActualReportItems.Count, analyzer.ExpectedReportItems.Count);

            analyzer = new FakeAnalyzer(CreateMockParser(2), 3);
            analyzer.Run();
            Assert.AreNotEqual(analyzer.ActualReportItems.Count, analyzer.ExpectedReportItems.Count);
        }
開發者ID:matthargett,項目名稱:bugreport,代碼行數:10,代碼來源:AnalyzerTest.cs

示例3: WithReportItems

        public void WithReportItems()
        {
            var reportItems = new List<ReportItem>();

            analyzer = new FakeAnalyzer(CreateMockParser(2), 2);
            analyzer.OnEmulationComplete +=
                delegate(object sender, EmulationEventArgs e)
                {
                    Assert.AreEqual(code[0], e.Code[0]);
                    Assert.AreEqual(0, e.MachineState.InstructionPointer);
                };

            analyzer.OnReport +=
                (sender, e) => reportItems.Add(e.ReportItem);

            analyzer.Run();
            Assert.AreEqual(2, analyzer.ActualReportItems.Count);
            Assert.AreEqual(2, analyzer.ExpectedReportItems.Count);

            Assert.AreEqual(0, reportItems[0].InstructionPointer);
            Assert.AreEqual(1, reportItems[1].InstructionPointer);
        }
開發者ID:matthargett,項目名稱:bugreport,代碼行數:22,代碼來源:AnalyzerTest.cs

示例4: NullStream

 public void NullStream()
 {
     analyzer = new Analyzer(null);
     analyzer.Run();
 }
開發者ID:matthargett,項目名稱:bugreport,代碼行數:5,代碼來源:AnalyzerTest.cs

示例5: AnalyzeFiles

        private static void AnalyzeFiles(IEnumerable<string> fileNames, Boolean withTracing, Boolean withDebugging)
        {
            foreach (var fileName in fileNames)
            {
                Console.WriteLine();
                Console.WriteLine("Interpreting file: " + fileName);
                FileStream fileStream;

                try
                {
                    fileStream = File.OpenRead(fileName);
                }
                catch (IOException e)
                {
                    Console.WriteLine(e.Message);
                    Environment.Exit(3);
                    return; // needed to hush up a false warning in mono
                }

                // TODO (matt_hargett): have a factory auto-detect the file type and return the right kind of IParsable
                // IParsable parser = new DumpFileParser(fileStream, Options.FunctionToAnalyze);
                IParsable parser = new ElfFileParser(fileStream);

                analyzer = new Analyzer(parser);
                analyzer.OnReport += PrintReportItem;

                if (withTracing)
                {
                    analyzer.OnEmulationComplete += new DebuggerView(withDebugging).PrintInfo;
                }

                analyzer.Run();
            }
        }
開發者ID:matthargett,項目名稱:bugreport,代碼行數:34,代碼來源:Main.cs


注:本文中的Analyzer.Run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。