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 { try {
InputStream inStream = getClass().getResourceAsStream("/book.bin"); InputStream inStream = getClass().getResourceAsStream("/book.bin");
if (inStream == null) if (inStream == null)
throw new IOException("Can't read internal opening book"); throw new IOException();
List<Byte> buf = new ArrayList<Byte>(8192); List<Byte> buf = new ArrayList<Byte>(8192);
byte[] tmpBuf = new byte[1024]; byte[] tmpBuf = new byte[1024];
while (true) { while (true) {

View File

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