summaryrefslogtreecommitdiffstats
path: root/tests/storage/test_phrase_index.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2010-09-14 16:10:33 +0800
committerPeng Wu <alexepico@gmail.com>2010-09-14 16:10:33 +0800
commit32b04bf652dca5d8e4d9980a9066d6ada19c868c (patch)
tree4f4ec95b18b96764706510c1fdfa111e93411ab6 /tests/storage/test_phrase_index.cpp
parent9a5f7fb359c1a6ea6a6fde624473bfd4777b68a4 (diff)
downloadlibpinyin-32b04bf652dca5d8e4d9980a9066d6ada19c868c.tar.gz
libpinyin-32b04bf652dca5d8e4d9980a9066d6ada19c868c.tar.xz
libpinyin-32b04bf652dca5d8e4d9980a9066d6ada19c868c.zip
add test case for compat method
Diffstat (limited to 'tests/storage/test_phrase_index.cpp')
-rw-r--r--tests/storage/test_phrase_index.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/storage/test_phrase_index.cpp b/tests/storage/test_phrase_index.cpp
index 0ebcc36..72b6d03 100644
--- a/tests/storage/test_phrase_index.cpp
+++ b/tests/storage/test_phrase_index.cpp
@@ -110,6 +110,8 @@ int main(int argc, char * argv[]){
phrase_index_load.load_text(2, infile);
fclose(infile);
+ phrase_index.compat();
+
MemoryChunk* store1 = new MemoryChunk;
phrase_index_load.store(1, store1);
phrase_index_load.load(1, store1);
@@ -118,6 +120,8 @@ int main(int argc, char * argv[]){
phrase_index_load.store(2, store2);
phrase_index_load.load(2, store2);
+ phrase_index.compat();
+
phrase_index_load.get_phrase_item(16870555, item2);
assert( item2.get_phrase_length() == 14);
assert( item2.get_n_pronunciation() == 1);