Package etch.util.core.nio

Examples of etch.util.core.nio.History.alloc()


    // newAlloc > limit
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    h.alloc( 9 );
    checkUsedAlloc( h, 0, 10 );
    // try to overflow
    h.alloc( 1 );
  }
 
View Full Code Here


    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    h.alloc( 9 );
    checkUsedAlloc( h, 0, 10 );
    // try to overflow
    h.alloc( 1 );
  }
 
  /** @throws Exception */
  @Test( expected = IllegalStateException.class )
  public void alloc6() throws Exception
View Full Code Here

  {
    // newAlloc < 0
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    // try to underflow
    h.alloc( -1 );
  }
 
  /** @throws Exception */
  @Test( expected = IllegalStateException.class )
  public void alloc7() throws Exception
View Full Code Here

  public void alloc7() throws Exception
  {
    // newAlloc < 0
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    // try to underflow
    h.alloc( -2 );
  }
 
View Full Code Here

    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    // try to underflow
    h.alloc( -2 );
  }
 
  /** @throws Exception */
  @Test
  public void alloc8() throws Exception
View Full Code Here

  @Test
  public void alloc8() throws Exception
  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    try
    {
      // try to underflow
      h.alloc( -2 );
View Full Code Here

    h.alloc( 1 );
    checkUsedAlloc( h, 0, 1 );
    try
    {
      // try to underflow
      h.alloc( -2 );
      fail( "never reached" );
    }
    catch ( IllegalStateException e )
    {
      // make sure alloc was not adjusted...
View Full Code Here

  @Test( expected = IllegalArgumentException.class )
  public void alloc9() throws Exception
  {
    // k == 0
    History h = new History( 0, 10, 5 );
    h.alloc( 0 );
  }
 
  /** @throws Exception */
  @Test
  public void suggested1() throws Exception
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.