本文整理汇总了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);
}
示例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);
}
示例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);
}
示例4: NullStream
public void NullStream()
{
analyzer = new Analyzer(null);
analyzer.Run();
}
示例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();
}
}