当前位置: 首页>>代码示例>>C#>>正文


C# FileUnitTester.AssertFilesEqual方法代码示例

本文整理汇总了C#中FileUnitTester.AssertFilesEqual方法的典型用法代码示例。如果您正苦于以下问题:C# FileUnitTester.AssertFilesEqual方法的具体用法?C# FileUnitTester.AssertFilesEqual怎么用?C# FileUnitTester.AssertFilesEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileUnitTester的用法示例。


在下文中一共展示了FileUnitTester.AssertFilesEqual方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VnSumTest

		//[Test]
		public void VnSumTest()
		{
			Program prog = RewriteCodeFragment(
				@".i86
	push bp
	mov	 bp,sp
	mov	dx,3
	add dx,dx

	mov bx,3
	lea dx,[bx+3]
	mov sp,bp
	pop	bp
	ret
	");
			using (FileUnitTester fut = new FileUnitTester("Analysis/VnSumTest.txt"))
			{
				Procedure proc = prog.Procedures.Values[0];
				Aliases alias = new Aliases(proc, prog.Architecture);
				alias.Transform();
				var gr = proc.CreateBlockDominatorGraph();
                SsaTransform sst = new SsaTransform(
                    new ProgramDataFlow(), 
                    proc,
                    null,
                    gr,
                    new HashSet<RegisterStorage>());
				SsaState ssa = sst.SsaState;
				ValueNumbering vn = new ValueNumbering(ssa.Identifiers);
				DumpProc(proc, ssa, fut.TextWriter);
				vn.Write(fut.TextWriter);
				fut.AssertFilesEqual();
			}
		}
开发者ID:relaxar,项目名称:reko,代码行数:35,代码来源:ValueNumberingTest.cs

示例2: VnLoop

        //[Test]
        public void VnLoop()
        {
            Program program = RewriteCodeFragment(@".i86
            push ax
            jmp looptest
            again:
            mov si,[0x302]
            mov ax,[si+04]
            add [si+06],ax
            looptest:
            cmp	ax,bx
            jl again

            pop ax
            ret
            ");
            using (FileUnitTester fut = new FileUnitTester("Analysis/VnLoop.txt"))
            {
                Procedure proc = program.Procedures.Values[0];
                var gr = proc.CreateBlockDominatorGraph();
                Aliases alias = new Aliases(proc, program.Architecture);
                alias.Transform();
                SsaTransform sst = new SsaTransform(new ProgramDataFlow(), proc, gr);
                SsaState ssa = sst.SsaState;
                DumpProc(proc, ssa, fut.TextWriter);
                ValueNumbering vn = new ValueNumbering(ssa.Identifiers);
                vn.Write(fut.TextWriter);

                fut.AssertFilesEqual();
            }
        }
开发者ID:nemerle,项目名称:reko,代码行数:32,代码来源:ValueNumberingTest.cs

示例3: RunTest

        protected override void RunTest(Program program, string outputFileName)
        {
            ExpressionNormalizer aen = new ExpressionNormalizer(program.Architecture.PointerType);
            aen.Transform(program);
            EquivalenceClassBuilder eq = new EquivalenceClassBuilder(factory, store);
            eq.Build(program);
#if OLD
            			DataTypeBuilder dtb = new DataTypeBuilder(factory, store, program.Architecture);
			TraitCollector coll = new TraitCollector(factory, store, dtb, program);
			coll.CollectProgramTraits(program);
			dtb.BuildEquivalenceClassDataTypes();
#else
            TypeCollector coll = new TypeCollector(factory, store, program);
            coll.CollectTypes();
            store.BuildEquivalenceClassDataTypes(factory);
#endif

            TypeVariableReplacer tvr = new TypeVariableReplacer(store);
            tvr.ReplaceTypeVariables();

            TypeTransformer trans = new TypeTransformer(factory, store, program);
            trans.Transform();
            using (FileUnitTester fut = new FileUnitTester(outputFileName))
            {
                foreach (Procedure proc in program.Procedures.Values)
                {
                    proc.Write(false, fut.TextWriter);
                    fut.TextWriter.WriteLine();
                }
                store.Write(fut.TextWriter);
                fut.AssertFilesEqual();
            }
        }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:33,代码来源:TypeTransformTests.cs

示例4: SltSimple

		public void SltSimple()
		{
			Build(new SimpleMock().Procedure, new FakeArchitecture());

			using (FileUnitTester fut = new FileUnitTester("Analysis/SltSimple.txt"))
			{
				ssa.Write(fut.TextWriter);
				sla.Write(proc, fut.TextWriter);
				fut.TextWriter.WriteLine();
				fut.AssertFilesEqual();
			}

			Block block = proc.EntryBlock.Succ[0];
			block.Write(Console.Out);
			Assert.AreEqual("Mem3[0x10000000:word32] = a + b", block.Statements[0].Instruction.ToString());
			Assert.AreEqual("Mem4[0x10000004:word32] = a", block.Statements[1].Instruction.ToString());

			SsaIdentifier a = ssa.Identifiers.Where(s=>s.Identifier.Name=="a").Single();
            SsaIdentifier b = ssa.Identifiers.Where(s => s.Identifier.Name == "b").Single();
            SsaIdentifier c_2 = ssa.Identifiers.Where(s => s.Identifier.Name == "c_2").Single();
			Assert.IsFalse(sla.IsLiveOut(a.Identifier, block.Statements[1]), "a should be dead after its last use");
			Assert.IsTrue(sla.IsLiveOut(a.Identifier, block.Statements[0]), "a should be live after the first use");
			Assert.IsFalse(sla.IsDefinedAtStatement(c_2, block.Statements[0]));
			Assert.IsFalse(sla.IsDefinedAtStatement(b, block.Statements[0]));
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:25,代码来源:SsaLivenessTests.cs

示例5: RenderResult

        private void RenderResult(Program prog, string outputFile)
        {
            foreach (var item in asm.ImportReferences)
            {
                prog.ImportReferences.Add(item.Key, item.Value);
            }

            using (FileUnitTester fut = new FileUnitTester(outputFile))
            {
                Dumper dumper = new Dumper(prog.Architecture);
                dumper.ShowAddresses = true;
                dumper.ShowCodeBytes = true;
                var mem = prog.SegmentMap.Segments.Values.First().MemoryArea;
                var formatter = new TextFormatter(fut.TextWriter);
                dumper.DumpData(prog.SegmentMap, mem.BaseAddress, mem.Bytes.Length, formatter);
                fut.TextWriter.WriteLine();
                dumper.DumpAssembler(prog.SegmentMap, mem.BaseAddress, mem.EndAddress, formatter);
                if (prog.ImportReferences.Count > 0)
                {
                    var list = new SortedList<Address, ImportReference>(prog.ImportReferences);
                    foreach (var de in list)
                    {
                        fut.TextWriter.WriteLine("{0}: {1}", de, de.Value);
                    }
                }
                fut.AssertFilesEqual();
            }
        }
开发者ID:relaxar,项目名称:reko,代码行数:28,代码来源:M68kTextAssemblerTests.cs

示例6: RunTest

 private void RunTest(ProcedureBuilder mock, string outputFile)
 {
     using (FileUnitTester fut = new FileUnitTester(outputFile))
     {
         mock.Procedure.Write(true, fut.TextWriter);
         fut.AssertFilesEqual();
     }
 }
开发者ID:nemerle,项目名称:reko,代码行数:8,代码来源:ProcedureMockTest.cs

示例7: Verify

 private void Verify(string outputFileName)
 {
     using (FileUnitTester fut = new FileUnitTester(outputFileName))
     {
         store.Write(fut.TextWriter);
         fut.AssertFilesEqual();
     }
 }
开发者ID:relaxar,项目名称:reko,代码行数:8,代码来源:ExpressionTypeDescenderTests.cs

示例8: X86Rw_MemOperations

		public void X86Rw_MemOperations()
		{
			DoRewriteFile("Fragments/memoperations.asm");
			using (FileUnitTester fut = new FileUnitTester("Intel/RwMemOperations.txt"))
			{
				prog.Procedures.Values[0].Write(false, fut.TextWriter);
				fut.AssertFilesEqual();
			}
		}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:9,代码来源:RewriterTests2.cs

示例9: Verify

 private void Verify(SerializedSignature ssig, string outputFilename)
 {
     using (FileUnitTester fut = new FileUnitTester(outputFilename))
     {
         XmlTextWriter x = new FilteringXmlWriter(fut.TextWriter);
         x.Formatting = Formatting.Indented;
         XmlSerializer ser = SerializedLibrary.CreateSerializer_v1(ssig.GetType());
         ser.Serialize(x, ssig);
         fut.AssertFilesEqual();
     }
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:11,代码来源:PowerPcProcedureSerializerTests.cs

示例10: DumpProgAndStore

        private void DumpProgAndStore(Program prog, FileUnitTester fut)
        {
            foreach (Procedure proc in prog.Procedures.Values)
            {
                proc.Write(false, fut.TextWriter);
                fut.TextWriter.WriteLine();
            }

            prog.TypeStore.Write(fut.TextWriter);
            fut.AssertFilesEqual();
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:11,代码来源:TypeCollectorTests.cs

示例11: BitSetAllEnumerate

        public void BitSetAllEnumerate()
        {
            using (FileUnitTester fut = new FileUnitTester("Core/BitSetAll.txt"))
            {
                BitSet a = new BitSet(8);
                a.SetAll(true);
                EnumerateBitsetBackwards(a, fut.TextWriter);
                fut.AssertFilesEqual();

            }
        }
开发者ID:nemerle,项目名称:reko,代码行数:11,代码来源:BitSetTests.cs

示例12: RunTest

        private void RunTest(string sourceFile, string outputFile)
        {
            DoRewriteFile(sourceFile);
            using (FileUnitTester fut = new FileUnitTester(outputFile))
            {
                foreach (Procedure proc in prog.Procedures.Values)
                    proc.Write(true, fut.TextWriter);

                fut.AssertFilesEqual();
            }
        }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:11,代码来源:RewriterTests2.cs

示例13: FrGrfTest

		public void FrGrfTest()
		{
			IntelArchitecture arch = new IntelArchitecture(ProcessorMode.Real);
			Frame f = new Frame(PrimitiveType.Word16);
			uint iSz = (uint) (FlagM.ZF|FlagM.SF);
			Identifier grfSz = f.EnsureFlagGroup(iSz, arch.GrfToString(iSz), PrimitiveType.Byte);
			using (FileUnitTester fut = new FileUnitTester("Core/FrGrfTest.txt"))
			{
				f.Write(fut.TextWriter);
				fut.AssertFilesEqual();
			}
		}
开发者ID:killbug2004,项目名称:reko,代码行数:12,代码来源:FrameTests.cs

示例14: AnAliasExpanderTest

		public void AnAliasExpanderTest()
		{
			Program prog = RewriteFile("Fragments/alias_regs.asm");
			Procedure proc = prog.Procedures.Values[0];
			Aliases alias = new Aliases(proc, prog.Architecture);
			alias.Transform();
			using (FileUnitTester fut = new FileUnitTester("Analysis/AnAliasExpanderTest.txt"))
			{
				proc.Write(true, fut.TextWriter);
				fut.AssertFilesEqual();
			}
		}
开发者ID:killbug2004,项目名称:reko,代码行数:12,代码来源:AnalysisTests.cs

示例15: SltManyIncrements

 public void SltManyIncrements()
 {
     Build(new ManyIncrements().Procedure, new FakeArchitecture());
     using (FileUnitTester fut = new FileUnitTester("Analysis/SltManyIncrements.txt"))
     {
         ssa.Write(fut.TextWriter);
         proc.Write(false, fut.TextWriter);
         fut.TextWriter.WriteLine("- Interference graph -------------------");
         sla2.InterferenceGraph.Write(fut.TextWriter);
         fut.AssertFilesEqual();
     }
 }
开发者ID:nemerle,项目名称:reko,代码行数:12,代码来源:SsaLivenessTests.cs


注:本文中的FileUnitTester.AssertFilesEqual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。