Fix package prefix check for windows file separators.
Change-Id: I0ec100b5733a2e2a35b44ad8255802590660fb5d
diff --git a/src/test/java/com/android/tools/r8/benchmarks/appdumps/AppDumpBenchmarkBuilder.java b/src/test/java/com/android/tools/r8/benchmarks/appdumps/AppDumpBenchmarkBuilder.java
index ffe2ad5..f8b16df 100644
--- a/src/test/java/com/android/tools/r8/benchmarks/appdumps/AppDumpBenchmarkBuilder.java
+++ b/src/test/java/com/android/tools/r8/benchmarks/appdumps/AppDumpBenchmarkBuilder.java
@@ -200,6 +200,9 @@
PackageSplitResources resources =
PackageSplitResources.create(
environment.getTemp(), dump.getProgramArchive(), builder.programPackages);
+ if (resources.getPackageFiles().isEmpty()) {
+ throw new RuntimeException("Unexpected empty set of program package files");
+ }
TestBase.testForD8(environment.getTemp(), Backend.DEX)
.addProgramFiles(resources.getOtherFiles())
diff --git a/src/test/java/com/android/tools/r8/benchmarks/appdumps/PackageSplitResources.java b/src/test/java/com/android/tools/r8/benchmarks/appdumps/PackageSplitResources.java
index 4a5337f..b0566ac 100644
--- a/src/test/java/com/android/tools/r8/benchmarks/appdumps/PackageSplitResources.java
+++ b/src/test/java/com/android/tools/r8/benchmarks/appdumps/PackageSplitResources.java
@@ -5,6 +5,7 @@
import com.android.tools.r8.utils.FileUtils;
import com.android.tools.r8.utils.ZipUtils;
+import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -46,6 +47,9 @@
private static boolean isInPackagePrefixes(Path file, List<String> programPackages) {
String str = file.toString();
+ if (File.separatorChar != '/') {
+ str = str.replace(File.separatorChar, '/');
+ }
for (String packagePrefix : programPackages) {
if (str.startsWith(packagePrefix)) {
return true;