summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-06-25 11:11:56 +0800
committerPeng Wu <alexepico@gmail.com>2012-06-25 11:11:56 +0800
commite9e00915580f2b9acc31e57e0bf950474d4fc062 (patch)
treedbe814230507ea5260c1dd5e95750ea103843752 /tests
parent61dff7403370bd1902c73c78be8312be4d3caa68 (diff)
downloadlibpinyin-e9e00915580f2b9acc31e57e0bf950474d4fc062.tar.gz
libpinyin-e9e00915580f2b9acc31e57e0bf950474d4fc062.tar.xz
libpinyin-e9e00915580f2b9acc31e57e0bf950474d4fc062.zip
update tests
Diffstat (limited to 'tests')
-rw-r--r--tests/tests_helper.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/tests_helper.h b/tests/tests_helper.h
index 5694148..f15c19e 100644
--- a/tests/tests_helper.h
+++ b/tests/tests_helper.h
@@ -25,10 +25,13 @@
static bool load_phrase_index(FacadePhraseIndex * phrase_index){
MemoryChunk * chunk = NULL;
for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
- const char * binfile = pinyin_phrase_files[i];
- if (NULL == binfile)
+ const pinyin_table_info_t * table_info = pinyin_phrase_files + i;
+
+ if (SYSTEM_FILE != table_info->m_file_type)
continue;
+ const char * binfile = table_info->m_system_filename;
+
gchar * filename = g_build_filename("..", "..", "data",
binfile, NULL);
chunk = new MemoryChunk;
@@ -48,10 +51,13 @@ static bool load_phrase_table(ChewingLargeTable * chewing_table,
PhraseLargeTable * phrase_table,
FacadePhraseIndex * phrase_index){
for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
- const char * tablename = pinyin_table_files[i];
- if ( NULL == tablename )
+ const pinyin_table_info_t * table_info = pinyin_phrase_files + i;
+
+ if (SYSTEM_FILE != table_info->m_file_type)
continue;
+ const char * tablename = table_info->m_table_filename;
+
gchar * filename = g_build_filename("..", "..", "data",
tablename, NULL);
FILE * tablefile = fopen(filename, "r");