summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-09 16:52:10 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-09 16:52:10 +0800
commit3af2cf9799894048f226e952ea9a0b06f5da6553 (patch)
treeba0f2ac0616c5932b3c33e75d859760dd9089578
parent8ac95f0eefd222a27d28e8d92edcfa4b39464018 (diff)
downloadlibpinyin-3af2cf9799894048f226e952ea9a0b06f5da6553.zip
libpinyin-3af2cf9799894048f226e952ea9a0b06f5da6553.tar.gz
libpinyin-3af2cf9799894048f226e952ea9a0b06f5da6553.tar.xz
fixes code style
-rw-r--r--tests/storage/test_chewing_table.cpp2
-rw-r--r--tests/storage/test_pinyin_table.cpp24
2 files changed, 15 insertions, 11 deletions
diff --git a/tests/storage/test_chewing_table.cpp b/tests/storage/test_chewing_table.cpp
index ef99704..396eaa8 100644
--- a/tests/storage/test_chewing_table.cpp
+++ b/tests/storage/test_chewing_table.cpp
@@ -105,7 +105,7 @@ int main(int argc, char * argv[]) {
for (size_t k = 0; k < range->len; ++k) {
PhraseIndexRange * onerange =
&g_array_index(range, PhraseIndexRange, k);
- printf("start:%d\tend%d\n", onerange->m_range_begin,
+ printf("start:%d\tend:%d\n", onerange->m_range_begin,
onerange->m_range_end);
PhraseItem item;
diff --git a/tests/storage/test_pinyin_table.cpp b/tests/storage/test_pinyin_table.cpp
index fbd00f8..6569874 100644
--- a/tests/storage/test_pinyin_table.cpp
+++ b/tests/storage/test_pinyin_table.cpp
@@ -71,17 +71,21 @@ int main( int argc, char * argv[]){
largetable.search(keys->len, (PinyinKey *)keys->data, ranges);
for( size_t i = 0 ; i < PHRASE_INDEX_LIBRARY_COUNT ; ++i){
GArray * range = ranges[i];
- if ( range ){
- if ( range->len)
- printf("range items number:%d\n", range->len);
+ if (range) {
+ if (range->len)
+ printf("range items number:%d\n", range->len);
- for (size_t k = 0; k < range->len; ++k){
- PhraseIndexRange* onerange = &g_array_index(range, PhraseIndexRange, k);
- printf("start:%d\tend:%d\n", onerange->m_range_begin, onerange->m_range_end);
- }
- }
- g_array_set_size( range, 0);
- }
+ for (size_t k = 0; k < range->len; ++k) {
+ PhraseIndexRange * onerange =
+ &g_array_index(range, PhraseIndexRange, k);
+ printf("start:%d\tend:%d\n", onerange->m_range_begin,
+ onerange->m_range_end);
+
+ }
+ }
+
+ g_array_set_size(range, 0);
+ }
g_array_free(keys, TRUE);
g_array_free(poses, TRUE);