From: Curt A. <ca...@us...> - 2006-03-17 05:08:38
|
Update of /cvsroot/ant-contrib/cpptasks/test/junit/net/sf/antcontrib/cpptasks/types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16602/test/junit/net/sf/antcontrib/cpptasks/types Modified Files: TestLibrarySet.java Log Message: Bug 1380336: Fail if library not found on Windows links Index: TestLibrarySet.java =================================================================== RCS file: /cvsroot/ant-contrib/cpptasks/test/junit/net/sf/antcontrib/cpptasks/types/TestLibrarySet.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TestLibrarySet.java 22 Apr 2004 09:06:55 -0000 1.14 --- TestLibrarySet.java 17 Mar 2006 05:08:32 -0000 1.15 *************** *** 289,293 **** /** ! * Run testVisitFiles with the MSVC Linker * expect one matching file. * --- 289,293 ---- /** ! * Run testVisitFiles with the MSVC Librarian * expect one matching file. * *************** *** 299,301 **** --- 299,330 ---- } + + /** + * This test specifies a library pattern that should + * not match any available libraries and expects that + * a build exception will be raised. + * + * See bug 1380366 + */ + public final void testBadLibname() { + LibrarySet libset = new LibrarySet(); + Project p = new Project(); + MockBuildListener listener = new MockBuildListener(); + p.addBuildListener(listener); + libset.setProject(p); + // set libs to the file name without the suffix + CUtil.StringArrayBuilder libs = new CUtil.StringArrayBuilder("badlibname"); + libset.setLibs(libs); + + // + // collect all files visited + MockFileCollector collector = new MockFileCollector(); + try { + libset.visitLibraries(p, DevStudioLinker.getInstance(), new File[0], collector); + } catch(BuildException ex) { + return; + } + fail("visitLibraries should throw exception due to unsatisifed libname"); + } + } |