forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding unit tests for extracting generic bases' info
- Loading branch information
1 parent
54df3a1
commit 50dcec8
Showing
30 changed files
with
755 additions
and
24 deletions.
There are no files selected for viewing
Binary file added
BIN
+501 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ContainsInnerClass$InnerClass.class
Binary file not shown.
Binary file added
BIN
+617 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ContainsInnerClass$InnerClassGeneric.class
Binary file not shown.
Binary file added
BIN
+608 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ContainsInnerClass.class
Binary file not shown.
Binary file added
BIN
+609 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ContainsInnerClassGeneric$InnerClass.class
Binary file not shown.
Binary file added
BIN
+625 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ContainsInnerClassGeneric.class
Binary file not shown.
Binary file modified
BIN
-3 Bytes
(99%)
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericInst.class
Binary file not shown.
4 changes: 0 additions & 4 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericInst.java
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+364 Bytes
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericInst2.class
Binary file not shown.
Binary file added
BIN
+480 Bytes
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericMixed1.class
Binary file not shown.
Binary file added
BIN
+492 Bytes
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericMixed2.class
Binary file not shown.
Binary file modified
BIN
+49 Bytes
(110%)
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericUninst.class
Binary file not shown.
4 changes: 0 additions & 4 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericUninst.java
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+1.27 KB
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenerics.class
Binary file not shown.
171 changes: 171 additions & 0 deletions
171
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenerics.java
This file contains 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,171 @@ | ||
public class DerivedGenerics { | ||
DerivedGenericInst new1; | ||
DerivedGenericInst2 new2; | ||
DerivedGenericUninst<Integer> new3; | ||
DerivedGenericMixed1<String> new4; | ||
DerivedGenericMixed2<String> new5; | ||
ContainsInnerClass new6; | ||
ContainsInnerClassGeneric<String> new7; | ||
ThreeHierarchy new8; | ||
ImplementsInterfaceGenericSpecialised new9; | ||
ImplementsInterfaceGenericUnspec<String> new10; | ||
ImplementsMultipleInterfaces new11; | ||
ExtendsAndImplements new12; | ||
ExtendsAndImplementsGeneric new13; | ||
ExtendsAndImplementsSameInterface new14; | ||
ExtendsAndImplementsSameInterface2 new15; | ||
ExtendsAndImplementsSameInterfaceGeneric new16; | ||
} | ||
|
||
class DerivedGenericInst extends Generic<Interface_Implementation> | ||
{ | ||
// This class is to test instantiating a non-generic subclass of a generic class | ||
// with the base class having only one type parameter. | ||
} | ||
|
||
class DerivedGenericInst2 extends | ||
GenericTwoParam<Interface_Implementation,Integer> | ||
{ | ||
// This class is to test instantiating a non-generic subclass of a generic class | ||
// with the base class having two type parameters. | ||
} | ||
|
||
class DerivedGenericUninst<T> extends Generic<T> | ||
{ | ||
T newField; | ||
|
||
// This class is to test instantiating a generic subclass of a generic class | ||
// with the base class having only one parameter, but the type parameter is | ||
// not specialised. | ||
} | ||
|
||
class DerivedGenericMixed1<T> extends Generic<Interface_Implementation> | ||
{ | ||
T newField; | ||
|
||
// This class is to test instantiating a generic subclass of a generic class | ||
// with the base class having only one type parameter. | ||
} | ||
|
||
class DerivedGenericMixed2<T> extends GenericTwoParam<T, Integer> | ||
{ | ||
T newField; | ||
|
||
// This class is to test instantiating a generic subclass of a generic class | ||
// with the base class having two type parameters, where one is specialised | ||
// and the other is not. | ||
} | ||
|
||
class ContainsInnerClass { | ||
|
||
InnerClass ic; | ||
InnerClassGeneric<String> icg; | ||
|
||
// This class is to test inner classes that extend generic types. | ||
class InnerClass extends Generic<Integer> { | ||
} | ||
|
||
class InnerClassGeneric<T> extends Generic<T> { | ||
} | ||
} | ||
|
||
class ContainsInnerClassGeneric<T> { | ||
|
||
InnerClass ic; | ||
|
||
// This class is to test inner classes that extend generic types when the | ||
// outer class in generic. | ||
class InnerClass extends Generic<T> { | ||
} | ||
} | ||
|
||
class ThreeHierarchy extends DerivedGenericMixed2<String> { | ||
|
||
// This class extends a specialised class that extends another generic | ||
// class. | ||
|
||
} | ||
|
||
class ImplementsInterfaceGenericSpecialised implements InterfaceGeneric<Integer> | ||
{ | ||
|
||
public Integer someMethod() { | ||
return 0; | ||
} | ||
|
||
} | ||
|
||
class ImplementsInterfaceGenericUnspec<E> implements InterfaceGeneric<E> { | ||
|
||
public E someMethod() { | ||
return null; | ||
} | ||
|
||
} | ||
|
||
class ImplementsMultipleInterfaces implements | ||
InterfaceGeneric<Integer>, Interface | ||
{ | ||
|
||
public Integer someMethod() { | ||
return 0; | ||
} | ||
|
||
public int getX() { | ||
return 0; | ||
} | ||
} | ||
|
||
class ExtendsAndImplements extends Generic<Integer> implements Interface, | ||
InterfaceGeneric<Integer> | ||
{ | ||
public Integer someMethod() { | ||
return 0; | ||
} | ||
|
||
public int getX() { | ||
return 0; | ||
} | ||
} | ||
|
||
class ExtendsAndImplementsGeneric<T> extends GenericTwoParam<T, Integer> | ||
implements Interface, | ||
InterfaceGeneric<T> | ||
{ | ||
T f; | ||
|
||
public T someMethod() { | ||
return f; | ||
} | ||
|
||
public int getX() { | ||
return 0; | ||
} | ||
} | ||
|
||
class ExtendsAndImplementsSameInterface extends Generic<InterfaceGeneric> | ||
implements InterfaceGeneric<Integer> | ||
{ | ||
public Integer someMethod() { | ||
return 0; | ||
} | ||
} | ||
|
||
class ExtendsAndImplementsSameInterface2 extends | ||
Generic<InterfaceGeneric<String>> | ||
implements InterfaceGeneric<Integer> | ||
{ | ||
public Integer someMethod() { | ||
return 0; | ||
} | ||
} | ||
|
||
class ExtendsAndImplementsSameInterfaceGeneric<T> extends | ||
Generic<InterfaceGeneric> implements InterfaceGeneric<T> | ||
{ | ||
T f; | ||
|
||
public T someMethod() { | ||
return f; | ||
} | ||
} |
Binary file added
BIN
+746 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ExtendsAndImplements.class
Binary file not shown.
Binary file added
BIN
+811 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ExtendsAndImplementsGeneric.class
Binary file not shown.
Binary file added
BIN
+672 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ExtendsAndImplementsSameInterface.class
Binary file not shown.
Binary file added
BIN
+694 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ExtendsAndImplementsSameInterface2.class
Binary file not shown.
Binary file added
BIN
+713 Bytes
...java_bytecode/java_bytecode_parse_generics/ExtendsAndImplementsSameInterfaceGeneric.class
Binary file not shown.
Binary file added
BIN
+678 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ImplementsInterfaceGenericSpecialised.class
Binary file not shown.
Binary file added
BIN
+627 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ImplementsInterfaceGenericUnspec.class
Binary file not shown.
Binary file added
BIN
+759 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ImplementsMultipleInterfaces.class
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+236 Bytes
unit/java_bytecode/java_bytecode_parse_generics/InterfaceGeneric.class
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/InterfaceGeneric.java
This file contains 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,4 @@ | ||
interface InterfaceGeneric<E> | ||
{ | ||
E someMethod(); | ||
} |
Binary file not shown.
Binary file added
BIN
+337 Bytes
unit/java_bytecode/java_bytecode_parse_generics/ThreeHierarchy.class
Binary file not shown.
Oops, something went wrong.