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 {
|
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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user