summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-05-11 16:38:14 +0800
committerPeng Wu <alexepico@gmail.com>2016-05-11 16:38:14 +0800
commit5b487bd6d66f9a8f43260a9bec978ea8cf692995 (patch)
tree49dfb695ee6af317d81aa34f3835cc55a4e6ea0a /tests
parent0d1aaf9cb0f4b53114422618cb61510560f4611d (diff)
downloadlibpinyin-5b487bd6d66f9a8f43260a9bec978ea8cf692995.zip
libpinyin-5b487bd6d66f9a8f43260a9bec978ea8cf692995.tar.gz
libpinyin-5b487bd6d66f9a8f43260a9bec978ea8cf692995.tar.xz
fixes compile
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/Makefile.am9
-rw-r--r--tests/storage/test_matrix.cpp3
2 files changed, 8 insertions, 4 deletions
diff --git a/tests/storage/Makefile.am b/tests/storage/Makefile.am
index 7675d11..1f74e72 100644
--- a/tests/storage/Makefile.am
+++ b/tests/storage/Makefile.am
@@ -34,6 +34,7 @@ noinst_PROGRAMS = test_phrase_index \
test_ngram \
test_flexible_ngram \
test_parser2 \
+ test_matrix \
test_chewing_table \
test_table_info
@@ -44,11 +45,13 @@ test_phrase_index_logger_SOURCES = test_phrase_index_logger.cpp
test_phrase_table_SOURCES = test_phrase_table.cpp
-test_ngram_SOURCES = test_ngram.cpp
+test_ngram_SOURCES = test_ngram.cpp
-test_flexible_ngram_SOURCES = test_flexible_ngram.cpp
+test_flexible_ngram_SOURCES = test_flexible_ngram.cpp
-test_parser2_SOURCES = test_parser2.cpp
+test_parser2_SOURCES = test_parser2.cpp
+
+test_matrix_SOURCES = test_matrix.cpp
test_chewing_table_SOURCES = test_chewing_table.cpp
diff --git a/tests/storage/test_matrix.cpp b/tests/storage/test_matrix.cpp
index ba9b3e0..fd965b8 100644
--- a/tests/storage/test_matrix.cpp
+++ b/tests/storage/test_matrix.cpp
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include "pinyin_internal.h"
+size_t bench_times = 1000;
using namespace pinyin;
@@ -30,7 +31,7 @@ int main(int argc, char * argv[]) {
pinyin_option_t options = PINYIN_CORRECT_ALL;
options |= PINYIN_INCOMPLETE;
- PhoneticParser2 * parser = FullPinyinParser2();
+ PhoneticParser2 * parser = new FullPinyinParser2();
ChewingKeyVector keys = g_array_new(FALSE, FALSE, sizeof(ChewingKey));
ChewingKeyRestVector key_rests =
g_array_new(FALSE, FALSE, sizeof(ChewingKeyRest));