[Nice-commit] Nice/src/bossa/link Dispatch.java,1.64,1.65
Brought to you by:
bonniot
From: <ar...@us...> - 2004-02-22 13:46:12
|
Update of /cvsroot/nice/Nice/src/bossa/link In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24953/F:/nice/src/bossa/link Modified Files: Dispatch.java Log Message: Give a single error at coverage test failure. Index: Dispatch.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Dispatch.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Dispatch.java 23 Oct 2003 14:49:52 -0000 1.64 --- Dispatch.java 22 Feb 2004 13:33:23 -0000 1.65 *************** *** 167,171 **** List values = generateValues(sortedAlternatives, isValue); boolean hasValues = values.size() > 0; ! int nb_errors = 0; for(Iterator i = multitags.iterator(); i.hasNext();) --- 167,171 ---- List values = generateValues(sortedAlternatives, isValue); boolean hasValues = values.size() > 0; ! List errors = new ArrayList(3); int nb_errors = 0; for(Iterator i = multitags.iterator(); i.hasNext();) *************** *** 183,187 **** } ! if (test(method, tags, sortedAlternatives, firstArg)) { if (++nb_errors > 3) --- 183,187 ---- } ! if (test(method, tags, sortedAlternatives, firstArg, errors)) { if (++nb_errors > 3) *************** *** 189,193 **** } else if (hasValues && ! testValues(method, tags, values, isValue, sortedAlternatives) ) if (++nb_errors > 0) break; --- 189,193 ---- } else if (hasValues && ! testValues(method, tags, values, isValue, sortedAlternatives, errors) ) if (++nb_errors > 0) break; *************** *** 196,200 **** if (nb_errors > 0) User.error(method, "The implementation test failed for method " + ! method.getName()); } --- 196,201 ---- if (nb_errors > 0) User.error(method, "The implementation test failed for method " + ! method.toString() + ":\n" + ! Util.map("", "\n", "", errors)); } *************** *** 221,225 **** TypeConstructor[] tags, final Stack sortedAlternatives, ! ClassType firstArg) { boolean failed = false; --- 222,227 ---- TypeConstructor[] tags, final Stack sortedAlternatives, ! ClassType firstArg, ! List errors) { boolean failed = false; *************** *** 243,250 **** { failed = true; ! User.warning ! (method, ! "Ambiguity for method "+method+ ! "\nFor parameters of type " + toString(tags)+ "\nboth\n" + first.printLocated() + "\nand\n" + a.printLocated() + "\nmatch."); --- 245,249 ---- { failed = true; ! errors.add("ambiguity for parameters of type " + toString(tags)+ "\nboth\n" + first.printLocated() + "\nand\n" + a.printLocated() + "\nmatch."); *************** *** 269,276 **** "no alternative matches " + toString(tags)); else ! User.warning(method, ! "Method " + method + " is not completely covered:\n" + ! "no alternative matches " + ! toString(tags)); } return failed; --- 268,272 ---- "no alternative matches " + toString(tags)); else ! errors.add("no alternative matches " + toString(tags)); } return failed; *************** *** 285,289 **** List valueCombis, boolean[] isValue, ! final Stack sortedAlternatives) { boolean failed = false; --- 281,286 ---- List valueCombis, boolean[] isValue, ! final Stack sortedAlternatives, ! List errors) { boolean failed = false; *************** *** 310,317 **** { failed = true; ! User.warning ! (method, ! "Ambiguity for method "+method+ ! "\nFor parameters of type/value " + toString(tags, values, isValue)+ "\nboth\n" + first.printLocated() + "\nand\n" + a.printLocated() + "\nmatch."); --- 307,311 ---- { failed = true; ! errors.add("ambiguity for parameters of type/value " + toString(tags, values, isValue)+ "\nboth\n" + first.printLocated() + "\nand\n" + a.printLocated() + "\nmatch."); *************** *** 322,329 **** { failed = true; ! User.warning(method, ! "Method " + method + " is not completely covered:\n" + ! "no alternative matches " + ! toString(tags, values, isValue)); break; } --- 316,320 ---- { failed = true; ! errors.add("no alternative matches "+ toString(tags, values, isValue)); break; } |