the internal rep invariants.
prof_tree.c (profile_verify_node): Fix bug in profile_verify_node in
the group_level test. Also make profile_verify_node check the return
code when it is recursively testing the child nodes.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11189
dc483132-0cff-0310-8789-
dd5450dbe970
+Fri Feb 19 00:49:10 1999 Theodore Y. Ts'o <tytso@mit.edu>
+
+ * test_parse.c (main): Add a call to profile_verify_node so we can
+ test the internal rep invariants.
+
+ * prof_tree.c (profile_verify_node): Fix bug in
+ profile_verify_node in the group_level test. Also make
+ profile_verify_node check the return code when it is
+ recursively testing the child nodes.
+
Mon Jan 25 18:44:26 1999 Theodore Y. Ts'o <tytso@mit.edu>
* prof_tree.c (profile_node_iterator): Added comments indicating
struct profile_node *node;
{
struct profile_node *p, *last;
-
+ errcode_t retval;
+
CHECK_MAGIC(node);
if (node->value && node->first_child)
return PROF_BAD_LINK_LIST;
if (last && (last->next != p))
return PROF_BAD_LINK_LIST;
- if (node->group_level != p->group_level+1)
+ if (node->group_level+1 != p->group_level)
return PROF_BAD_GROUP_LVL;
if (p->parent != node)
return PROF_BAD_PARENT_PTR;
- profile_verify_node(p);
+ retval = profile_verify_node(p);
+ if (retval)
+ return retval;
}
return 0;
}
retval = profile_parse_file(f, &root);
if (retval) {
printf("profile_parse_file error %s\n", error_message(retval));
- return 0;
+ exit(1);
}
fclose(f);
dump_profile_to_file(root, 0, stdout);
#endif
+ retval = profile_verify_node(root);
+ if (retval) {
+ printf("profile_verify_node reported an error: %s\n",
+ error_message(retval));
+ exit(1);
+ }
+
profile_free_node(root);
return 0;