Skip to content

Commit eed3fa2

Browse files
committed
more directory excludes
1 parent 47f7adc commit eed3fa2

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

soot-infoflow-summaries/test/soot/jimple/infoflow/test/methodSummary/junit/SummaryTaintWrapperTests.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ public void setSootOptions(Options options, InfoflowConfiguration config) {
299299

300300
@BeforeClass
301301
public static void setUp() throws IOException {
302-
final String sep = System.getProperty("path.separator");
303302
File f = new File(".");
304303
File testSrc1 = new File(f, "bin");
305304
File testSrc2 = new File(f, "testBin");
@@ -310,9 +309,29 @@ public static void setUp() throws IOException {
310309
fail("Test aborted - none of the test sources are available");
311310
}
312311

313-
appPath = testSrc1.getCanonicalPath() + sep + testSrc2.getCanonicalPath() + sep + testSrc3.getCanonicalPath()
314-
+ sep + testSrc4.getCanonicalPath();
312+
StringBuilder appPathBuilder = new StringBuilder();
313+
appendWithSeparator(appPathBuilder, testSrc1);
314+
appendWithSeparator(appPathBuilder, testSrc2);
315+
appendWithSeparator(appPathBuilder, testSrc3);
316+
appendWithSeparator(appPathBuilder, testSrc4);
317+
appPath = appPathBuilder.toString();
318+
315319
libPath = System.getProperty("java.home") + File.separator + "lib" + File.separator + "rt.jar";
316320
}
317321

322+
/**
323+
* Appends the given path to the given {@link StringBuilder} if it exists
324+
*
325+
* @param sb The {@link StringBuilder} to which to append the path
326+
* @param f The path to append
327+
* @throws IOException
328+
*/
329+
private static void appendWithSeparator(StringBuilder sb, File f) throws IOException {
330+
if (f.exists()) {
331+
if (sb.length() > 0)
332+
sb.append(System.getProperty("path.separator"));
333+
sb.append(f.getCanonicalPath());
334+
}
335+
}
336+
318337
}

soot-infoflow-summaries/test/soot/jimple/infoflow/test/methodSummary/junit/TestHelper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public abstract class TestHelper {
4747

4848
@BeforeClass
4949
public static void setUp() throws IOException {
50-
final String sep = System.getProperty("path.separator");
51-
5250
File f = new File(".");
5351
File testSrc1 = new File(f, "testBin");
5452
File testSrc2 = new File(f, "build" + File.separator + "testclasses");

0 commit comments

Comments
 (0)