aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2023-01-06 03:34:12 -0900
committerDavid M. Syzdek <david@syzdek.net>2023-01-06 03:34:12 -0900
commitc69a0c34054585f721cabddf2b165053936a0f0a (patch)
tree5bb84af8f26468565b77f2d07ad2241073362b96 /tests
parentf923e1f3fb60e203200cb05c18c858428d320b47 (diff)
downloadotputils-c69a0c34054585f721cabddf2b165053936a0f0a.tar.gz
otputils-c69a0c34054585f721cabddf2b165053936a0f0a.tar.bz2
otputils-c69a0c34054585f721cabddf2b165053936a0f0a.tar.xz
otputils-c69a0c34054585f721cabddf2b165053936a0f0a.zip
test-dict-otp: adding stats
Diffstat (limited to 'tests')
-rw-r--r--tests/test-dict-otp.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/test-dict-otp.c b/tests/test-dict-otp.c
index b1009db..fb2ffc4 100644
--- a/tests/test-dict-otp.c
+++ b/tests/test-dict-otp.c
@@ -204,15 +204,22 @@ my_dict_test(
204 unsigned char md[EVP_MAX_MD_SIZE]; 204 unsigned char md[EVP_MAX_MD_SIZE];
205 unsigned md_len; 205 unsigned md_len;
206 const char * word; 206 const char * word;
207 int missing;
207 208
208 err = 0; 209 err = 0;
210 missing = 0;
209 211
210 if (!(quiet)) 212 if (!(quiet))
211 printf("testing dictionary: %s\n", name); 213 printf("testing dictionary: %s\n", name);
212 214
213 for(pos = 0; (pos < 2048); pos++) 215 for(pos = 0; (pos < 2048); pos++)
214 { 216 {
215 word = dict[pos]; 217 if ((word = dict[pos]) == NULL)
218 {
219 printf(" value \"%i\": dictionary missing word for value\n", pos);
220 missing++;
221 continue;
222 };
216 223
217 // hash dictionary word 224 // hash dictionary word
218 md_len = sizeof(md); 225 md_len = sizeof(md);
@@ -236,7 +243,10 @@ my_dict_test(
236 }; 243 };
237 244
238 if (!(quiet)) 245 if (!(quiet))
239 printf(" dictionary has %i error(s)\n", err); 246 {
247 printf(" dictionary has %i error(s) and %i missing value(s)\n", err, missing);
248 printf("\n");
249 };
240 250
241 return( ((err)) ? 1 : 0 ); 251 return( ((err)) ? 1 : 0 );
242} 252}