summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-03-21 17:02:22 +0800
committerPeng Wu <alexepico@gmail.com>2013-03-21 17:03:06 +0800
commit60d7294cce9c5f57e3497765783b9fa65e7ff9c0 (patch)
tree6a6b8404b7c612054aa0110d20b0f788101a5546 /tests
parent4348b63eeec5662fedfc39be6fc78b62e2e26467 (diff)
downloadlibpinyin-60d7294cce9c5f57e3497765783b9fa65e7ff9c0.tar.gz
libpinyin-60d7294cce9c5f57e3497765783b9fa65e7ff9c0.tar.xz
libpinyin-60d7294cce9c5f57e3497765783b9fa65e7ff9c0.zip
update test_phrase.cpp
Diffstat (limited to 'tests')
-rw-r--r--tests/test_phrase.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_phrase.cpp b/tests/test_phrase.cpp
index fdee52e..72639e1 100644
--- a/tests/test_phrase.cpp
+++ b/tests/test_phrase.cpp
@@ -42,11 +42,12 @@ int main(int argc, char * argv[]){
break;
pinyin_phrase_segment(instance, linebuf);
- MatchResults & tokens = instance->m_match_results;
+ guint len = 0;
+ pinyin_get_n_phrase(instance, &len);
- for ( size_t i = 0; i < tokens->len; ++i ){
- phrase_token_t token = g_array_index
- (tokens, phrase_token_t, i);
+ for ( size_t i = 0; i < len; ++i ){
+ phrase_token_t token = null_token;
+ pinyin_get_phrase_token(instance, i, &token);
if ( null_token == token )
continue;