private void CheckAssignedLabelAddress( LabelDefinition[] expectedLabelDefs, RelocatableModule relModule, String message) { IEnumerable <LabelDefinition> actualLabelDefs = relModule.LabelTable.LabelDefinitions; TestUtils.CheckEnumerable(expectedLabelDefs, actualLabelDefs, LabelDefinitionTest.Check, message); }
private void CheckGenerateCode(ProgramLine target, Word[] expectedWords, String message) { RelocatableModule relModule = new RelocatableModule(); target.GenerateCode(relModule); RelocatableModuleTest.CheckWords(relModule, expectedWords, message); }
internal static void CheckGenerateCode(ICodeGenerator target, Word[] expectedWords, String message) { RelocatableModule relModule = new RelocatableModule(); target.GenerateCode(relModule); RelocatableModuleTest.CheckWords(relModule, expectedWords, message); }
public void TestInitialize() { m_relModule1 = new RelocatableModule(); m_relModule2 = new RelocatableModule(); m_relModule3 = new RelocatableModule(); m_target = Make(m_relModule1, m_relModule2, m_relModule3); }
public void TestInitialize() { m_subRelModule = MakeRelModule(SubProgramSourceText); m_mainRelModule = MakeRelModule(MainProgramSourceText); m_relModules = new ItemSelectableCollection <RelocatableModule>( TestUtils.MakeArray(m_subRelModule, m_mainRelModule), MainRelModuleIndex); }
private void CheckSelectedItemIndex(RelocatableModule itemToSelect, Int32 expected, String message) { m_target.SelectItem(itemToSelect); Int32 actual = m_target.SelectedItemIndex; Assert.AreEqual(expected, actual, message); }
public void SelectItem() { RelocatableModule notInCollection = new RelocatableModule(); RelocatableModule inCollection = m_relModule2; CheckSelectItem(null, false, "null => 例外"); CheckSelectItem(notInCollection, false, "コレクションに含まれない項目 => 例外"); CheckSelectItem(inCollection, true, "コレクションに含まれる項目 => OK"); }
private void CheckGenerateCode(Int32 wordCountValue, String message) { AsmDsInstruction target = MakeTarget(wordCountValue); const Label DefinedLabel = null; RelocatableModule relModule = new RelocatableModule(); target.GenerateCode(DefinedLabel, relModule); // 確保する語数分の 0 の語が追加される。 Word[] expectedWords = WordTest.MakeCountArray(Word.Zero, wordCountValue); RelocatableModuleTest.CheckWords(relModule, expectedWords, message); }
private void CheckSelectItem(RelocatableModule itemToSelect, Boolean success, String message) { try { m_target.SelectItem(itemToSelect); Assert.IsTrue(success, message); } catch (Casl2SimulatorException) { Assert.IsFalse(success, message); } }
private void CheckGenerateCode(String[] sourceText, Word[] expectedWords, String message) { SourceFile srcFile = SourceFile.MakeForUnitTest("Name", sourceText); try { RelocatableModule relModule = Assembler.AssembleForUnitTest(srcFile); Assert.IsNotNull(expectedWords, message); Assert.IsNotNull(relModule, message); RelocatableModuleTest.CheckWords(relModule, expectedWords, message); } catch (Casl2SimulatorException) { Assert.IsNull(expectedWords, message); } }
public void TestInitialize() { m_relModule = new RelocatableModule(); m_definedLabel = new Label("ENTRY"); m_execStartLabel = new Label("EXECSTRT"); }
internal static void CheckWords(RelocatableModule relModule, Word[] expectedWords, String message) { IEnumerable <Word> actualWords = relModule.Words; TestUtils.CheckEnumerable(expectedWords, actualWords, WordTest.Check, message); }
public void TestInitialize() { m_relModule = new RelocatableModule(); m_label = new Label("LBL001"); }