Skip to content

Commit

Permalink
Fix parsing of OT property in SGF files that erroneously interpreted …
Browse files Browse the repository at this point in the history
…Japanese

byoyomi as Canadian overtime (which is currently the only time system supported
by GTP and GoGui)
  • Loading branch information
enz committed Feb 7, 2010
1 parent 4de6af0 commit e49ef0a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 226 deletions.
7 changes: 7 additions & 0 deletions doc/manual/xml/news.xml
Expand Up @@ -39,6 +39,13 @@ Write game number to standard error at beginning of a game, if option
New menu item Find Next Comment
</simpara>
</listitem>
<listitem>
<simpara>
Fix parsing of OT property in SGF files that erroneously interpreted Japanese
byoyomi as Canadian overtime (which is currently the only time system supported
by GTP and GoGui)
</simpara>
</listitem>
</itemizedlist>
</revdescription>
</revision>
Expand Down
19 changes: 0 additions & 19 deletions src/net/sf/gogui/sgf/SgfUtil.java
Expand Up @@ -62,31 +62,12 @@ public static Overtime parseOvertime(String value)
if (result != null)
return result;

/* Used by Kiseido Game Server, CGoban 2 */
result =
parseOvertime(value, "(\\d+)x(\\d+)\\s*byo-yomi", true, 1000L);
if (result != null)
return result;

/* Used by ? */
result =
parseOvertime(value, "(\\d+)x(\\d+)", true, 1000L);
if (result != null)
return result;

/* Used by Quarry, CGoban 2 */
result =
parseOvertime(value, "(\\d+)/(\\d+)\\s*canadian", true, 1000L);
if (result != null)
return result;

/* "60 sec/move byo-yomi" (found in a game from
http://homepages.cwi.nl/~aeb/go/games/index.html) */
result =
parseOvertime(value, "(\\d+)\\s*sec/move byo-yomi", 1000L);
if (result != null)
return result;

return result;
}

Expand Down
2 changes: 0 additions & 2 deletions test/junit/src/net/sf/gogui/sgf/SgfReaderTest.java
Expand Up @@ -103,8 +103,6 @@ public void testLinebreaks() throws Exception
public void testRead() throws Exception
{
readSgfFile("verbose-property-names.sgf", false, false);
checkTimeSettings("time-settings-1.sgf", 1800000, 60000, 5);
checkTimeSettings("time-settings-kgs.sgf", 1800000, 30000, 5);
}

/** Test that spaces in size property value are ignored.
Expand Down
13 changes: 0 additions & 13 deletions test/junit/src/net/sf/gogui/sgf/SgfUtilTest.java
Expand Up @@ -24,17 +24,4 @@ public void testParseTime() throws Exception
assertEquals(10L * 3600L * 1000L, SgfUtil.parseTime("10 hrs each"));
assertEquals(70L * 60L * 1000L, SgfUtil.parseTime("70m"));
}

public void testParseOvertime() throws Exception
{
checkParseOverTime("60 sec/move byo-yomi", 60000L, 1);
}

private void checkParseOverTime(String value, long byoyomi,
int byoyomiMoves)
{
SgfUtil.Overtime overtime = SgfUtil.parseOvertime(value);
assertEquals(byoyomi, overtime.m_byoyomi);
assertEquals(byoyomiMoves, overtime.m_byoyomiMoves);
}
}
188 changes: 0 additions & 188 deletions test/junit/src/net/sf/gogui/sgf/time-settings-1.sgf

This file was deleted.

4 changes: 0 additions & 4 deletions test/junit/src/net/sf/gogui/sgf/time-settings-kgs.sgf

This file was deleted.

0 comments on commit e49ef0a

Please sign in to comment.