# # # patch "roster.cc" # from [aa87d6a008ddb5e135e864004020c3470c70bb73] # to [c5649998ebbd7bc263a1c00a0c8b3319adfd95ff] # ============================================================ --- roster.cc aa87d6a008ddb5e135e864004020c3470c70bb73 +++ roster.cc c5649998ebbd7bc263a1c00a0c8b3319adfd95ff @@ -2947,6 +2947,17 @@ dir_t root_n = downcast_to_dir_t(r.get_node(root)); root_n->children.insert(make_pair(*(foo.end()-1), other.get_node(other_nid))); BOOST_CHECK_THROW(r.check_sane(), std::logic_error); + // well, but that one was easy, actually, because a dir traversal will hit + // more nodes than actually exist... so let's make it harder, by making sure + // that a dir traversal will hit exactly as many nodes as actually exist. + node_id distractor_nid = r.create_dir_node(nis); + BOOST_CHECK_THROW(r.check_sane(), std::logic_error); + // and even harder, by making that node superficially valid too + dir_t distractor_n = downcast_to_dir_t(r.get_node(distractor_nid)); + distractor_n->parent = distractor_nid; + distractor_n->name = *(foo.end()-1); + distractor_n->children.insert(make_pair(distractor_n->name, distractor_n)); + BOOST_CHECK_THROW(r.check_sane(), std::logic_error); } static void