public void ResolveReferringAddress() { LabelAddressResolver labelAddrResolver = LabelAddressResolverTest.Make(); const UInt16 LabelAddress = 0x2468; LabelDefinition labelDef = LabelDefinitionTest.Make("LBL001", 0, LabelAddress); labelAddrResolver.LabelTable.RegisterForUnitTest(labelDef); const Int32 WordCount = 4; WordCollection actualWords = WordCollectionTest.MakeWords(WordCount); MemoryOffset wordOffset = new MemoryOffset(1); LabelReference labelRef = LabelReference.MakeForUnitTest(labelDef.Label, wordOffset); labelRef.ResolveReferringAddress(labelAddrResolver, actualWords); WordCollection expectedWords = WordCollectionTest.MakeWords(WordCount); expectedWords[wordOffset] = new Word(LabelAddress); TestUtils.CheckEnumerable( expectedWords, actualWords, "ラベルを参照する語の値がそのラベルのアドレスに置き換えられる"); }
public void TestInitialize() { m_labelAddrResolver = Make(); m_labelTable = m_labelAddrResolver.LabelTable; m_entryPointTable = m_labelAddrResolver.EntryPointTable; }