summaryrefslogtreecommitdiffstats
path: root/tests/lookup/test_pinyin_lookup.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-05-17 14:37:36 +0800
committerPeng Wu <alexepico@gmail.com>2012-05-17 14:37:36 +0800
commit347291e6e8533f5822ca040100fb38176db7c5d0 (patch)
treef0afa05989f0b772cc7bb8957d05fa3b6073d302 /tests/lookup/test_pinyin_lookup.cpp
parent981d12ddb3610e4ca63423572651e3f667fa0073 (diff)
downloadlibpinyin-347291e6e8533f5822ca040100fb38176db7c5d0.tar.gz
libpinyin-347291e6e8533f5822ca040100fb38176db7c5d0.tar.xz
libpinyin-347291e6e8533f5822ca040100fb38176db7c5d0.zip
update test cases
Diffstat (limited to 'tests/lookup/test_pinyin_lookup.cpp')
-rw-r--r--tests/lookup/test_pinyin_lookup.cpp11
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);
}