mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-21 13:57:04 +00:00
Flushing tmp_linpool in tree test and in static protocol
This commit is contained in:
parent
30a909f9bc
commit
05c63ae734
@ -170,6 +170,8 @@ t_balancing(void)
|
|||||||
show_tree(balanced_tree_from_simple);
|
show_tree(balanced_tree_from_simple);
|
||||||
|
|
||||||
bt_assert(same_tree(balanced_tree_from_simple, expected_balanced_tree));
|
bt_assert(same_tree(balanced_tree_from_simple, expected_balanced_tree));
|
||||||
|
|
||||||
|
tmp_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -191,6 +193,9 @@ t_balancing_random(void)
|
|||||||
uint i;
|
uint i;
|
||||||
for(i = 0; i < 10; i++)
|
for(i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
|
struct lp_state lps;
|
||||||
|
lp_save(tmp_linpool, &lps);
|
||||||
|
|
||||||
struct f_tree *random_degenerated_tree = get_random_degenerated_left_tree(nodes_count);
|
struct f_tree *random_degenerated_tree = get_random_degenerated_left_tree(nodes_count);
|
||||||
show_tree(random_degenerated_tree);
|
show_tree(random_degenerated_tree);
|
||||||
|
|
||||||
@ -200,7 +205,11 @@ t_balancing_random(void)
|
|||||||
show_tree(balanced_tree_from_random);
|
show_tree(balanced_tree_from_random);
|
||||||
|
|
||||||
bt_assert(same_tree(balanced_tree_from_random, expected_balanced_tree));
|
bt_assert(same_tree(balanced_tree_from_random, expected_balanced_tree));
|
||||||
|
|
||||||
|
lp_restore(tmp_linpool, &lps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmp_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -227,6 +236,8 @@ t_find(void)
|
|||||||
const struct f_tree *found_tree = find_tree(tree, &looking_up_value);
|
const struct f_tree *found_tree = find_tree(tree, &looking_up_value);
|
||||||
bt_assert((val_compare(&looking_up_value, &(found_tree->from)) == 0) && (val_compare(&looking_up_value, &(found_tree->to)) == 0));
|
bt_assert((val_compare(&looking_up_value, &(found_tree->from)) == 0) && (val_compare(&looking_up_value, &(found_tree->to)) == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmp_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -283,6 +294,8 @@ t_find_ranges(void)
|
|||||||
((val_compare(&needle, &(found_tree->from)) == 1) && (val_compare(&needle, &(found_tree->to)) == -1))
|
((val_compare(&needle, &(found_tree->from)) == 1) && (val_compare(&needle, &(found_tree->to)) == -1))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmp_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -494,7 +494,12 @@ static_start(struct proto *P)
|
|||||||
proto_notify_state(P, PS_UP);
|
proto_notify_state(P, PS_UP);
|
||||||
|
|
||||||
WALK_LIST(r, cf->routes)
|
WALK_LIST(r, cf->routes)
|
||||||
|
{
|
||||||
|
struct lp_state lps;
|
||||||
|
lp_save(tmp_linpool, &lps);
|
||||||
static_add_rte(p, r);
|
static_add_rte(p, r);
|
||||||
|
lp_restore(tmp_linpool, &lps);
|
||||||
|
}
|
||||||
|
|
||||||
return PS_UP;
|
return PS_UP;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user