diff options
Diffstat (limited to 'tests/lookup/test_pinyin_lookup.cpp')
-rw-r--r-- | tests/lookup/test_pinyin_lookup.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/lookup/test_pinyin_lookup.cpp b/tests/lookup/test_pinyin_lookup.cpp index c232134..4bb07ef 100644 --- a/tests/lookup/test_pinyin_lookup.cpp +++ b/tests/lookup/test_pinyin_lookup.cpp @@ -19,9 +19,16 @@ int main( int argc, char * argv[]){ const char * bin_file = pinyin_phrase_files[i]; if (NULL == bin_file) continue; - gchar * filename = g_build_filename("..", "..", "data", bin_file, NULL); + + gchar * filename = g_build_filename("..", "..", "data", + bin_file, NULL); chunk = new MemoryChunk; - chunk->load(filename); + bool retval = chunk->load(filename); + if (!retval) { + fprintf(stderr, "open %s failed!\n", bin_file); + exit(ENOENT); + } + phrase_index.load(i, chunk); g_free(filename); } |