public void testGetKingSq() throws ChessParseError {
  Position pos=TextIO.readFEN(TextIO.startPosFEN);
  assertEquals(TextIO.getSquare("e1"),pos.getKingSq(true));
  assertEquals(TextIO.getSquare("e8"),pos.getKingSq(false));
  pos=TextIO.readFEN("r1bq1bnr/ppppkppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R w KQ - 0 4");
  assertEquals(TextIO.getSquare("e1"),pos.getKingSq(true));
  assertEquals(TextIO.getSquare("e7"),pos.getKingSq(false));
  UndoInfo ui=new UndoInfo();
  pos.makeMove(TextIO.stringToMove(pos,"o-o"),ui);
  assertEquals(TextIO.getSquare("g1"),pos.getKingSq(true));
  assertEquals(TextIO.getSquare("e7"),pos.getKingSq(false));
  pos.makeMove(TextIO.stringToMove(pos,"Kd6"),ui);
  assertEquals(TextIO.getSquare("g1"),pos.getKingSq(true));
  assertEquals(TextIO.getSquare("d6"),pos.getKingSq(false));
}

public void testGetKingSq ( ) throws ChessParseError { Position pos = TextIO . readFEN ( TextIO . startPosFEN ) ; assertEquals ( TextIO . getSquare ( "e1" ) , pos . getKingSq ( true ) ) ; assertEquals ( TextIO . getSquare ( "e8" ) , pos . getKingSq ( false ) ) ; pos = TextIO . readFEN ( "r1bq1bnr/ppppkppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R w KQ - 0 4" ) ; assertEquals ( TextIO . getSquare ( "e1" ) , pos . getKingSq ( true ) ) ; assertEquals ( TextIO . getSquare ( "e7" ) , pos . getKingSq ( false ) ) ; UndoInfo ui = new UndoInfo ( ) ; pos . makeMove ( TextIO . stringToMove ( pos , "o-o" ) , ui ) ; assertEquals ( TextIO . getSquare ( "g1" ) , pos . getKingSq ( true ) ) ; assertEquals ( TextIO . getSquare ( "e7" ) , pos . getKingSq ( false ) ) ; pos . makeMove ( TextIO . stringToMove ( pos , "Kd6" ) , ui ) ; assertEquals ( TextIO . getSquare ( "g1" ) , pos . getKingSq ( true ) ) ; assertEquals ( TextIO . getSquare ( "d6" ) , pos . getKingSq ( false ) ) ; }
test of getkingsq method , of class position .
