From 83b936ab7b8a9cde9532f5778eabbe19939a131f Mon Sep 17 00:00:00 2001 From: Christian Haeubl Date: Wed, 27 Mar 2024 11:23:56 +0100 Subject: [PATCH] Minor cleanups. --- .../svm/test/jfr/TestGCHeapSummaryEvent.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestGCHeapSummaryEvent.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestGCHeapSummaryEvent.java index 95ba749f82e2..627cb16d4083 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestGCHeapSummaryEvent.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestGCHeapSummaryEvent.java @@ -25,17 +25,18 @@ package com.oracle.svm.test.jfr; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.List; -import jdk.jfr.consumer.RecordedObject; import org.junit.Test; import com.oracle.svm.core.jfr.JfrEvent; import jdk.jfr.Recording; import jdk.jfr.consumer.RecordedEvent; +import jdk.jfr.consumer.RecordedObject; public class TestGCHeapSummaryEvent extends JfrRecordingTest { @Test @@ -52,11 +53,13 @@ private static void validateEvents(List events) { assertTrue(events.size() > 0); for (RecordedEvent event : events) { RecordedObject heapSpace = event.getValue("heapSpace"); - assertTrue(heapSpace.getLong("start") == -1); - assertTrue(heapSpace.getLong("committedEnd") == -1); - assertTrue(heapSpace.getLong("reservedEnd") == -1); - assertTrue(heapSpace.getLong("committedSize") > 0); - assertTrue(heapSpace.getLong("reservedSize") >= heapSpace.getLong("committedSize")); + assertEquals(-1, heapSpace.getLong("start")); + assertEquals(-1, heapSpace.getLong("committedEnd")); + assertEquals(-1, heapSpace.getLong("reservedEnd")); + + long committedSize = heapSpace.getLong("committedSize"); + assertTrue(committedSize > 0); + assertTrue(heapSpace.getLong("reservedSize") >= committedSize); assertTrue(event.getLong("gcId") >= 0); assertTrue(event.getString("when").equals("Before GC") || event.getString("when").equals("After GC")); assertTrue(event.getLong("heapUsed") > 0);