DroidFishTest: Fixed an opening book test.

This commit is contained in:
Peter Osterlund 2016-11-08 19:44:24 +01:00
parent e0f8aef6d6
commit e03550027d
2 changed files with 4 additions and 8 deletions

View File

@ -87,7 +87,7 @@ final class InternalBook implements IOpeningBook {
try {
InputStream inStream = getClass().getResourceAsStream("/book.bin");
if (inStream == null)
throw new IOException("Can't read internal opening book");
throw new IOException();
List<Byte> buf = new ArrayList<Byte>(8192);
byte[] tmpBuf = new byte[1024];
while (true) {

View File

@ -57,19 +57,15 @@ public class BookTest extends TestCase {
/**
* Test of getAllBookMoves method, of class Book.
*/
/*
public void testGetAllBookMoves() throws ChessParseError {
Position pos = TextIO.readFEN(TextIO.startPosFEN);
DroidBook book = DroidBook.getInstance();
String moveListString = book.getAllBookMoves(pos, false).first;
String[] strMoves = moveListString.split(":[0-9]* ");
assertTrue(strMoves.length > 1);
for (String strMove : strMoves) {
Move m = TextIO.stringToMove(pos, strMove);
ArrayList<Move> moves = book.getAllBookMoves(pos, false).second;
assertTrue(moves.size() > 1);
for (Move m : moves) {
checkValid(pos, m);
}
}
*/
/** Check that move is a legal move in position pos. */
private void checkValid(Position pos, Move move) {