summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-04-18 17:16:47 +0800
committerPeng Wu <alexepico@gmail.com>2011-04-18 17:16:47 +0800
commit0eef018fd451b66288684fdeb8d26e59117a4ebb (patch)
treeb89c9acfb9210a8e14a49873e5e2d8bc50b62d38 /tests
parentc418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5 (diff)
downloadlibpinyin-0eef018fd451b66288684fdeb8d26e59117a4ebb.tar.gz
libpinyin-0eef018fd451b66288684fdeb8d26e59117a4ebb.tar.xz
libpinyin-0eef018fd451b66288684fdeb8d26e59117a4ebb.zip
fixes test phrase table.
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_phrase_table.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/storage/test_phrase_table.cpp b/tests/storage/test_phrase_table.cpp
index e5fb24d..66ed060 100644
--- a/tests/storage/test_phrase_table.cpp
+++ b/tests/storage/test_phrase_table.cpp
@@ -65,8 +65,11 @@ int main(int argc, char * argv[]){
}
print_time(start, bench_times);
- largetable.search(phrase_len, new_phrase, token);
- printf("%s:\t%d\n", linebuf, token);
+ int retval = largetable.search(phrase_len, new_phrase, token);
+ if ( retval & SEARCH_OK )
+ printf("%s:\t%d\n", linebuf, token);
+ else
+ printf("phrase %s not found.\n", linebuf);
g_free(new_phrase);
}