summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-04-15 13:51:02 +0800
committerPeng Wu <alexepico@gmail.com>2011-04-15 13:51:02 +0800
commitf3e68a089ba76467a7adc15d657dd2f9552b2bc7 (patch)
tree964263bb8976cd699d6fc24cd7392e2e20052853 /tests
parent06f2399d0d425c51f383d1c0b5f8fd7dc823be7a (diff)
downloadlibpinyin-f3e68a089ba76467a7adc15d657dd2f9552b2bc7.tar.gz
libpinyin-f3e68a089ba76467a7adc15d657dd2f9552b2bc7.tar.xz
libpinyin-f3e68a089ba76467a7adc15d657dd2f9552b2bc7.zip
add get/set array header to flexible bi-gram
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_flexible_ngram.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/storage/test_flexible_ngram.cpp b/tests/storage/test_flexible_ngram.cpp
index f915a1f..16eb225 100644
--- a/tests/storage/test_flexible_ngram.cpp
+++ b/tests/storage/test_flexible_ngram.cpp
@@ -38,7 +38,6 @@ int main(int argc, char * argv[]) {
single_gram.set_array_header(32);
single_gram.get_array_header(freq);
printf("new array header:%d\n", freq);
-
bigram.store(2, &single_gram);
for (int m = 1; m <= 2; ++m ){
@@ -69,4 +68,20 @@ int main(int argc, char * argv[]) {
bigram.get_magic_header(freq);
assert(total_freq == freq);
printf("magic header:%d\n", freq);
+
+ printf("-----------------------array header---------------------\n");
+ for ( size_t i = 1; i <= 2; ++i){
+ bigram.get_array_header(i, freq);
+ printf("single gram: %d, freq:%d\n", i, freq);
+ }
+
+ bigram.set_array_header(1, 1);
+
+ printf("-----------------------array header---------------------\n");
+ for ( size_t i = 1; i <= 2; ++i){
+ bigram.get_array_header(i, freq);
+ printf("single gram: %d, freq:%d\n", i, freq);
+ }
+
+ return 0;
}