Skip to content

Commit

Permalink
Detekt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CaelmBleidd committed Jul 23, 2024
1 parent 080b617 commit 4eb7c06
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions usvm-ts/src/main/kotlin/org/usvm/TSComponents.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.usvm.types.UTypeSystem

class TSComponents(
private val typeSystem: TSTypeSystem,
private val options: UMachineOptions
private val options: UMachineOptions,
) : UComponents<EtsType, TSSizeSort> {
private val closeableResources = mutableListOf<AutoCloseable>()

Expand All @@ -22,7 +22,7 @@ class TSComponents(
}

override fun mkTypeSystem(
ctx: UContext<TSSizeSort>
ctx: UContext<TSSizeSort>,
): UTypeSystem<EtsType> = typeSystem

override fun <Context : UContext<TSSizeSort>> mkSolver(ctx: Context): USolverBase<EtsType> {
Expand Down
4 changes: 1 addition & 3 deletions usvm-ts/src/main/kotlin/org/usvm/TSContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package org.usvm

typealias TSSizeSort = UBv32Sort

class TSContext(components: TSComponents) : UContext<TSSizeSort>(components) {

}
class TSContext(components: TSComponents) : UContext<TSSizeSort>(components)
2 changes: 1 addition & 1 deletion usvm-ts/src/main/kotlin/org/usvm/TSInterpreter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.usvm.targets.UTargetsSet

class TSInterpreter(
private val ctx: TSContext,
private val applicationGraph: TSApplicationGraph
private val applicationGraph: TSApplicationGraph,
) : UInterpreter<TSState>() {
private val forkBlackList: UForkBlackList<TSState, EtsStmt> = UForkBlackList.createDefault()

Expand Down
3 changes: 1 addition & 2 deletions usvm-ts/src/main/kotlin/org/usvm/TSTarget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ package org.usvm
import org.jacodb.ets.base.EtsStmt
import org.usvm.targets.UTarget

class TSTarget : UTarget<EtsStmt, TSTarget>() {
}
class TSTarget : UTarget<EtsStmt, TSTarget>()
4 changes: 2 additions & 2 deletions usvm-ts/src/main/kotlin/org/usvm/TSTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.jacodb.ets.base.EtsStmt
class TSTest(
val parameters: List<Any>,
val resultValue: Any?,
val trace: List<EtsStmt>? = null
val trace: List<EtsStmt>? = null,
)

class TSMethodCoverage
class TSMethodCoverage
2 changes: 1 addition & 1 deletion usvm-ts/src/main/kotlin/org/usvm/TSTypeSystem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import kotlin.time.Duration

class TSTypeSystem(
override val typeOperationsTimeout: Duration,
val project: EtsFile
val project: EtsFile,
) : UTypeSystem<EtsType> {
override fun isSupertype(supertype: EtsType, type: EtsType): Boolean {
TODO("Not yet implemented")
Expand Down
9 changes: 8 additions & 1 deletion usvm-ts/src/main/kotlin/org/usvm/state/TSState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ class TSState(
var methodResult: TSMethodResult = TSMethodResult.NoCall,
targets: UTargetsSet<TSTarget, EtsStmt> = UTargetsSet.empty(),
) : UState<EtsType, EtsMethod, EtsStmt, TSContext, TSTarget, TSState>(
ctx, callStack, pathConstraints, memory, models, pathNode, forkPoints, targets
ctx,
callStack,
pathConstraints,
memory,
models,
pathNode,
forkPoints,
targets
) {
override fun clone(newConstraints: UPathConstraints<EtsType>?): TSState {
val clonedConstraints = newConstraints ?: pathConstraints.clone()
Expand Down
3 changes: 1 addition & 2 deletions usvm-ts/src/test/kotlin/org/usvm/util/TSMethodTestRunner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ open class TSMethodTestRunner : TestRunner<TSTest, MethodDescriptor, EtsType?, T
get() = TODO("Not yet implemented")

private fun getProject(fileName: String): EtsFile {
val jsonWithoutExtension = "/ir/${fileName}.json"
val jsonWithoutExtension = "/ir/$fileName.json"
val sampleFilePath = javaClass.getResourceAsStream(jsonWithoutExtension)
?: error("Resource not found: $jsonWithoutExtension")

Expand All @@ -141,7 +141,6 @@ open class TSMethodTestRunner : TestRunner<TSTest, MethodDescriptor, EtsType?, T

return cls.methods.find { it.name == desc.methodName && it.parameters.size == desc.argumentsNumber }
?: error("No method matching $desc found in $name")

}

override val runner: (MethodDescriptor, UMachineOptions) -> List<TSTest>
Expand Down

0 comments on commit 4eb7c06

Please sign in to comment.