diff options
author | Peng Wu <alexepico@gmail.com> | 2012-09-03 16:33:25 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-09-03 16:33:25 +0800 |
commit | 424cc567dd0e84662b28baa17dd4879f95c0d507 (patch) | |
tree | 4839b7b378031ab610dba1dece4d2f417b35d6e5 /tests/storage | |
parent | c0f98a953be642a17d97caef95b92ee479353c94 (diff) | |
download | libpinyin-424cc567dd0e84662b28baa17dd4879f95c0d507.tar.gz libpinyin-424cc567dd0e84662b28baa17dd4879f95c0d507.tar.xz libpinyin-424cc567dd0e84662b28baa17dd4879f95c0d507.zip |
fixes test_phrase_table.cpp
Diffstat (limited to 'tests/storage')
-rw-r--r-- | tests/storage/test_phrase_table.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/storage/test_phrase_table.cpp b/tests/storage/test_phrase_table.cpp index 3c4c489..968a9f8 100644 --- a/tests/storage/test_phrase_table.cpp +++ b/tests/storage/test_phrase_table.cpp @@ -34,6 +34,12 @@ int main(int argc, char * argv[]){ guint32 start = record_time(); for ( size_t i = 0; i < bench_times; ++i){ largetable.search(phrase_len, new_phrase, tokens); + + /* clear tokens. */ + for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { + if (tokens[i]) + g_array_set_size(tokens[i], 0); + } } print_time(start, bench_times); |