Пример #1
0
        public void GenerateCode_WithDefinedLabel_NoExecStartLabel()
        {
            ExecStartAddress execStartAddress = ExecStartAddress.MakeForUnitTest(null);

            CheckGenerateCode(m_definedLabel, execStartAddress, true, "実行開始番地のラベルが空");
            CheckEntryPoint(
                m_definedLabel, m_definedLabel,
                "ExecStartLabel と ExportLabel の両方に START 命令に定義したラベルが設定される");
        }
        private void CheckParse(String text, Boolean success, Label expected, String message)
        {
            ExecStartAddress target = OperandTest.CheckParse(ExecStartAddress.Parse, text, success, message);

            if (success)
            {
                Label actual = target.Label;
                LabelTest.Check(expected, actual, message);
            }
        }
Пример #3
0
        private void CheckGenerateCode(
            Label definedLabel, ExecStartAddress execStartAddress, Boolean success, String message)
        {
            AsmStartInstruction target = new AsmStartInstruction();

            target.SetExecStartAddressForUnitTest(execStartAddress);
            try
            {
                target.GenerateCode(definedLabel, m_relModule);
                Assert.IsTrue(success, message);
            }
            catch (Casl2SimulatorException)
            {
                Assert.IsFalse(success, message);
            }
        }
Пример #4
0
        public void GenerateCode_NoDefinedLabel()
        {
            ExecStartAddress dontCare = ExecStartAddress.MakeForUnitTest(m_execStartLabel);

            CheckGenerateCode(null, dontCare, false, "定義されたラベルなし => 例外");
        }