package simpledb.test;

import simpledb.*;
import java.util.*;
import java.io.*;

public class HashScanTest extends Test {

    public boolean runTest(String args[]) {
	TransactionId tid = new TransactionId();
	IndexPredicate ipred = new IndexPredicate(Predicate.Op.getOp(0),
						  new IntField(new Integer(args[2])));
	HashScan hs = new HashScan(tid, 
				   hashfile[Integer.parseInt(args[1])-1][0].id(), 
				   ipred);
	dump(new Query(hs, tid));

	// XXX hack for testing purposes
	try {
	    Database.getBufferPool().flushAllPages();
	} catch (Exception e) {
	    e.printStackTrace();
	}

	return true;
    }
}
