From e9e00915580f2b9acc31e57e0bf950474d4fc062 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 25 Jun 2012 11:11:56 +0800 Subject: update tests --- tests/tests_helper.h | 14 ++++++++++---- 1 file 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"); -- cgit