-
Notifications
You must be signed in to change notification settings - Fork 46
Change a hard limit for arrays size #2006
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e9f11fb
Open module for java.io
CaelmBleidd a6c6440
Additional mock-always as test framework parameters
CaelmBleidd 373758f
Change sizes for object that are processed by the engine
CaelmBleidd 301be60
Revert sizes back
CaelmBleidd 0e93175
Review fixes
CaelmBleidd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
utbot-framework-test/src/test/kotlin/org/utbot/examples/stdlib/JavaIOFileInputStreamCheck.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.utbot.examples.stdlib | ||
|
||
import org.junit.jupiter.api.Test | ||
import org.utbot.framework.plugin.api.CodegenLanguage | ||
import org.utbot.framework.plugin.api.UtCompositeModel | ||
import org.utbot.framework.plugin.api.UtNewInstanceInstrumentation | ||
import org.utbot.framework.plugin.api.UtPrimitiveModel | ||
import org.utbot.framework.plugin.api.util.id | ||
import org.utbot.testcheckers.eq | ||
import org.utbot.testing.CodeGeneration | ||
import org.utbot.testing.DoNotCalculate | ||
import org.utbot.testing.UtValueTestCaseChecker | ||
|
||
internal class JavaIOFileInputStreamCheckTest : UtValueTestCaseChecker( | ||
testClass = JavaIOFileInputStreamCheck::class, | ||
testCodeGeneration = true, | ||
pipelines = listOf( | ||
TestLastStage(CodegenLanguage.JAVA), | ||
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) // because of mocks | ||
)) { | ||
@Test | ||
fun testRead() { | ||
checkMocksAndInstrumentation( | ||
JavaIOFileInputStreamCheck::read, | ||
eq(1), | ||
{ _, _, instrumentation, r -> | ||
val constructorMock = instrumentation.single() as UtNewInstanceInstrumentation | ||
|
||
val classIdEquality = constructorMock.classId == java.io.FileInputStream::class.id | ||
val callSiteIdEquality = constructorMock.callSites.single() == JavaIOFileInputStreamCheck::class.id | ||
val instance = constructorMock.instances.single() as UtCompositeModel | ||
val methodMock = instance.mocks.entries.single() | ||
val methodNameEquality = methodMock.key.name == "read" | ||
val mockValueResult = r == (methodMock.value.single() as UtPrimitiveModel).value as Int | ||
|
||
classIdEquality && callSiteIdEquality && instance.isMock && methodNameEquality && mockValueResult | ||
}, | ||
additionalMockAlwaysClasses = setOf(java.io.FileInputStream::class.id), | ||
coverage = DoNotCalculate // there is a problem with coverage calculation of mocked values | ||
) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
utbot-sample/src/main/java/org/utbot/examples/stdlib/JavaIOFileInputStreamCheck.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.utbot.examples.stdlib; | ||
|
||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
|
||
public class JavaIOFileInputStreamCheck { | ||
public int read(String s) throws IOException { | ||
java.io.FileInputStream fis = new java.io.FileInputStream(s); | ||
byte[] b = new byte[1000]; | ||
return fis.read(b); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.