summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-07-21 15:13:31 +0800
committerPeng Wu <alexepico@gmail.com>2016-07-21 15:13:31 +0800
commit0ba361964b810f06839f67ddfbfba39fb75b6a70 (patch)
treeb43583105b310a101c53bddd618858c3ebf93441 /tests
parenteb08ebb49b4823b17c749cde377c0aa1c6fe76ea (diff)
downloadlibpinyin-0ba361964b810f06839f67ddfbfba39fb75b6a70.tar.gz
libpinyin-0ba361964b810f06839f67ddfbfba39fb75b6a70.tar.xz
libpinyin-0ba361964b810f06839f67ddfbfba39fb75b6a70.zip
fixes fill_matrix function
Diffstat (limited to 'tests')
-rw-r--r--tests/lookup/test_pinyin_lookup.cpp5
-rw-r--r--tests/storage/test_matrix.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/lookup/test_pinyin_lookup.cpp b/tests/lookup/test_pinyin_lookup.cpp
index ac43ce5..9978551 100644
--- a/tests/lookup/test_pinyin_lookup.cpp
+++ b/tests/lookup/test_pinyin_lookup.cpp
@@ -82,7 +82,8 @@ int main( int argc, char * argv[]){
ChewingKeyVector keys = g_array_new(FALSE, FALSE, sizeof(ChewingKey));
ChewingKeyRestVector key_rests =
g_array_new(FALSE, FALSE, sizeof(ChewingKeyRest));
- parser.parse(options, keys, key_rests, linebuf, strlen(linebuf));
+ int parsed_len = parser.parse(options, keys, key_rests,
+ linebuf, strlen(linebuf));
PhoneticKeyMatrix matrix;
@@ -90,7 +91,7 @@ int main( int argc, char * argv[]){
continue;
/* fill the matrix. */
- fill_matrix(&matrix, keys, key_rests);
+ fill_matrix(&matrix, keys, key_rests, parsed_len);
resplit_step(options, &matrix);
diff --git a/tests/storage/test_matrix.cpp b/tests/storage/test_matrix.cpp
index 5602bd6..bc7ede4 100644
--- a/tests/storage/test_matrix.cpp
+++ b/tests/storage/test_matrix.cpp
@@ -124,7 +124,7 @@ int main(int argc, char * argv[]) {
len = parser->parse(options, keys, key_rests,
linebuf, strlen(linebuf));
- fill_matrix(&matrix, keys, key_rests);
+ fill_matrix(&matrix, keys, key_rests, len);
resplit_step(options, &matrix);