Example #1
0
        public void OpenFL_InstructionArgumentValidator_Correct_Test()
        {
            TestSetup.SetupTestingSession();
            FLSetup setup = new FLSetup(nameof(OpenFL_InstructionArgumentValidator_Correct_Test), "resources/kernel");


            setup.Parser.Process(
                new FLParserInput("resources/filter/program_checks/instructionargument_validator_correct.fl"));

            setup.Dispose();
        }
Example #2
0
        public void OpenFL_FilePathValidator_Incorrect_Test()
        {
            TestSetup.SetupTestingSession();
            FLSetup setup = new FLSetup(nameof(OpenFL_FilePathValidator_Incorrect_Test), "resources/kernel");

            Assert.Catch <FLProgramCheckException>(() =>
                                                   setup.Parser.Process(
                                                       new FLParserInput("resources/filter/program_checks/filepath_validator_incorrect.fl")),
                                                   "Did not detect Wrong FilePath");
            setup.Dispose();
        }
Example #3
0
        public void OpenFL_RemoveUnusedFunctions_Test()
        {
            TestSetup.SetupTestingSession();
            FLSetup setup = new FLSetup(nameof(OpenFL_RemoveUnusedFunctions_Test), "resources/kernel");


            SerializableFLProgram ret = setup.Parser.Process(
                new FLParserInput("resources/filter/program_checks/optimizations/remove_unused_functions.fl"));

            Assert.AreEqual(2, ret.Functions.Count);

            setup.Dispose();
        }
Example #4
0
        public void OpenFL_RemoveUnusedBuffers_Test()
        {
            TestSetup.SetupTestingSession();
            FLSetup setup = new FLSetup(nameof(OpenFL_RemoveUnusedBuffers_Test), "resources/kernel");


            SerializableFLProgram ret = setup.Parser.Process(
                new FLParserInput("resources/filter/program_checks/optimizations/remove_unused_buffers.fl"));

            Assert.AreEqual(1,
                            ret.DefinedBuffers.Count); //1 and not 0 because the "in" (input) buffer is also in the defined buffers.
            setup.Dispose();
        }