fixes test phrase table.
authorPeng Wu <alexepico@gmail.com>
Mon, 18 Apr 2011 09:16:47 +0000 (17:16 +0800)
committerPeng Wu <alexepico@gmail.com>
Mon, 18 Apr 2011 09:16:47 +0000 (17:16 +0800)
tests/storage/test_phrase_table.cpp

index e5fb24d..66ed060 100644 (file)
@@ -65,8 +65,11 @@ int main(int argc, char * argv[]){
         }
         print_time(start, bench_times);
 
-        largetable.search(phrase_len, new_phrase, token);
-        printf("%s:\t%d\n", linebuf, token);
+        int retval = largetable.search(phrase_len, new_phrase, token);
+        if ( retval & SEARCH_OK )
+            printf("%s:\t%d\n", linebuf, token);
+        else
+            printf("phrase %s not found.\n", linebuf);
 
         g_free(new_phrase);
     }