예제 #1
0
 private void testSetShort(Buffer buff) throws Exception {
   for (int i = 0; i < numSets; i++) {
     buff.setShort(i * 2, (short) i);
   }
   for (int i = 0; i < numSets; i++) {
     assertEquals(i, buff.getShort(i * 2));
   }
 }
예제 #2
0
  @Test
  public void testGetShort() throws Exception {
    int numShorts = 100;
    Buffer b = new Buffer(numShorts * 2);
    for (short i = 0; i < numShorts; i++) {
      b.setShort(i * 2, i);
    }

    for (short i = 0; i < numShorts; i++) {
      assertEquals(i, b.getShort(i * 2));
    }
  }