summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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;