Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated approximations version #208

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion usvm-jvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ val `usvm-api` by sourceSets.creating {

val approximations by configurations.creating
val approximationsRepo = "com.github.UnitTestBot.java-stdlib-approximations"
val approximationsVersion = "0f081f101e"
val approximationsVersion = "5f137507d6"

dependencies {
implementation(project(":usvm-core"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,16 @@
return
}

if (method.isFinal) {
// Case for approximated interfaces
with (stmt) {

Check warning

Code scanning / detekt

Reports spaces around parentheses Warning

Unexpected spacing before "("
scope.doWithState {
newStmt(JcConcreteMethodCallInst(location, method, arguments, returnSite))
}
}
return
}

resolveVirtualInvoke(stmt, scope)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,4 +842,4 @@ open class JavaMethodTestRunner : TestRunner<JcTest, KFunction<*>, KClass<*>?, J
private val KFunction<*>.declaringClass: Class<*>?
get() = (javaMethod ?: javaConstructor)?.declaringClass

private typealias StaticsType = Map<JcClassOrInterface, List<StaticFieldValue>>
private typealias StaticsType = Map<JcClassOrInterface, List<StaticFieldValue>>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.usvm.util.isException
import kotlin.math.pow

internal class RecursionTest : ApproximationsTestRunner() {

@UsvmTest([Options([PathSelectionStrategy.CLOSEST_TO_UNCOVERED_RANDOM])])
fun testFactorial(options: UMachineOptions) {
withOptions(options) {
Expand Down Expand Up @@ -81,12 +82,15 @@ internal class RecursionTest : ApproximationsTestRunner() {

@Test
fun vertexSumTest() {
checkDiscoveredProperties(
Recursion::vertexSum,
between(2..3),
{ _, x, _ -> x <= 10 },
{ _, x, _ -> x > 10 }
)
val options = options.copy(stepsFromLastCovered = 4500L)
withOptions(options) {
checkDiscoveredProperties(
Recursion::vertexSum,
between(2..3),
{ _, x, _ -> x <= 10 },
{ _, x, _ -> x > 10 }
)
}
}

@Test
Expand Down
Loading