public void Segfp_user_placement() { Given_Executable(".text", 0x0010_0000, 0x4000); Given_Procedure(0x00101000); Given_Procedure(0x00101100); Given_UserProcedure(0x00101000, "myproc", "myproc.c"); var ofp = new SegmentFilePolicy(program); var placements = ofp.GetProcedurePlacements(".asm").ToArray(); Assert.AreEqual(2, placements.Length); Assert.AreEqual("myproc.asm", placements[0].Key); Assert.AreEqual("myprogram_text.asm", placements[1].Key); }
public void Segfp_Single_Segment() { Given_Executable(".text", 0x00100000, 0x4000); Given_Procedure(0x00101000); var ofp = new SegmentFilePolicy(program); var placements = ofp.GetProcedurePlacements(".asm").ToArray(); Assert.AreEqual(1, placements.Length); Assert.AreEqual("myprogram_text.asm", placements[0].Key); var procs = placements[0].Value; Assert.AreEqual(1, procs.Count); Assert.AreEqual("fn00101000", procs[0].Name); }
public void Segfp_large_segment() { Given_Executable(".text", 0x0010_0000, 0x10_0000); Given_Procedure(0x00101000); Given_Procedure(0x00113F00); Given_Procedure(0x00133F00); var ofp = new SegmentFilePolicy(program); var placements = ofp.GetProcedurePlacements(".asm").ToArray(); Assert.AreEqual(3, placements.Length); Assert.AreEqual("myprogram_text_0000.asm", placements[0].Key); Assert.AreEqual("myprogram_text_0001.asm", placements[1].Key); Assert.AreEqual("myprogram_text_0003.asm", placements[2].Key); Assert.IsTrue(placements.All(p => p.Value.Count == 1)); }