Esempio n. 1
0
        public static int twoOperationsParams(int x1, int x2)
        {
            SimpleObject obj = new SimpleObject();

            obj.addAbs(x1);
            return(obj.chainedAddAbs(x2).getResult());
        }
Esempio n. 2
0
        public static int oneOperationParams(int x)
        {
            SimpleObject obj = new SimpleObject();

            obj.addAbs(x);
            return(obj.getResult());
        }
Esempio n. 3
0
        public static int guessResultParams(int x1, int x2, int x3)
        {
            SimpleObject obj = new SimpleObject();

            obj.addAbs(x1);
            obj.addAbs(x2);
            obj.addAbs(x3);

            if (obj.getResult() == 10)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 4
0
        //@SetteRequiredStatementCoverage(value = 90)
        public static int guessImpossibleResultParams(int x1, int x2, int x3)
        {
            SimpleObject obj = new SimpleObject();

            obj.addAbs(x1);
            obj.addAbs(x2);
            obj.addAbs(x3);

            if (obj.getResult() < 0)
            {
                // only with overflow
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 5
0
        public static int oneOperationWithCheck(SimpleObject obj, int x)
        {
            if (obj == null)
            {
                return(-1);
            }

            obj.addAbs(x);
            return(obj.getResult());
        }
Esempio n. 6
0
        public static int twoOperationsWithCheck(SimpleObject obj, int x1,
                                                 int x2)
        {
            if (obj == null)
            {
                return(-1);
            }

            obj.addAbs(x1);
            return(obj.chainedAddAbs(x2).getResult());
        }
Esempio n. 7
0
        public static int guessResult(SimpleObject obj, int x1, int x2,
                                      int x3)
        {
            if (obj == null)
            {
                return(-1);
            }

            obj.addAbs(x1);
            obj.addAbs(x2);
            obj.addAbs(x3);

            if (obj.getResult() == 10)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 8
0
        //@SetteRequiredStatementCoverage(value = 90)
        public static int guessImpossibleResult(SimpleObject obj, int x1,
                                                int x2, int x3)
        {
            if (obj == null)
            {
                return(-1);
            }

            obj.addAbs(x1);
            obj.addAbs(x2);
            obj.addAbs(x3);

            if (obj.getResult() < 0)
            {
                // only with overflow
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 9
0
        public static int guessResultAndOperationCountParams(int x, int oc)
        {
            SimpleObject obj = new SimpleObject();

            for (int i = 0; i < oc; i++)
            {
                obj.addAbs(x);
            }

            if (obj.getResult() == 10 && obj.getOperationCount() == 5)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 10
0
        //@SetteRequiredStatementCoverage(value = 85)
        public static int guessImpossibleOperationCountParams(int oc)
        {
            SimpleObject obj = new SimpleObject();

            for (int i = 0; i < oc; i++)
            {
                obj.addAbs(1);
            }

            if (obj.getOperationCount() < 0)
            {
                // only with overflow
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 11
0
        public static int guessOperationCount(SimpleObject obj, int oc)
        {
            if (obj == null)
            {
                return(-1);
            }

            for (int i = 0; i < oc; i++)
            {
                obj.addAbs(1);
            }

            if (obj.getOperationCount() == 5)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 12
0
        //@SetteRequiredStatementCoverage(value = 80)
        public static int guessImpossibleResultAndOperationCount(
            SimpleObject obj, int x, int oc)
        {
            if (obj == null)
            {
                return(-1);
            }

            for (int i = 0; i < oc; i++)
            {
                obj.addAbs(x);
            }

            if (obj.getResult() == 10 && obj.getOperationCount() == 4)
            {
                // impossible
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 13
0
        //@SetteRequiredStatementCoverage(value = 87)
        public static int guessImpossibleOperationCount(SimpleObject obj,
                                                        int oc)
        {
            if (obj == null)
            {
                return(-1);
            }

            for (int i = 0; i < oc; i++)
            {
                obj.addAbs(1);
            }

            if (obj.getOperationCount() < 0)
            {
                // impossible
                throw new Exception();
            }
            else
            {
                return(0);
            }
        }
Esempio n. 14
0
 public static int twoOperationsWithNocheck(SimpleObject obj,
                                            int x1, int x2)
 {
     obj.addAbs(x1);
     return(obj.chainedAddAbs(x2).getResult());
 }
Esempio n. 15
0
 public static int oneOperationNoCheck(SimpleObject obj, int x)
 {
     obj.addAbs(x);
     return(obj.getResult());
 }