8334040: jdk/classfile/CorpusTest.java timed out

Reviewed-by: alanb
This commit is contained in:
Adam Sotona 2024-06-24 13:34:29 +00:00
parent e825ccfe66
commit b2930c5aee

View File

@ -117,7 +117,7 @@ class CorpusTest {
static Path[] corpus() throws IOException, URISyntaxException {
splitTableAttributes("testdata/Pattern2.class", "testdata/Pattern2-split.class");
return Stream.of(
Files.walk(JRT.getPath("modules/java.base/java")),
Files.walk(JRT.getPath("modules/java.base/java/util")),
Files.walk(JRT.getPath("modules"), 2).filter(p -> p.endsWith("module-info.class")),
Files.walk(Paths.get(URI.create(CorpusTest.class.getResource("CorpusTest.class").toString())).getParent()))
.flatMap(p -> p)
@ -140,6 +140,7 @@ class CorpusTest {
for (Transforms.NoOpTransform m : Transforms.NoOpTransform.values()) {
if (m == Transforms.NoOpTransform.ARRAYCOPY
|| m == Transforms.NoOpTransform.SHARED_3_NO_STACKMAP
|| m == Transforms.NoOpTransform.CLASS_REMAPPER
|| m.name().startsWith("ASM"))
continue;
@ -190,12 +191,8 @@ class CorpusTest {
.collect(joining("\n"));
fail(String.format("Errors in testNullAdapt: %s", msg));
}
}
@ParameterizedTest
@MethodSource("corpus")
void testReadAndTransform(Path path) throws IOException {
byte[] bytes = Files.readAllBytes(path);
// test read and transform
var cc = ClassFile.of();
var classModel = cc.parse(bytes);
assertEqualsDeep(ClassRecord.ofClassModel(classModel), ClassRecord.ofStreamingElements(classModel),