From b77bd7081736c4850998790c1647461652ed2ac2 Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Fri, 25 Nov 2022 14:51:12 +0000 Subject: [PATCH] enhancing the performance test --- bindings/java/build.gradle | 7 ++++++- .../src/test/java/ethereum/ckzg4844/CKZg4844JNITest.java | 9 +++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bindings/java/build.gradle b/bindings/java/build.gradle index 56037bd..00165b8 100644 --- a/bindings/java/build.gradle +++ b/bindings/java/build.gradle @@ -7,7 +7,12 @@ repositories { } dependencies { - testImplementation("org.junit.jupiter:junit-jupiter:5.9.1") + + def junitVersion = "5.9.1" + + testImplementation("org.junit.jupiter:junit-jupiter:${junitVersion}") + testImplementation("org.junit.jupiter:junit-jupiter-params:${junitVersion}") + } test { diff --git a/bindings/java/src/test/java/ethereum/ckzg4844/CKZg4844JNITest.java b/bindings/java/src/test/java/ethereum/ckzg4844/CKZg4844JNITest.java index 62f8c0b..4e3ebd8 100644 --- a/bindings/java/src/test/java/ethereum/ckzg4844/CKZg4844JNITest.java +++ b/bindings/java/src/test/java/ethereum/ckzg4844/CKZg4844JNITest.java @@ -11,6 +11,8 @@ import java.util.Random; import java.util.stream.IntStream; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; public class CKZg4844JNITest { @@ -65,13 +67,12 @@ public class CKZg4844JNITest { } @Disabled("Use for manually testing performance.") - @Test - public void testPerformance() { + @ParameterizedTest + @ValueSource(ints = {1, 10, 100, 1000}) + public void testPerformance(final int count) { loadTrustedSetup(); - final int count = 100; - final byte[] blobs = createRandomBlobs(count); final byte[] commitments = getCommitmentsForBlobs(blobs, count);