Skip to content

Commit 6080ccd

Browse files
committed
8370797: Test runtime/ErrorHandling/AccessZeroNKlassHitsProtectionZone.java failed on macos 26
Reviewed-by: stuefe, kvn
1 parent 436dc68 commit 6080ccd

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

test/hotspot/jtreg/runtime/ErrorHandling/AccessZeroNKlassHitsProtectionZone.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ private static void run_test(boolean COH, boolean CDS) throws IOException, Skipp
142142
for (forceBase = start; forceBase < end; forceBase += step) {
143143
String thisBaseString = String.format("0x%016X", forceBase).toLowerCase();
144144
output = run_test(COH, CDS, thisBaseString);
145-
if (output.contains("CompressedClassSpaceBaseAddress=" + thisBaseString + " given, but reserving class space failed.")) {
145+
if (output.contains("CompressedClassSpaceBaseAddress=" + thisBaseString + " given, but reserving class space failed.") ||
146+
output.matches ("CompressedClassSpaceBaseAddress=" + thisBaseString + " given with shift .*, cannot be used to encode class pointers")) {
147+
// possible output:
148+
// CompressedClassSpaceBaseAddress=0x0000000c00000000 given, but reserving class space failed.
149+
// CompressedClassSpaceBaseAddress=0x0000000d00000000 given with shift 6, cannot be used to encode class pointers
146150
// try next one
147151
} else if (output.contains("Successfully forced class space address to " + thisBaseString)) {
148152
break;

test/lib/jdk/test/lib/process/OutputAnalyzer.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -354,6 +354,27 @@ public OutputAnalyzer stderrShouldNotContain(String notExpectedString) {
354354
return this;
355355
}
356356

357+
/**
358+
* Returns true if stdout matches the given pattern
359+
*/
360+
public boolean stdoutMatches(String regexp) {
361+
return getStdout().matches(regexp);
362+
}
363+
364+
/**
365+
* Returns true if stderr matches the given pattern
366+
*/
367+
public boolean stderrMatches(String regexp) {
368+
return getStderr().matches(regexp);
369+
}
370+
371+
/**
372+
* Returns true if either stdout or stderr matches the given pattern
373+
*/
374+
public boolean matches(String regexp) {
375+
return stdoutMatches(regexp) || stderrMatches(regexp);
376+
}
377+
357378
/**
358379
* Verify that the stdout and stderr contents of output buffer matches
359380
* the pattern

0 commit comments

Comments
 (0)