Commit 7166a03a authored by Matthew Dawson's avatar Matthew Dawson
Browse files

Make VariableCollection handle both input and output variables.

VariableCollection now holds both the input and output variables.  To construct
a VariableCollection, two PartialVariableCollections are used that hold the
input and output variables.  The two are appropriately combined, while still
allowing the inputs and outputs to be separately pulled.

A single PartialVariableCollection also works, to allow for an input only
collection, which is useful for testing.
parent d8b626bb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public class GenericOperationGeneratorTest {
    @Test
    public void RealTest() {
        if (RealExpectedOutput != null) {
            VariableCollection vars = variableParser.parseVariables("x");
            VariableCollection vars = new VariableCollection(variableParser.parseVariables("x"));
            Expression expr = PVSSimpleParser.parsePVSCode(vars, query);
            assertEquals(RealExpectedOutput, expr.getCheckerOutput(generator, outputType));
        }
@@ -107,7 +107,7 @@ public class GenericOperationGeneratorTest {
    @Test
    public void SignedFixedPointTest() {
        if (SignedFixedPointExpectedOutput != null) {
            VariableCollection vars = variableParser.parseVariables("x:fixedt(1, 8, 2)");
            VariableCollection vars = new VariableCollection(variableParser.parseVariables("x:fixedt(1, 8, 2)"));
            Expression expr = PVSSimpleParser.parsePVSCode(vars, query);
            assertEquals(SignedFixedPointExpectedOutput, expr.getCheckerOutput(generator, outputType));
        }
@@ -116,7 +116,7 @@ public class GenericOperationGeneratorTest {
    @Test
    public void UnsignedFixedPointTest() {
        if (UnsignedFixedPointExpectedOutput != null) {
            VariableCollection vars = variableParser.parseVariables("x:fixedt(0, 8, 2)");
            VariableCollection vars = new VariableCollection(variableParser.parseVariables("x:fixedt(0, 8, 2)"));
            Expression expr = PVSSimpleParser.parsePVSCode(vars, query);
            assertEquals(UnsignedFixedPointExpectedOutput, expr.getCheckerOutput(generator, outputType));
        }
Loading