diff options
author | Peng Wu <alexepico@gmail.com> | 2013-04-10 13:55:57 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2013-04-10 13:55:57 +0800 |
commit | 8888185c907779dc9aa20b0b2e7bd19af6d11d2c (patch) | |
tree | 1534851a7448f9621dfa98a03c84eb47e7a31f15 /tests/storage/test_phrase_table.cpp | |
parent | 2c7f91dd2546ccba87714391c1281ee8973de4ac (diff) | |
download | libpinyin-8888185c907779dc9aa20b0b2e7bd19af6d11d2c.tar.gz libpinyin-8888185c907779dc9aa20b0b2e7bd19af6d11d2c.tar.xz libpinyin-8888185c907779dc9aa20b0b2e7bd19af6d11d2c.zip |
update tests/storage
Diffstat (limited to 'tests/storage/test_phrase_table.cpp')
-rw-r--r-- | tests/storage/test_phrase_table.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/storage/test_phrase_table.cpp b/tests/storage/test_phrase_table.cpp index 9a84d6d..a9c8ed5 100644 --- a/tests/storage/test_phrase_table.cpp +++ b/tests/storage/test_phrase_table.cpp @@ -6,10 +6,21 @@ size_t bench_times = 1000; int main(int argc, char * argv[]){ + SystemTableInfo system_table_info; + + bool retval = system_table_info.load("../../data/table.conf"); + if (!retval) { + fprintf(stderr, "load table.conf failed.\n"); + exit(ENOENT); + } + PhraseLargeTable2 largetable; FacadePhraseIndex phrase_index; - if (!load_phrase_table(NULL, &largetable, &phrase_index)) + const pinyin_table_info_t * phrase_files = + system_table_info.get_table_info(); + + if (!load_phrase_table(phrase_files, NULL, &largetable, &phrase_index)) exit(ENOENT); MemoryChunk * chunk = new MemoryChunk; |