29 #include "config.h" |
29 #include "config.h" |
30 #include "testutils.h" |
30 #include "testutils.h" |
31 #include "setupsentry.h" |
31 #include "setupsentry.h" |
32 #include "testcorpus.h" |
32 #include "testcorpus.h" |
33 |
33 |
34 |
34 #include "std_log_result.h" |
35 |
35 |
36 class FlushContext : public Itk::ITestContext, public Cpt::IFileVisitor |
36 class FlushContext : public Itk::ITestContext, public Cpt::IFileVisitor |
37 { |
37 { |
38 private: |
38 private: |
39 SmsIdxUtil * util_; |
39 SmsIdxUtil * util_; |
124 |
124 |
125 |
125 |
126 |
126 |
127 void testEmptyIndex(Itk::TestMgr * testMgr) |
127 void testEmptyIndex(Itk::TestMgr * testMgr) |
128 { |
128 { |
|
129 char *xml_file = (char *)__FUNCTION__; |
|
130 assert_failed = 0; |
129 checkIndexFiles(testMgr); |
131 checkIndexFiles(testMgr); |
|
132 testResultXml(xml_file); |
|
133 |
130 } |
134 } |
131 |
135 |
132 |
136 |
133 void testAddingBy512B(Itk::TestMgr * testMgr) |
137 void testAddingBy512B(Itk::TestMgr * testMgr) |
134 { |
138 { |
|
139 char *xml_file = (char *)__FUNCTION__; |
|
140 assert_failed = 0; |
135 setMaxInsertBufferSize(testMgr, |
141 setMaxInsertBufferSize(testMgr, |
136 512); // 512 B buffer |
142 512); // 512 B buffer |
137 addItems(testMgr, |
143 addItems(testMgr, |
138 10); |
144 10); |
|
145 testResultXml(xml_file); |
139 } |
146 } |
140 |
147 |
141 |
148 |
142 void testAddingBy10KB(Itk::TestMgr * testMgr) |
149 void testAddingBy10KB(Itk::TestMgr * testMgr) |
143 { |
150 { |
|
151 char *xml_file = (char *)__FUNCTION__; |
|
152 assert_failed = 0; |
144 setMaxInsertBufferSize(testMgr, |
153 setMaxInsertBufferSize(testMgr, |
145 10*1024); // 10 KB buffer |
154 10*1024); // 10 KB buffer |
146 addItems(testMgr, |
155 addItems(testMgr, |
147 40); |
156 40); |
|
157 testResultXml(xml_file); |
148 } |
158 } |
149 |
159 |
150 |
160 |
151 void testFlushing(Itk::TestMgr * testMgr) |
161 void testFlushing(Itk::TestMgr * testMgr) |
152 { |
162 { |
|
163 char *xml_file = (char *)__FUNCTION__; |
|
164 assert_failed = 0; |
153 addItems(testMgr, |
165 addItems(testMgr, |
154 15); |
166 15); |
155 flush(testMgr); |
167 flush(testMgr); |
156 checkIndexFiles(testMgr); |
168 checkIndexFiles(testMgr); |
|
169 testResultXml(xml_file); |
157 } |
170 } |
158 |
171 |
159 |
172 |
160 private: |
173 private: |
161 |
174 |