From 424cc567dd0e84662b28baa17dd4879f95c0d507 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 3 Sep 2012 16:33:25 +0800 Subject: fixes test_phrase_table.cpp --- tests/storage/test_phrase_table.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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); -- cgit