-
Notifications
You must be signed in to change notification settings - Fork 46
Setting maxTestsPerMethod
is ignored
#1297
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
Comments
Vassiliy-Kudryashov
added a commit
that referenced
this issue
Nov 3, 2022
3 tasks
3 tasks
Vassiliy-Kudryashov
added a commit
that referenced
this issue
Nov 7, 2022
Repository owner
moved this from In Progress
to Done
in UTBot Java
Nov 7, 2022
@Vassiliy-Kudryashov Steps to reproduce
public class CheckStatic {
public int connect(Socket socket) throws IOException {
socket.connect(new InetSocketAddress("0.0.0.0", 22));
return 0;
} Actual result The following tests were generated: ///region Test suites for executable CheckStatic.connect
///region FUZZER: SECURITY for method connect(java.net.Socket)
/**
* @utbot.classUnderTest {@link .CheckStatic}
* @utbot.methodUnderTest {@link .CheckStatic#connect(Socket)}
*/
@Test
@DisplayName("connect: socket = Socket(String, int, boolean)")
@Disabled(value = "Disabled due to sandbox")
public void testConnect() throws IOException {
CheckStatic checkStatic = new CheckStatic();
Socket socket = new Socket("jkmqh", 568849899, true);
/* This test fails because method [CheckStatic.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "jkmqh" "resolve")] */
}
/**
* @utbot.classUnderTest {@link .CheckStatic}
* @utbot.methodUnderTest {@link .CheckStatic#connect(Socket)}
*/
@Test
@DisplayName("connect: socket = Socket(String, int)")
@Disabled(value = "Disabled due to sandbox")
public void testConnect1() throws IOException {
CheckStatic checkStatic = new CheckStatic();
Socket socket = new Socket("hlcoj", 1525745488);
/* This test fails because method [CheckStatic.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "hlcoj" "resolve")] */
}
/**
* @utbot.classUnderTest {@link .CheckStatic}
* @utbot.methodUnderTest {@link .CheckStatic#connect(Socket)}
*/
@Test
@DisplayName("connect: socket = Socket(String, int, boolean)")
@Disabled(value = "Disabled due to sandbox")
public void testConnect2() throws IOException {
CheckStatic checkStatic = new CheckStatic();
Socket socket = new Socket("", 22, true);
/* This test fails because method [CheckStatic.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:22" "connect,resolve")] */
}
/**
* @utbot.classUnderTest {@link .CheckStatic}
* @utbot.methodUnderTest {@link .CheckStatic#connect(Socket)}
*/
@Test
@DisplayName("connect: socket = Socket(String, int, boolean)")
@Disabled(value = "Disabled due to sandbox")
public void testConnect3() throws IOException {
CheckStatic checkStatic = new CheckStatic();
Socket socket = new Socket("jkmqh", 22, false);
/* This test fails because method [CheckStatic.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "jkmqh" "resolve")] */
}
/**
* @utbot.classUnderTest {@link .CheckStatic}
* @utbot.methodUnderTest {@link .CheckStatic#connect(Socket)}
*/
@Test
@DisplayName("connect: socket = Socket(String, int, boolean)")
@Disabled(value = "Disabled due to sandbox")
public void testConnect4() throws IOException {
CheckStatic checkStatic = new CheckStatic();
Socket socket = new Socket("", 0, true);
/* This test fails because method [CheckStatic.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:0" "connect,resolve")] */
}
/**
* @utbot.classUnderTest {@link .CheckStatic}
* @utbot.methodUnderTest {@link .CheckStatic#connect(Socket)}
*/
@Test
@DisplayName("connect: socket = Socket(String, int)")
@Disabled(value = "Disabled due to sandbox")
public void testConnect5() throws IOException {
CheckStatic checkStatic = new CheckStatic();
Socket socket = new Socket("0.0.0.0", 22);
/* This test fails because method [CheckStatic.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "0.0.0.0:22" "connect,resolve")] */
}
/**
* @utbot.classUnderTest {@link .CheckStatic}
* @utbot.methodUnderTest {@link .CheckStatic#connect(Socket)}
*/
@Test
@DisplayName("connect: socket = Socket(String, int)")
@Disabled(value = "Disabled due to sandbox")
public void testConnect6() throws IOException {
CheckStatic checkStatic = new CheckStatic();
Socket socket = new Socket("noimn", 427785292);
/* This test fails because method [CheckStatic.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "noimn" "resolve")] */
}
/**
* @utbot.classUnderTest {@link .CheckStatic}
* @utbot.methodUnderTest {@link .CheckStatic#connect(Socket)}
*/
@Test
@DisplayName("connect: socket = Socket(String, int)")
@Disabled(value = "Disabled due to sandbox")
public void testConnect7() throws IOException {
CheckStatic checkStatic = new CheckStatic();
Socket socket = new Socket("", 0);
/* This test fails because method [CheckStatic.connect] produces [java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:0" "connect,resolve")] */
}
///endregion
///region Errors report for connect
public void testConnect_errors() {
// Couldn't generate some tests. List of errors:
//
// 70 occurrences of:
// Default concrete execution failed
}
///endregion
///endregion |
Repository owner
moved this from Done
to In Progress
in UTBot Java
Nov 9, 2022
One more scenario:
Actual result There are 4 tests generated in region |
maxTestsPerMethod=1
is exceededmaxTestsPerMethod
is ignored
The key was renamed to maxTestsPerMethodInRegion within 32deee9 |
Repository owner
moved this from In Progress
to Done
in UTBot Java
Nov 11, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
With new functionality:
When
maxTestsPerMethod=1
is set test generation for ExceptionExamples is made with default settings.There are 2 tests generated in a region, 3 tests generated per method.
To Reproduce
~/.utbot/settings.properties
: setmaxTestsPerMethod=1
ExceptionExamples#initAnArray(int)
Expected behavior
There should be only 1 test per method generated.
Actual behavior
There are up to 3 tests per method generated, including 2 in the same region.
Visual proofs (screenshots, logs, images)
Environment
Windows 10 Pro
IntelliJ IDEA 2022.2.3
Related to #1235
The text was updated successfully, but these errors were encountered: