fix unit test for ncplane_move_family() #2232

pull/2236/head
nick black 3 years ago
parent 099eda88ac
commit a2837a9754
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -1455,6 +1455,7 @@ void ncplane_move_bottom(ncplane* n){
// if above is NULL, we're moving to the bottom
void ncplane_move_family_above(ncplane* restrict n, ncplane* restrict bpoint){
ncplane* above = ncplane_above(n);
ncplane* below = ncplane_below(n);
ncplane_move_above(n, bpoint);
// traverse the planes above n, until we hit NULL. do the planes above n
// first, so that we know the topmost element of our new ensplicification.
@ -1472,7 +1473,6 @@ void ncplane_move_family_above(ncplane* restrict n, ncplane* restrict bpoint){
// careful this time not to cross into any we moved below n.
const ncplane* topmost = targ;
targ = n;
ncplane* below = ncplane_below(n);
while(below && below != topmost){
ncplane* tmp = ncplane_below(below);
if(ncplane_descendant_p(below, n)){
@ -1486,6 +1486,7 @@ void ncplane_move_family_above(ncplane* restrict n, ncplane* restrict bpoint){
// if below is NULL, we're moving to the top
void ncplane_move_family_below(ncplane* restrict n, ncplane* restrict bpoint){
ncplane* below = ncplane_below(n);
ncplane* above = ncplane_above(n);
ncplane_move_below(n, bpoint);
// traverse the planes below n, until we hit NULL. do the planes below n
// first, so that we know the bottommost element of our new ensplicification.
@ -1503,7 +1504,6 @@ void ncplane_move_family_below(ncplane* restrict n, ncplane* restrict bpoint){
// careful this time not to cross into any we moved below n.
const ncplane* bottommost = targ;
targ = n;
ncplane* above = ncplane_above(n);
while(above && above != bottommost){
ncplane* tmp = ncplane_above(above);
if(ncplane_descendant_p(above, n)){

@ -225,14 +225,13 @@ TEST_CASE("ZAxis") {
CHECK(ncplane_below(e) == n_);
CHECK(ncpile_bottom(n_) == n_);
ncplane_move_family_bottom(c);
// ABDsCE, E is bound to C (FIXME have ABDEsC)
CHECK(ncpile_top(n_) == a);
CHECK(ncplane_below(a) == b);
CHECK(ncplane_below(b) == d);
CHECK(ncplane_below(d) == e);
CHECK(ncplane_below(e) == n_);
CHECK(ncplane_below(d) == n_);
CHECK(ncplane_below(n_) == c);
CHECK(ncpile_bottom(n_) == c);
CHECK(ncplane_below(c) == e);
CHECK(ncpile_bottom(n_) == e);
}
CHECK(0 == notcurses_stop(nc_));

Loading…
Cancel
Save