summaryrefslogtreecommitdiffstats
path: root/tests/storage/test_chewing_table.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-06 18:10:20 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-06 18:10:20 +0800
commitd89098230d873ca1e56af70b3c25a136576e743f (patch)
tree624205d1e5d25c3387959ecc53c318d486846f5a /tests/storage/test_chewing_table.cpp
parent2f329c267b26da0161135ec9f4033c7cd6bad508 (diff)
downloadlibpinyin-d89098230d873ca1e56af70b3c25a136576e743f.zip
libpinyin-d89098230d873ca1e56af70b3c25a136576e743f.tar.gz
libpinyin-d89098230d873ca1e56af70b3c25a136576e743f.tar.xz
fixes test chewing table
Diffstat (limited to 'tests/storage/test_chewing_table.cpp')
-rw-r--r--tests/storage/test_chewing_table.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/storage/test_chewing_table.cpp b/tests/storage/test_chewing_table.cpp
index dfc1fca..157a367 100644
--- a/tests/storage/test_chewing_table.cpp
+++ b/tests/storage/test_chewing_table.cpp
@@ -67,7 +67,12 @@ 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));
+ if (0 == keys->len) {
+ fprintf(stderr, "Invalid input.\n");
+ continue;
+ }
guint32 start = record_time();
PhraseIndexRanges ranges;