Examples of AssertHasLength


Examples of dk.brics.string.stringoperations.AssertHasLength

        private void handleInvoke(InstanceInvokeExpr v) {
            SootMethodRef m = v.getMethodRef();
            if (m.getSignature().equals("<java.lang.String: int length()>")) {
                switch (relation) {
                case EQUAL:
                    makeUnaryAssertion(getBase(v), new AssertHasLength(expected, expected));
                    break;
                case NOT_EQUAL:
                    makeUnaryAssertion(getBase(v), new AssertHasNotLength(expected, expected));
                    break;
                case GREATER:
                    makeUnaryAssertion(getBase(v), new AssertHasNotLength(0, expected));
                    break;
                case GREATER_EQ:
                    makeUnaryAssertion(getBase(v), new AssertHasNotLength(0, expected-1));
                    break;
                case LESS:
                    makeUnaryAssertion(getBase(v), new AssertHasLength(0, expected-1));
                    break;
                case LESS_EQ:
                    makeUnaryAssertion(getBase(v), new AssertHasLength(0, expected));
                    break;
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.