本文整理匯總了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();
}
}