mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 06:10:28 +01:00
DroidFishTest: Fixed an opening book test.
This commit is contained in:
parent
e0f8aef6d6
commit
e03550027d
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user