trayTest

trayTest - System.out.println(" Row:...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import junit.framework.TestCase; public class trayTest extends TestCase{ public void testAdd(){ tray t=new tray(); t.add(new block( 16908288)); t.add(new block( 16908290)); t.add(new block( 16843008)); t.add(new block( 16843011)); t.add(new block( 33620225)); t.add(new block( 33620480)); tray b=new tray(t); block iter=b.getHead(); while(iter!=null){ iter=iter.getNext(); } } public void testEquals(){ tray t=new tray(); t.add(new block( 16908288)); t.add(new block( 16908290)); t.add(new block( 16843008)); t.add(new block( 16843011)); t.add(new block( 33620225)); t.add(new block( 33620480)); tray b=new tray(t); assertTrue(b.equals(t)); } public void testUpdate(){ tray t=new tray(); t.add(new block(16908288)); t.add(new block(16908290)); t.add(new block(16908291));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println(" Row: "+t.getHead().getRow()+" col: "+t.getHead().getCol() ); System.out.println(" Row: "+t.getHead().getNext().getRow()+" col: "+t.getHead().getNext().getCol() ); System.out.println(" Row: "+t.getHead().getNext().getNext().getRow() +" col: "+t.getHead().getNext().getNext().getCol() ); t.update(0, 0, 1, 1); t.update(0, 2, 0, 4); t.update(0, 3, 1, 0); System.out.println(" Row: "+t.getHead().getRow()+" col: "+t.getHead().getCol() ); System.out.println(" Row: "+t.getHead().getNext().getRow()+" col: "+t.getHead().getNext().getCol() ); System.out.println(" Row: "+t.getHead().getNext().getNext().getRow() +" col: "+t.getHead().getNext().getNext().getCol() ); } }...
View Full Document

This note was uploaded on 10/12/2011 for the course CS 61bl taught by Professor Courney during the Spring '11 term at Berkeley.

Ask a homework question - tutors are online