[Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/utilTests SortTest.java,1.12,1.13
Brought to you by:
derrickoswald
From: Derrick O. <der...@us...> - 2005-05-15 11:49:15
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/utilTests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31674/src/org/htmlparser/tests/utilTests Modified Files: SortTest.java Log Message: Documentation revamp part four. Remove some checkstyle warnings. Index: SortTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/utilTests/SortTest.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SortTest.java 31 Jul 2004 16:42:32 -0000 1.12 --- SortTest.java 15 May 2005 11:49:05 -0000 1.13 *************** *** 145,151 **** --- 145,166 ---- if (ret > Integer.MAX_VALUE) ret = Integer.MAX_VALUE; + if (0 == ret) + ret = getAbsolutePath ().hashCode () + - f.getAbsolutePath ().hashCode (); return ((int)ret); } + + public String toString () + { + StringBuffer ret; + + ret = new StringBuffer (128); + ret.append (this.getAbsolutePath ()); + ret.append ('@'); + ret.append (this.lastModified ()); + + return (ret.toString ()); + } } *************** *** 228,232 **** directory.removeElementAt (index); int ordinal = Sort.bsearch (directory, test); ! assertEquals ("ordinal not correct value", index, ordinal); // test the ordering of the objects --- 243,260 ---- directory.removeElementAt (index); int ordinal = Sort.bsearch (directory, test); ! if (index != ordinal) ! { ! for (int i = 0; i < directory.size (); i++) ! { ! if (index == i) ! System.out.print ('-'); ! else if (ordinal == i) ! System.out.print ('+'); ! else ! System.out.print (' '); ! System.out.println (directory.elementAt (i)); ! } ! fail ("ordinal not correct value, expected " + index + ", was " + ordinal); ! } // test the ordering of the objects |