Skip to content

Commit

Permalink
rename tests, add some assertions
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Dec 14, 2024
1 parent c654d4b commit c2f20ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package org.hyperledger.besu.nativelib.gnark;

//

import com.google.common.base.Stopwatch;
import com.google.common.io.CharStreams;
import org.apache.tuweni.bytes.Bytes;
Expand All @@ -35,9 +33,9 @@
import static org.hyperledger.besu.nativelib.gnark.LibGnarkEIP2537.EIP2537_PREALLOCATE_FOR_ERROR_BYTES;
import static org.hyperledger.besu.nativelib.gnark.LibGnarkEIP2537.EIP2537_PREALLOCATE_FOR_RESULT_BYTES;

@Ignore(value = "This is exploratory to discover performance on various platforms")
//@Ignore(value = "This is exploratory to discover performance on various platforms")
@RunWith(Parameterized.class)
public class BLS12G1MultiExpPrecompiledContractComparisonTest {
public class BLS12G1MultiExpComparisonTest {
@Parameterized.Parameter(0)
public String input;
@Parameterized.Parameter(1)
Expand All @@ -51,7 +49,7 @@ public class BLS12G1MultiExpPrecompiledContractComparisonTest {
public static Iterable<String[]> parameters() throws IOException {
return CharStreams.readLines(
new InputStreamReader(
BLS12G1MultiExpPrecompiledContractComparisonTest.class
BLS12G1MultiExpComparisonTest.class
.getResourceAsStream("g1_multiexp_pair_comparison.csv"),
UTF_8))
.stream()
Expand Down Expand Up @@ -128,6 +126,8 @@ public void shouldCalculate() {

if (error1Str.isEmpty()) {
assertThat(error1Str).isEqualTo(notes);
assertThat(error2Str).isEqualTo(notes);
assertThat(error3Str).isEqualTo(notes);
} else {
final Bytes actualComputation1 = Bytes.wrap(output1, 0, 128);
final Bytes actualComputation2 = Bytes.wrap(output2, 0, 128);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package org.hyperledger.besu.nativelib.gnark;

//

import com.google.common.base.Stopwatch;
import com.google.common.io.CharStreams;
import org.apache.tuweni.bytes.Bytes;
Expand All @@ -35,9 +33,9 @@
import static org.hyperledger.besu.nativelib.gnark.LibGnarkEIP2537.EIP2537_PREALLOCATE_FOR_ERROR_BYTES;
import static org.hyperledger.besu.nativelib.gnark.LibGnarkEIP2537.EIP2537_PREALLOCATE_FOR_RESULT_BYTES;

@Ignore(value = "This is exploratory to discover performance on various platforms")
//@Ignore(value = "This is exploratory to discover performance on various platforms")
@RunWith(Parameterized.class)
public class BLS12G2MultiExpPrecompiledContractComparisonTest {
public class BLS12G2MultiExpComparisonTest {
@Parameterized.Parameter(0)
public String input;
@Parameterized.Parameter(1)
Expand All @@ -51,7 +49,7 @@ public class BLS12G2MultiExpPrecompiledContractComparisonTest {
public static Iterable<String[]> parameters() throws IOException {
return CharStreams.readLines(
new InputStreamReader(
BLS12G2MultiExpPrecompiledContractComparisonTest.class
BLS12G2MultiExpComparisonTest.class
.getResourceAsStream("g2_multiexp_pair_comparison.csv"),
UTF_8))
.stream()
Expand Down Expand Up @@ -128,6 +126,8 @@ public void shouldCalculate() {

if (error1Str.isEmpty()) {
assertThat(error1Str).isEqualTo(notes);
assertThat(error2Str).isEqualTo(notes);
assertThat(error3Str).isEqualTo(notes);
} else {
final Bytes actualComputation1 = Bytes.wrap(output1, 0, 256);
final Bytes actualComputation2 = Bytes.wrap(output2, 0, 256);
Expand Down

0 comments on commit c2f20ad

Please sign in to comment.