From: Sebastian B. <sb...@us...> - 2014-01-19 18:52:10
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25100/tests Modified Files: index_external_unittest.c Log Message: Check for proper level of inserted strings. Index: index_external_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/index_external_unittest.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index_external_unittest.c 19 Jan 2014 18:51:29 -0000 1.2 +++ index_external_unittest.c 19 Jan 2014 18:52:08 -0000 1.3 @@ -50,6 +50,20 @@ } CU_ASSERT(count_index_leaves(idx, idx->root_node, 0) == idx->max_elements_per_node+1); + + for (i=0;i<idx->max_elements_per_node+1;i++) + { + char buf[16]; + struct bnode_path bp; + + snprintf(buf, sizeof(buf), "%03dtest", i); + + memset(&bp, 0, sizeof(bp)); + rc = bnode_lookup(idx, buf, &bp); + CU_ASSERT(rc != 0); + CU_ASSERT(bp.max_level == 1); + } + printf("%d %d %d %d\n", count_index_leaves(idx, idx->root_node, 0), count_index(idx, idx->root_node, 0), idx->max_elements_per_node, idx->number_of_blocks); |