示例#1
0
        public void ScheduleOneSeqMixer(bool enableGC, bool enableOptimizations)
        {
            JSProgram program = new JSProgram();

            program.AddInputBlock("a", 10);
            program.AddInputBlock("b", 10);
            program.AddMixerSegment("c", "a", 1, false, "b", 1, false);
            program.Finish();

            (string, int)[] leftoverFluids = new (string, int)[]
示例#2
0
        public void ParseMixerBlock()
        {
            JSProgram program = new JSProgram();

            program.AddMixerSegment("a", "b", 10, false, "c", 0, true);
            TestTools.ExecuteJS(program);

            XmlNode    node       = TestTools.GetWorkspace();
            ParserInfo parserInfo = new ParserInfo();

            parserInfo.EnterDFG();
            parserInfo.AddVariable("", VariableType.FLUID, "a");
            parserInfo.AddVariable("", VariableType.FLUID, "b");
            parserInfo.AddVariable("", VariableType.FLUID, "c");
            Mixer mixer = (Mixer)XmlParser.ParseBlock(node, null, parserInfo);

            Assert.AreEqual(0, parserInfo.ParseExceptions.Count, parserInfo.ParseExceptions.FirstOrDefault()?.Message);
            Assert.AreEqual("a", mixer.OutputVariable);
        }