Exemplo n.º 1
0
 private void Given_Platform(IPlatform platform)
 {
     this.oe = mr.Stub<OperatingEnvironment>();
     this.platform = platform;
     this.cfgSvc.Stub(c => c.GetEnvironment("testOS")).Return(oe);
     oe.Stub(e => e.Load(sc, null)).IgnoreArguments().Return(platform);
 }
Exemplo n.º 2
0
 private void Given_Platform(IPlatform platform)
 {
     this.oe       = mr.Stub <OperatingEnvironment>();
     this.platform = platform;
     this.cfgSvc.Stub(c => c.GetEnvironment("testOS")).Return(oe);
     oe.Stub(e => e.Load(sc, null)).IgnoreArguments().Return(platform);
 }
Exemplo n.º 3
0
 private void Given_TestOS()
 {
     this.oe = mr.Stub<OperatingEnvironment>();
     this.platform = mr.Stub<IPlatform>();
     this.cfgSvc.Stub(c => c.GetEnvironment("testOS")).Return(oe);
     oe.Stub(e => e.Load(sc, null)).IgnoreArguments().Return(platform);
     this.platform.Stub(p => p.CreateMetadata()).Return(new TypeLibrary());
 }
Exemplo n.º 4
0
 private void Given_TestOS()
 {
     this.oe       = mr.Stub <OperatingEnvironment>();
     this.platform = mr.Stub <IPlatform>();
     this.cfgSvc.Stub(c => c.GetEnvironment("testOS")).Return(oe);
     oe.Stub(e => e.Load(sc, null)).IgnoreArguments().Return(platform);
     this.platform.Stub(p => p.CreateMetadata()).Return(new TypeLibrary());
 }
Exemplo n.º 5
0
        public void Prld_issue_299()
        {
            var sExp =
                @"<?xml version=""1.0"" encoding=""utf-8""?>
<project xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns=""http://schemata.jklnet.org/Reko/v3"">
  <input>
    <filename>switch.dll</filename>
    <disassembly>switch.asm</disassembly>
    <intermediate-code>switch.dis</intermediate-code>
    <output>switch.c</output>
    <types-file>switch.h</types-file>
    <global-vars>switch.globals.c</global-vars>
    <user>
      <procedure name=""get"">
        <address>10071000</address>
        <CSignature>char * get(unsigned int n)</CSignature>
      </procedure>
      <heuristic name=""shingle"" />
    </user>
  </input>
</project>
";
            var ldr      = mr.Stub <ILoader>();
            var platform = new TestPlatform(sc);

            Given_TestArch();
            Given_TestOS();
            Given_Binary(ldr, platform);
            Given_TypeLibraryLoaderService();
            oe.Stub(o => o.TypeLibraries).Return(new List <ITypeLibraryElement>());
            oe.Stub(o => o.CharacteristicsLibraries).Return(new List <ITypeLibraryElement>());
            mr.ReplayAll();

            var prld    = new ProjectLoader(sc, ldr, listener);
            var project = prld.LoadProject("/foo/bar", new MemoryStream(Encoding.UTF8.GetBytes(sExp)));

            Assert.AreEqual(1, project.Programs.Count);
        }