Skip to content

Removed from legal method names the call of the static initializer #1358

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

Merged
merged 4 commits into from
Dec 16, 2022
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
71 changes: 71 additions & 0 deletions utbot-summary-tests/src/test/kotlin/math/SummaryIntMathLogTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package math

import examples.CustomJavaDocTagsEnabler
import examples.SummaryTestCaseGeneratorTest
import guava.examples.math.IntMath
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.utbot.framework.plugin.api.MockStrategyApi
import org.utbot.framework.plugin.api.UtClusterInfo
import org.utbot.testing.DoNotCalculate

@ExtendWith(CustomJavaDocTagsEnabler::class)
class SummaryIntMathLogTest : SummaryTestCaseGeneratorTest(
IntMath::class,
) {
@Test
fun testLog2() {
val summary1 = "@utbot.classUnderTest {@link IntMath}\n" +
"@utbot.methodUnderTest {@link guava.examples.math.IntMath#log2(int,java.math.RoundingMode)}\n"
val summary2 = "@utbot.classUnderTest {@link IntMath}\n" +
"@utbot.methodUnderTest {@link guava.examples.math.IntMath#log2(int,java.math.RoundingMode)}\n"
val summary3 = "@utbot.classUnderTest {@link IntMath}\n" +
"@utbot.methodUnderTest {@link guava.examples.math.IntMath#log2(int,java.math.RoundingMode)}\n"
val summary4 = "@utbot.classUnderTest {@link IntMath}\n" +
"@utbot.methodUnderTest {@link guava.examples.math.IntMath#log2(int,java.math.RoundingMode)}\n" +
"@utbot.invokes {@link java.math.RoundingMode#ordinal()}\n" +
"@utbot.throwsException {@link java.lang.NullPointerException} in: mode"

val methodName1 = "testLog2"
val methodName2 = "testLog2_1"
val methodName3 = "testLog2_2"
val methodName4 = "testLog2_RoundingModeOrdinal"

val displayName1 = ""
val displayName2 = ""
val displayName3 = ""
val displayName4 = "switch(mode) case: -> ThrowNullPointerException"

val summaryKeys = listOf(
summary1,
summary2,
summary3,
summary4
)

val displayNames = listOf(
displayName1,
displayName2,
displayName3,
displayName4
)

val methodNames = listOf(
methodName1,
methodName2,
methodName3,
methodName4
)

val clusterInfo = listOf(
Pair(UtClusterInfo("SYMBOLIC EXECUTION: SUCCESSFUL EXECUTIONS for method log2(int, java.math.RoundingMode)", null), 3),
Pair(UtClusterInfo("SYMBOLIC EXECUTION: ERROR SUITE for method log2(int, java.math.RoundingMode)", null), 1)
)

val method = IntMath::log2
val mockStrategy = MockStrategyApi.NO_MOCKS
val coverage = DoNotCalculate

summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames, clusterInfo)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test
import org.utbot.framework.plugin.api.MockStrategyApi
import org.utbot.framework.plugin.api.UtClusterInfo
import org.utbot.testing.DoNotCalculate
class SummaryIntMathTest : SummaryTestCaseGeneratorTest(
class SummaryIntMathPowTest : SummaryTestCaseGeneratorTest(
IntMath::class,
) {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ val nextSynonyms = arrayOf(

val skipInvokes = arrayOf(
"<init>",
"<clinit>",
"valueOf",
"getClass"
)
Expand Down