summaryrefslogtreecommitdiffstats
path: root/tests/storage/test_chewing_table.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-04-10 13:55:57 +0800
committerPeng Wu <alexepico@gmail.com>2013-04-10 13:55:57 +0800
commit8888185c907779dc9aa20b0b2e7bd19af6d11d2c (patch)
tree1534851a7448f9621dfa98a03c84eb47e7a31f15 /tests/storage/test_chewing_table.cpp
parent2c7f91dd2546ccba87714391c1281ee8973de4ac (diff)
downloadlibpinyin-8888185c907779dc9aa20b0b2e7bd19af6d11d2c.zip
libpinyin-8888185c907779dc9aa20b0b2e7bd19af6d11d2c.tar.gz
libpinyin-8888185c907779dc9aa20b0b2e7bd19af6d11d2c.tar.xz
update tests/storage
Diffstat (limited to 'tests/storage/test_chewing_table.cpp')
-rw-r--r--tests/storage/test_chewing_table.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/storage/test_chewing_table.cpp b/tests/storage/test_chewing_table.cpp
index bb25780..f3d0f5d 100644
--- a/tests/storage/test_chewing_table.cpp
+++ b/tests/storage/test_chewing_table.cpp
@@ -27,11 +27,22 @@
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);
+ }
+
pinyin_option_t options = USE_TONE | PINYIN_INCOMPLETE;
ChewingLargeTable largetable(options);
FacadePhraseIndex phrase_index;
- if (!load_phrase_table(&largetable, NULL, &phrase_index))
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
+ if (!load_phrase_table(phrase_files, &largetable, NULL, &phrase_index))
exit(ENOENT);
MemoryChunk * new_chunk = new MemoryChunk;