Esempio n. 1
0
 @Test
 public void testPassFloats() {
   Pointer<Byte> out = allocateBytes(8);
   for (int value : intValues) {
     passVarArgs(out, false, (float) value);
     assertEquals(value, out.getDouble(), 0);
   }
 }
Esempio n. 2
0
 @Test
 public void testPassBools() {
   Pointer<Byte> out = allocateBytes(8);
   for (boolean value : new boolean[] {true, false}) {
     passVarArgs(out, true, value);
     assertEquals(value, out.getSizeT() != 0);
   }
 }
Esempio n. 3
0
 @Test
 public void testPassBytes() {
   Pointer<Byte> out = allocateBytes(8);
   for (int value : intValues) {
     passVarArgs(out, true, (byte) value);
     assertEquals(value, out.getSizeT());
   }
 }
Esempio n. 4
0
 @Test
 public void testSPrintf() {
   Pointer<Byte> dest = allocateBytes(100);
   String fmtString = "Hello %d !";
   int value = 10;
   sprintf(dest, pointerToCString(fmtString), value);
   assertEquals(String.format(fmtString, value), dest.getCString());
 }