Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4da0878
merge
DaniilStepanov Nov 9, 2022
9fa553a
mocks generation
DaniilStepanov Nov 15, 2022
390d805
remove shrinker
Saloed Nov 10, 2022
d823f29
Rename .java to .kt
Saloed Nov 10, 2022
1343666
rewrite quickcheck on Kotlin
Saloed Nov 10, 2022
854c790
Rename .java to .kt
DaniilStepanov Nov 15, 2022
4d374c7
this instance rewriting
DaniilStepanov Nov 15, 2022
3157025
Added mutations
DaniilStepanov Nov 22, 2022
14604b4
minor
DaniilStepanov Nov 22, 2022
c5f5ae2
New seed selection strategy and time budget for generation
DaniilStepanov Nov 29, 2022
1dbcde7
refactoring and fixes
DaniilStepanov Dec 1, 2022
3452621
m
DaniilStepanov Dec 1, 2022
8240554
UnsafeBasedInstanceGenerator done
DaniilStepanov Dec 6, 2022
ad5af5d
Mutator refactorings
DaniilStepanov Dec 6, 2022
9e0ac70
minor
DaniilStepanov Dec 6, 2022
09343b0
Contest mode is done
DaniilStepanov Dec 19, 2022
3a86fd6
merge
DaniilStepanov Dec 19, 2022
1de5db5
constants collector
DaniilStepanov Dec 19, 2022
5fb1090
removed unnecessary files
DaniilStepanov Dec 19, 2022
1cc03c3
bug fixes
DaniilStepanov Dec 20, 2022
7eab043
removing fuzzer executor
DaniilStepanov Dec 20, 2022
3018dd7
Global refactorings
DaniilStepanov Dec 28, 2022
2bc68a0
minor
DaniilStepanov Dec 28, 2022
bbb34cd
minor fixes
DaniilStepanov Dec 28, 2022
4f77b79
minor
DaniilStepanov Dec 28, 2022
dd16ada
Fixed nested classes generation
DaniilStepanov Jan 13, 2023
ddaf943
fixes to contest
DaniilStepanov Jan 18, 2023
554a9c9
Mock renderer added
DaniilStepanov Jan 19, 2023
04fe674
fixes
DaniilStepanov Jan 24, 2023
7392e6d
rebase
DaniilStepanov Jan 24, 2023
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
Prev Previous commit
Next Next commit
constants collector
  • Loading branch information
DaniilStepanov committed Jan 24, 2023
commit 1de5db528ee07e5f92a25e931715a614f39a4afb
67 changes: 67 additions & 0 deletions utbot-framework/src/main/java/org/utbot/examples/A.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package org.utbot.examples;

import java.lang.reflect.Field;

class A<R extends Number> {

public C<R> c = new C<R>();

public int getCLol3() {
return c.h.lol3();
}
// public A(int a, R at) {
// this.a = a;
// this.at = at;
// }

// public class Lil {
// int a = 1;
//
// Lil(int a) {
// this.a = a;
// }
// }

// int a = 1;
// int c;
// R at;
// final int b = 1;

// public static A<Number> produceA(int a, Number b) {
// return new A<Number>(777, b);
// }
//public static A<Number> aInstance = new A<Number>(777, 13.0);

// public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
// Field f = A.class.getField("aInstance");
// System.out.println(f.get(null));
// }

//public int lol(R a, ArrayList<R> arr);
// public static <R extends Number> A<R> getInstance1(R a, ArrayList<R> arr) {
// return new B<R>(a, 777, arr);
// }


// public static final A<Number> numberA = new A<Number>(1, 3L, null);
// public static final A<Integer> intA = new A<Integer>(1, 2, null);
// public static final A<String> strA = new A<String>(1, "a", null);
//
// public static A<Object> getInstance() {
// return new A<Object>(1, null, null);
// }

//public static A<Integer> getIntegerInstance() {
// return new A<Integer>(1, 3);
// }
// public static A<Integer> getIntegerInstance(Integer a, B<Integer> bInstance) {
// return new A<Integer>(a, 3, bInstance);
// }

// private A() {}
// public A(int a, R ba, R e, B<R> bInstance) {
// this.e = e;
// this.a = a;
// this.bInstance = bInstance;
// }
}
30 changes: 30 additions & 0 deletions utbot-framework/src/main/java/org/utbot/examples/B.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.utbot.examples;

public class B<R> {

R[] arr;
// int a;
// String b;
//
// public B(int a, String b) {
// this.a = a;
// this.b = b;
// }
}
//public class B<T extends Number> implements A<T> {
//
// public T a;
// public int b;
// public ArrayList<T> c;
//
// public B(T a, int b, ArrayList<T> c) {
// this.a = a;
// this.b = b;
// this.c = c;
// }
//
// @Override
// public int lol(T a, ArrayList<T> arr) {
// return 0;
// }
//}
203 changes: 203 additions & 0 deletions utbot-framework/src/main/java/org/utbot/examples/ByteVector.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
package org.utbot.examples;

/**
* A dynamically extensible vector of bytes. This class is roughly equivalent to
* a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient.
*
* @author Eric Bruneton
*/
public class ByteVector {

/**
* The content of this vector.
*/
public byte[] data;

/**
* Actual number of bytes in this vector.
*/
public int length;

/**
* Constructs a new {@link ByteVector ByteVector} with a default initial size.
*/
public ByteVector() {
data = new byte[64];
}

/**
* Constructs a new {@link ByteVector ByteVector} with the given initial size.
*
* @param initialSize the initial size of the byte vector to be constructed.
*/
public ByteVector(final int initialSize) {
data = new byte[initialSize];
}

/**
* Puts a byte into this byte vector. The byte vector is automatically enlarged
* if necessary.
*
* @param b a byte.
* @return this byte vector.
*/
public ByteVector putByte(final int b) {
int length = this.length;
if (length + 1 > data.length) {
enlarge(1);
}
data[length++] = (byte) b;
this.length = length;
return this;
}

/**
* Puts two bytes into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
* @param b1 a byte.
* @param b2 another byte.
* @return this byte vector.
*/
ByteVector put11(final int b1, final int b2) {
int length = this.length;
if (length + 2 > data.length) {
enlarge(2);
}
final byte[] data = this.data;
data[length++] = (byte) b1;
data[length++] = (byte) b2;
this.length = length;
return this;
}

/**
* Puts a short into this byte vector. The byte vector is automatically enlarged
* if necessary.
*
* @param s a short.
* @return this byte vector.
*/
public ByteVector putShort(final int s) {
int length = this.length;
if (length + 2 > data.length) {
enlarge(2);
}
final byte[] data = this.data;
data[length++] = (byte) (s >>> 8);
data[length++] = (byte) s;
this.length = length;
return this;
}

/**
* Puts a byte and a short into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
* @param b a byte.
* @param s a short.
* @return this byte vector.
*/
public ByteVector put12(final int b, final int s) {
int length = this.length;
if (length + 3 > data.length) {
enlarge(3);
}
final byte[] data = this.data;
data[length++] = (byte) b;
data[length++] = (byte) (s >>> 8);
data[length++] = (byte) s;
this.length = length;
return this;
}

/**
* Puts an int into this byte vector. The byte vector is automatically enlarged
* if necessary.
*
* @param i an int.
* @return this byte vector.
*/
public ByteVector putInt(final int i) {
int length = this.length;
if (length + 4 > data.length) {
enlarge(4);
}
final byte[] data = this.data;
data[length++] = (byte) (i >>> 24);
data[length++] = (byte) (i >>> 16);
data[length++] = (byte) (i >>> 8);
data[length++] = (byte) i;
this.length = length;
return this;
}

/**
* Puts an UTF8 string into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
* @param s a String.
* @return this byte vector.
*/
public ByteVector putUTF8(final String s) {
final int charLength = s.length();
int len = length;
if (len + 2 + charLength > data.length) {
enlarge(2 + charLength);
}
final byte[] data = this.data;
// optimistic algorithm: instead of computing the byte length and then
// serializing the string (which requires two loops), we assume the byte
// length is equal to char length (which is the most frequent case), and
// we start serializing the string right away. During the serialization,
// if we find that this assumption is wrong, we continue with the
// general method.
data[len++] = (byte) (charLength >>> 8);
data[len++] = (byte) charLength;
for (int i = 0; i < charLength; ++i) {
final char c = s.charAt(i);
if ((c >= '\001' && c <= '\177') || (c >= '\u4E00' && c <= '\u9FFF')) {
data[len++] = (byte) c;
} else {
throw new UnsupportedOperationException();
}
}
length = len;
return this;
}

/**
* Puts an array of bytes into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
* @param b an array of bytes. May be <tt>null</tt> to put <tt>len</tt> null
* bytes into this byte vector.
* @param off index of the fist byte of b that must be copied.
* @param len number of bytes of b that must be copied.
* @return this byte vector.
*/
public ByteVector putByteArray(final byte[] b, final int off, final int len) {
if (length + len > data.length) {
enlarge(len);
}
if (b != null) {
System.arraycopy(b, off, data, length, len);
}
length += len;
return this;
}

/**
* Enlarge this byte vector so that it can receive n more bytes.
*
* @param size number of additional bytes that this byte vector should be able
* to receive.
*/
private void enlarge(final int size) {
final int length1 = 2 * data.length;
final int length2 = length + size;
final byte[] newData = new byte[length1 > length2 ? length1 : length2];
System.arraycopy(data, 0, newData, 0, length);
data = newData;
}
}
7 changes: 7 additions & 0 deletions utbot-framework/src/main/java/org/utbot/examples/C.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.utbot.examples;

public class C<T> {

H<T> h = new H<T>();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.utbot.examples;

import java.util.GregorianCalendar;

import static java.util.Calendar.*;

/* Application logic */
public class CalendarLogic {
// Returns true iff cal is in a leap year
public static boolean isLeapYear(GregorianCalendar cal) {
int year = cal.get(YEAR);
if (year % 4 == 0) {
return year % 100 != 0;
}
return false;
}

// Returns either of -1, 0, 1 depending on whether c1 is <, =, > than c2
public static int compare(GregorianCalendar c1, GregorianCalendar c2) {
int cmp;
cmp = Integer.compare(c1.get(YEAR), c2.get(YEAR));
if (cmp == 0) {
cmp = Integer.compare(c1.get(MONTH), c2.get(MONTH));
if (cmp == 0) {
cmp = Integer.compare(c1.get(DAY_OF_MONTH), c2.get(DAY_OF_MONTH));
if (cmp == 0) {
cmp = Integer.compare(c1.get(HOUR), c2.get(HOUR));
if (cmp == 0) {
cmp = Integer.compare(c1.get(MINUTE), c2.get(MINUTE));
if (cmp == 0) {
cmp = Integer.compare(c1.get(SECOND), c2.get(SECOND));
if (cmp == 0) {
cmp = Integer.compare(c1.get(MILLISECOND), c2.get(MILLISECOND));
}
}
}
}
}
}
return cmp;
}
}
4 changes: 4 additions & 0 deletions utbot-framework/src/main/java/org/utbot/examples/D.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.utbot.examples;

public interface D {
}
5 changes: 5 additions & 0 deletions utbot-framework/src/main/java/org/utbot/examples/GrAlh.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.utbot.examples;

public class GrAlh {
int a = 1;
}
Loading