MCPcopy Create free account
hub / github.com/davisking/dlib / config_reader_test

Function config_reader_test

dlib/test/config_reader.cpp:159–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157 typename config_reader
158 >
159 void config_reader_test (
160 )
161 /*!
162 requires
163 - config_reader is an implementation of config_reader/config_reader_kernel_abstract.h
164 is instantiated with int
165 ensures
166 - runs tests on config_reader for compliance with the specs
167 !*/
168 {
169
170
171
172 ostringstream sout;
173
174 sout << "all#comment { { } \n";
175 sout << "{ \n";
176 sout << " block1 \n";
177 sout << " { \n";
178 sout << " name = davis king \n";
179 sout << " age = 24 \n";
180 sout << " } \n";
181 sout << " \n";
182 sout << " block2 \n";
183 sout << " { \n";
184 sout << " name= joel \n";
185 sout << " age =24 \n";
186 sout << " } \n";
187 sout << " \n";
188 sout << " block3 \n";
189 sout << " { \n";
190 sout << " name = john \n";
191 sout << " age = 24 \n";
192 sout << " } \n";
193 sout << " #comment \n";
194 sout << "#comment \n";
195 sout << " block4{ # comment";
196 sout << " \n";
197 sout << " name = dude \n";
198 sout << " age = 53}\n";
199 sout << " \n";
200 sout << "} \n";
201 sout << " \n";
202 sout << " \n";
203 sout << "global=hmm#comment \n";
204 sout << "global2=hmm2 \n";
205 sout << " # comment \n";
206
207 string data = sout.str();
208
209 config_reader cr2;
210 for (int i = 0; i < 3; ++i)
211 {
212 istringstream sin;
213
214 sin.clear();
215 sin.str(data);
216

Callers

nothing calls this directly

Calls 3

do_the_testsFunction · 0.85
strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected