mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-27 07:58:49 +01:00
test code tweaks
This commit is contained in:
parent
3707e7aaca
commit
4b5a06fe20
2 changed files with 7 additions and 2 deletions
|
@ -92,6 +92,7 @@ DEFINES += -DDISABLE_TILE_SEL
|
||||||
DEFINES += -DSET_GAMESEED
|
DEFINES += -DSET_GAMESEED
|
||||||
DEFINES += -DTEXT_MODEL
|
DEFINES += -DTEXT_MODEL
|
||||||
DEFINES += -DXWFEATURE_WALKDICT
|
DEFINES += -DXWFEATURE_WALKDICT
|
||||||
|
DEFINES += -DXWFEATURE_WALKDICT_FILTER
|
||||||
|
|
||||||
ifdef CURSES_CELL_HT
|
ifdef CURSES_CELL_HT
|
||||||
DEFINES += -DCURSES_CELL_HT=$(CURSES_CELL_HT)
|
DEFINES += -DCURSES_CELL_HT=$(CURSES_CELL_HT)
|
||||||
|
|
|
@ -917,7 +917,10 @@ testGetNthWord( const DictionaryCtxt* dict, char** words,
|
||||||
|
|
||||||
dict_initIter( &iter, dict, min, max );
|
dict_initIter( &iter, dict, min, max );
|
||||||
XP_U32 half = dict_countWords( &iter ) / 2;
|
XP_U32 half = dict_countWords( &iter ) / 2;
|
||||||
XP_U32 interval = half / 50;
|
XP_U32 interval = half / 100;
|
||||||
|
if ( interval == 0 ) {
|
||||||
|
++interval;
|
||||||
|
}
|
||||||
|
|
||||||
for ( ii = 0, jj = half; ii < half; ii += interval, jj += interval ) {
|
for ( ii = 0, jj = half; ii < half; ii += interval, jj += interval ) {
|
||||||
if ( dict_getNthWord( &iter, ii, depth, data ) ) {
|
if ( dict_getNthWord( &iter, ii, depth, data ) ) {
|
||||||
|
@ -965,7 +968,7 @@ walk_dict_test( const LaunchParams* params, const DictionaryCtxt* dict,
|
||||||
|
|
||||||
for ( jj = 0, gotOne = dict_firstWord( &iter );
|
for ( jj = 0, gotOne = dict_firstWord( &iter );
|
||||||
gotOne;
|
gotOne;
|
||||||
++jj, gotOne = dict_getNextWord( &iter ) ) {
|
gotOne = dict_getNextWord( &iter ) ) {
|
||||||
XP_ASSERT( dict_getPosition( &iter ) == jj );
|
XP_ASSERT( dict_getPosition( &iter ) == jj );
|
||||||
XP_UCHAR buf[64];
|
XP_UCHAR buf[64];
|
||||||
dict_wordToString( &iter, buf, VSIZE(buf) );
|
dict_wordToString( &iter, buf, VSIZE(buf) );
|
||||||
|
@ -975,6 +978,7 @@ walk_dict_test( const LaunchParams* params, const DictionaryCtxt* dict,
|
||||||
if ( !!words ) {
|
if ( !!words ) {
|
||||||
words[jj] = g_strdup( buf );
|
words[jj] = g_strdup( buf );
|
||||||
}
|
}
|
||||||
|
++jj;
|
||||||
}
|
}
|
||||||
XP_ASSERT( count == jj );
|
XP_ASSERT( count == jj );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue