1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.github.maven_nar.cpptasks.msvc;
21
22 import java.io.File;
23
24
25
26
27
28
29 public class TestInstalledMsvcLinker extends TestMsvcLinker {
30 public TestInstalledMsvcLinker(final String name) {
31 super(name);
32 }
33
34 public void failingtestGetLibraryPath() {
35 final File[] libpath = MsvcLinker.getInstance().getLibraryPath();
36
37
38
39 assertTrue(libpath.length >= 2);
40
41
42
43 final String[] libnames = new String[] {
44 "kernel32.lib", "advapi32.lib", "msvcrt.lib", "mfc42.lib", "mfc70.lib"
45 };
46 final boolean[] libfound = new boolean[libnames.length];
47 for (final File element : libpath) {
48 for (int j = 0; j < libnames.length; j++) {
49 final File libfile = new File(element, libnames[j]);
50 if (libfile.exists()) {
51 libfound[j] = true;
52 }
53 }
54 }
55 assertTrue("kernel32 not found", libfound[0]);
56 assertTrue("advapi32 not found", libfound[1]);
57 assertTrue("msvcrt not found", libfound[2]);
58 if (!(libfound[3] || libfound[4])) {
59 fail("mfc42.lib or mfc70.lib not found");
60 }
61 }
62 }