Better error detection in some java testcases
This commit is contained in:
parent
736c6b953e
commit
09cfc53bdf
6 changed files with 31 additions and 40 deletions
|
|
@ -18,47 +18,47 @@ public class primitive_ref_runme {
|
|||
public static void main(String argv[]) {
|
||||
|
||||
if (primitive_ref.ref_int(3) != 3) {
|
||||
System.err.println( "ref_int failed!" );
|
||||
throw new RuntimeException( "ref_int failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_uint(3) != 3) {
|
||||
System.err.println( "ref_uint failed!" );
|
||||
throw new RuntimeException( "ref_uint failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_short((short)3) != 3) {
|
||||
System.err.println( "ref_short failed!" );
|
||||
throw new RuntimeException( "ref_short failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_ushort(3) != 3) {
|
||||
System.err.println( "ref_ushort failed!" );
|
||||
throw new RuntimeException( "ref_ushort failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_long(3) != 3) {
|
||||
System.err.println( "ref_long failed!" );
|
||||
throw new RuntimeException( "ref_long failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_ulong(3) != 3) {
|
||||
System.err.println( "ref_ulong failed!" );
|
||||
throw new RuntimeException( "ref_ulong failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_schar((byte)3) != 3) {
|
||||
System.err.println( "ref_schar failed!" );
|
||||
throw new RuntimeException( "ref_schar failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_uchar((short)3) != 3) {
|
||||
System.err.println( "ref_uchar failed!" );
|
||||
throw new RuntimeException( "ref_uchar failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_bool(true) != true) {
|
||||
System.err.println( "ref_bool failed!" );
|
||||
throw new RuntimeException( "ref_bool failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_float((float)3.5) != 3.5) {
|
||||
System.err.println( "ref_float failed!" );
|
||||
throw new RuntimeException( "ref_float failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_double(3.5) != 3.5) {
|
||||
System.err.println( "ref_double failed!" );
|
||||
throw new RuntimeException( "ref_double failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_char('x') != 'x') {
|
||||
System.err.println( "ref_char failed!" );
|
||||
throw new RuntimeException( "ref_char failed!" );
|
||||
}
|
||||
if (primitive_ref.ref_longlong(0x123456789ABCDEF0L) != 0x123456789ABCDEF0L) {
|
||||
System.err.println( "ref_longlong failed!" );
|
||||
throw new RuntimeException( "ref_longlong failed!" );
|
||||
}
|
||||
BigInteger bi = new BigInteger("18446744073709551615"); //0xFFFFFFFFFFFFFFFFL
|
||||
if (bi.compareTo(primitive_ref.ref_ulonglong(bi)) != 0) {
|
||||
System.err.println( "ref_ulonglong failed!" );
|
||||
throw new RuntimeException( "ref_ulonglong failed!" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue