Skip to content

Commit

Permalink
Fix DoubleExamplesTest::testMul by collecting all states
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipen committed Dec 9, 2024
1 parent f357dec commit 1eed307
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package org.usvm.samples.primitives

import org.junit.jupiter.api.Test
import org.usvm.SolverType
import org.usvm.StateCollectionStrategy
import org.usvm.samples.JavaMethodTestRunner
import org.usvm.test.util.checkers.eq
import org.usvm.test.util.checkers.ignoreNumberOfAnalysisResults


@Suppress("SimplifyNegatedBinaryExpression")
internal class DoubleExamplesTest : JavaMethodTestRunner() {
@Test
Expand Down Expand Up @@ -76,10 +76,15 @@ internal class DoubleExamplesTest : JavaMethodTestRunner() {

@Test
fun testMul() {
withOptions(options.copy(solverType = SolverType.YICES)) {
withOptions(
options.copy(
solverType = SolverType.YICES,
stateCollectionStrategy = StateCollectionStrategy.ALL,
)
) {
checkDiscoveredProperties(
DoubleExamples::mul,
eq(6),
ignoreNumberOfAnalysisResults,
{ _, a, b, r -> (a * b).isNaN() && r == 0.0 }, // 0 * inf || a == nan || b == nan
{ _, a, b, r -> !(a * b > 33.32) && !(a * b > 33.333) && r == 1.3 }, // 1.3, 1-1 false, 2-1 false
{ _, a, b, r -> a * b == 33.333 && r == 1.3 }, // 1.3, 1-1 true, 1-2 false, 2-1 false
Expand Down

0 comments on commit 1eed307

Please sign in to comment.