subsurface-test.c 18.5 KB
Newer Older
1 2 3
/*
 * Copyright © 2012 Collabora, Ltd.
 *
4 5 6 7 8 9 10
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
11
 *
12 13 14 15 16 17 18 19 20 21 22 23
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial
 * portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
24 25
 */

26 27
#include "config.h"

28
#include <stdio.h>
29 30 31
#include <string.h>

#include "weston-test-client-helper.h"
Pekka Paalanen's avatar
Pekka Paalanen committed
32 33 34 35 36 37 38 39 40 41 42 43
#include "weston-test-fixture-compositor.h"

static enum test_result_code
fixture_setup(struct weston_test_harness *harness)
{
	struct compositor_setup setup;

	compositor_setup_defaults(&setup);

	return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106

#define NUM_SUBSURFACES 3

struct compound_surface {
	struct wl_subcompositor *subco;
	struct wl_surface *parent;
	struct wl_surface *child[NUM_SUBSURFACES];
	struct wl_subsurface *sub[NUM_SUBSURFACES];
};

static struct wl_subcompositor *
get_subcompositor(struct client *client)
{
	struct global *g;
	struct global *global_sub = NULL;
	struct wl_subcompositor *sub;

	wl_list_for_each(g, &client->global_list, link) {
		if (strcmp(g->interface, "wl_subcompositor"))
			continue;

		if (global_sub)
			assert(0 && "multiple wl_subcompositor objects");

		global_sub = g;
	}

	assert(global_sub && "no wl_subcompositor found");

	assert(global_sub->version == 1);

	sub = wl_registry_bind(client->wl_registry, global_sub->name,
			       &wl_subcompositor_interface, 1);
	assert(sub);

	return sub;
}

static void
populate_compound_surface(struct compound_surface *com, struct client *client)
{
	int i;

	com->subco = get_subcompositor(client);

	com->parent = wl_compositor_create_surface(client->wl_compositor);

	for (i = 0; i < NUM_SUBSURFACES; i++) {
		com->child[i] =
			wl_compositor_create_surface(client->wl_compositor);
		com->sub[i] =
			wl_subcompositor_get_subsurface(com->subco,
							com->child[i],
							com->parent);
	}
}

TEST(test_subsurface_basic_protocol)
{
	struct client *client;
	struct compound_surface com1;
	struct compound_surface com2;

107
	client = create_client_and_test_surface(100, 50, 123, 77);
108 109 110 111 112 113 114 115 116 117 118 119 120 121
	assert(client);

	populate_compound_surface(&com1, client);
	populate_compound_surface(&com2, client);

	client_roundtrip(client);
}

TEST(test_subsurface_position_protocol)
{
	struct client *client;
	struct compound_surface com;
	int i;

122
	client = create_client_and_test_surface(100, 50, 123, 77);
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
	assert(client);

	populate_compound_surface(&com, client);
	for (i = 0; i < NUM_SUBSURFACES; i++)
		wl_subsurface_set_position(com.sub[i],
					   (i + 2) * 20, (i + 2) * 10);

	client_roundtrip(client);
}

TEST(test_subsurface_placement_protocol)
{
	struct client *client;
	struct compound_surface com;

138
	client = create_client_and_test_surface(100, 50, 123, 77);
139 140 141 142 143 144 145 146 147 148 149 150
	assert(client);

	populate_compound_surface(&com, client);

	wl_subsurface_place_above(com.sub[0], com.child[1]);
	wl_subsurface_place_above(com.sub[1], com.parent);
	wl_subsurface_place_below(com.sub[2], com.child[0]);
	wl_subsurface_place_below(com.sub[1], com.parent);

	client_roundtrip(client);
}

151
TEST(test_subsurface_paradox)
152 153 154 155 156
{
	struct client *client;
	struct wl_surface *parent;
	struct wl_subcompositor *subco;

157
	client = create_client_and_test_surface(100, 50, 123, 77);
158 159 160 161 162 163 164 165
	assert(client);

	subco = get_subcompositor(client);
	parent = wl_compositor_create_surface(client->wl_compositor);

	/* surface is its own parent */
	wl_subcompositor_get_subsurface(subco, parent, parent);

166 167
	expect_protocol_error(client, &wl_subcompositor_interface,
			      WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE);
168 169
}

170
TEST(test_subsurface_identical_link)
171 172 173 174
{
	struct client *client;
	struct compound_surface com;

175
	client = create_client_and_test_surface(100, 50, 123, 77);
176 177 178 179 180 181 182
	assert(client);

	populate_compound_surface(&com, client);

	/* surface is already a subsurface */
	wl_subcompositor_get_subsurface(com.subco, com.child[0], com.parent);

183 184
	expect_protocol_error(client, &wl_subcompositor_interface,
			      WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE);
185 186
}

187
TEST(test_subsurface_change_link)
188 189 190 191 192
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *stranger;

193
	client = create_client_and_test_surface(100, 50, 123, 77);
194 195 196 197 198 199 200 201
	assert(client);

	stranger = wl_compositor_create_surface(client->wl_compositor);
	populate_compound_surface(&com, client);

	/* surface is already a subsurface */
	wl_subcompositor_get_subsurface(com.subco, com.child[0], stranger);

202 203
	expect_protocol_error(client, &wl_subcompositor_interface,
			      WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE);
204 205 206 207 208 209 210 211
}

TEST(test_subsurface_nesting)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *stranger;

212
	client = create_client_and_test_surface(100, 50, 123, 77);
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
	assert(client);

	stranger = wl_compositor_create_surface(client->wl_compositor);
	populate_compound_surface(&com, client);

	/* parent is a sub-surface */
	wl_subcompositor_get_subsurface(com.subco, stranger, com.child[0]);

	client_roundtrip(client);
}

TEST(test_subsurface_nesting_parent)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *stranger;

230
	client = create_client_and_test_surface(100, 50, 123, 77);
231 232 233 234 235 236 237 238 239 240 241
	assert(client);

	stranger = wl_compositor_create_surface(client->wl_compositor);
	populate_compound_surface(&com, client);

	/* surface is already a parent */
	wl_subcompositor_get_subsurface(com.subco, com.parent, stranger);

	client_roundtrip(client);
}

242
TEST(test_subsurface_loop_paradox)
243 244 245 246 247
{
	struct client *client;
	struct wl_surface *surface[3];
	struct wl_subcompositor *subco;

248
	client = create_client_and_test_surface(100, 50, 123, 77);
249 250 251 252 253 254 255 256 257 258 259 260
	assert(client);

	subco = get_subcompositor(client);
	surface[0] = wl_compositor_create_surface(client->wl_compositor);
	surface[1] = wl_compositor_create_surface(client->wl_compositor);
	surface[2] = wl_compositor_create_surface(client->wl_compositor);

	/* create a nesting loop */
	wl_subcompositor_get_subsurface(subco, surface[1], surface[0]);
	wl_subcompositor_get_subsurface(subco, surface[2], surface[1]);
	wl_subcompositor_get_subsurface(subco, surface[0], surface[2]);

261 262
	expect_protocol_error(client, &wl_subcompositor_interface,
			      WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE);
263 264
}

265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
TEST(test_subsurface_place_above_nested_parent)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *grandchild;
	struct wl_subcompositor *subco;
	struct wl_subsurface *sub;

	client = create_client_and_test_surface(100, 50, 123, 77);
	assert(client);

	populate_compound_surface(&com, client);

	subco = get_subcompositor(client);
	grandchild = wl_compositor_create_surface(client->wl_compositor);
	sub = wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]);

	wl_subsurface_place_above(sub, com.child[0]);

	client_roundtrip(client);
}

287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
TEST(test_subsurface_place_above_grandparent)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *grandchild;
	struct wl_subsurface *sub;
	struct wl_subcompositor *subco;

	client = create_client_and_test_surface(100, 50, 123, 77);
	assert(client);

	populate_compound_surface(&com, client);

	subco = get_subcompositor(client);
	grandchild = wl_compositor_create_surface(client->wl_compositor);
	sub = wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]);

	/* can't place a subsurface above its grandparent */
	wl_subsurface_place_above(sub, com.parent);

	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
}

TEST(test_subsurface_place_above_great_aunt)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *grandchild;
	struct wl_subsurface *sub;
	struct wl_subcompositor *subco;

	client = create_client_and_test_surface(100, 50, 123, 77);
	assert(client);

	populate_compound_surface(&com, client);

	subco = get_subcompositor(client);
	grandchild = wl_compositor_create_surface(client->wl_compositor);
	sub = wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]);

	/* can't place a subsurface above its parents' siblings */
	wl_subsurface_place_above(sub, com.child[1]);

	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
}

TEST(test_subsurface_place_above_child)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *grandchild;
	struct wl_subcompositor *subco;

	client = create_client_and_test_surface(100, 50, 123, 77);
	assert(client);

	populate_compound_surface(&com, client);

	subco = get_subcompositor(client);
	grandchild = wl_compositor_create_surface(client->wl_compositor);
	wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]);

	/* can't place a subsurface above its own child subsurface */
	wl_subsurface_place_above(com.sub[0], grandchild);

	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
}

358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
TEST(test_subsurface_place_below_nested_parent)
{
	struct client *client;
	struct compound_surface com;
	struct wl_subcompositor *subco;
	struct wl_surface *grandchild;
	struct wl_subsurface *sub;

	client = create_client_and_test_surface(100, 50, 123, 77);
	assert(client);

	populate_compound_surface(&com, client);

	subco = get_subcompositor(client);
	grandchild = wl_compositor_create_surface(client->wl_compositor);
	sub = wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]);

	wl_subsurface_place_below(sub, com.child[0]);

	client_roundtrip(client);
}

380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
TEST(test_subsurface_place_below_grandparent)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *grandchild;
	struct wl_subsurface *sub;
	struct wl_subcompositor *subco;

	client = create_client_and_test_surface(100, 50, 123, 77);
	assert(client);

	populate_compound_surface(&com, client);

	subco = get_subcompositor(client);
	grandchild = wl_compositor_create_surface(client->wl_compositor);
	sub = wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]);

	/* can't place a subsurface below its grandparent */
	wl_subsurface_place_below(sub, com.parent);

	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
}

TEST(test_subsurface_place_below_great_aunt)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *grandchild;
	struct wl_subsurface *sub;
	struct wl_subcompositor *subco;

	client = create_client_and_test_surface(100, 50, 123, 77);
	assert(client);

	populate_compound_surface(&com, client);

	subco = get_subcompositor(client);
	grandchild = wl_compositor_create_surface(client->wl_compositor);
	sub = wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]);

	/* can't place a subsurface below its parents' siblings */
	wl_subsurface_place_below(sub, com.child[1]);

	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
}

TEST(test_subsurface_place_below_child)
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *grandchild;
	struct wl_subcompositor *subco;

	client = create_client_and_test_surface(100, 50, 123, 77);
	assert(client);

	populate_compound_surface(&com, client);

	subco = get_subcompositor(client);
	grandchild = wl_compositor_create_surface(client->wl_compositor);
	wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]);

	/* can't place a subsurface below its own child subsurface */
	wl_subsurface_place_below(com.sub[0], grandchild);

	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
}

451
TEST(test_subsurface_place_above_stranger)
452 453 454 455 456
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *stranger;

457
	client = create_client_and_test_surface(100, 50, 123, 77);
458 459 460 461 462 463 464 465
	assert(client);

	stranger = wl_compositor_create_surface(client->wl_compositor);
	populate_compound_surface(&com, client);

	/* bad sibling */
	wl_subsurface_place_above(com.sub[0], stranger);

466 467
	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
468 469
}

470
TEST(test_subsurface_place_below_stranger)
471 472 473 474 475
{
	struct client *client;
	struct compound_surface com;
	struct wl_surface *stranger;

476
	client = create_client_and_test_surface(100, 50, 123, 77);
477 478 479 480 481 482 483 484
	assert(client);

	stranger = wl_compositor_create_surface(client->wl_compositor);
	populate_compound_surface(&com, client);

	/* bad sibling */
	wl_subsurface_place_below(com.sub[0], stranger);

485 486
	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
487 488
}

489
TEST(test_subsurface_place_above_foreign)
490 491 492 493 494
{
	struct client *client;
	struct compound_surface com1;
	struct compound_surface com2;

495
	client = create_client_and_test_surface(100, 50, 123, 77);
496 497 498 499 500 501 502 503
	assert(client);

	populate_compound_surface(&com1, client);
	populate_compound_surface(&com2, client);

	/* bad sibling */
	wl_subsurface_place_above(com1.sub[0], com2.child[0]);

504 505
	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
506 507
}

508
TEST(test_subsurface_place_below_foreign)
509 510 511 512 513
{
	struct client *client;
	struct compound_surface com1;
	struct compound_surface com2;

514
	client = create_client_and_test_surface(100, 50, 123, 77);
515 516 517 518 519 520 521 522
	assert(client);

	populate_compound_surface(&com1, client);
	populate_compound_surface(&com2, client);

	/* bad sibling */
	wl_subsurface_place_below(com1.sub[0], com2.child[0]);

523 524
	expect_protocol_error(client, &wl_subsurface_interface,
			      WL_SUBSURFACE_ERROR_BAD_SURFACE);
525 526 527 528 529 530 531
}

TEST(test_subsurface_destroy_protocol)
{
	struct client *client;
	struct compound_surface com;

532
	client = create_client_and_test_surface(100, 50, 123, 77);
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
	assert(client);

	populate_compound_surface(&com, client);

	/* not needed anymore */
	wl_subcompositor_destroy(com.subco);

	/* detach child from parent */
	wl_subsurface_destroy(com.sub[0]);

	/* destroy: child, parent */
	wl_surface_destroy(com.child[1]);
	wl_surface_destroy(com.parent);

	/* destroy: parent, child */
	wl_surface_destroy(com.child[2]);

	/* destroy: sub, child */
	wl_surface_destroy(com.child[0]);

	/* 2x destroy: child, sub */
	wl_subsurface_destroy(com.sub[2]);
	wl_subsurface_destroy(com.sub[1]);

	client_roundtrip(client);
}
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593

static void
create_subsurface_tree(struct client *client, struct wl_surface **surfs,
		       struct wl_subsurface **subs, int n)
{
	struct wl_subcompositor *subco;
	int i;

	subco = get_subcompositor(client);

	for (i = 0; i < n; i++)
		surfs[i] = wl_compositor_create_surface(client->wl_compositor);

	/*
	 * The tree of sub-surfaces:
	 *                            0
	 *                           / \
	 *                          1   2 - 10
	 *                         / \  |\
	 *                        3   5 9 6
	 *                       /       / \
	 *                      4       7   8
	 * Surface 0 has no wl_subsurface, others do.
	 */

	switch (n) {
	default:
		assert(0);
		break;

#define SUB_LINK(s,p) \
	subs[s] = wl_subcompositor_get_subsurface(subco, surfs[s], surfs[p])

	case 11:
		SUB_LINK(10, 2);
594
		/* fallthrough */
595 596
	case 10:
		SUB_LINK(9, 2);
597
		/* fallthrough */
598 599
	case 9:
		SUB_LINK(8, 6);
600
		/* fallthrough */
601 602
	case 8:
		SUB_LINK(7, 6);
603
		/* fallthrough */
604 605
	case 7:
		SUB_LINK(6, 2);
606
		/* fallthrough */
607 608
	case 6:
		SUB_LINK(5, 1);
609
		/* fallthrough */
610 611
	case 5:
		SUB_LINK(4, 3);
612
		/* fallthrough */
613 614
	case 4:
		SUB_LINK(3, 1);
615
		/* fallthrough */
616 617
	case 3:
		SUB_LINK(2, 0);
618
		/* fallthrough */
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
	case 2:
		SUB_LINK(1, 0);

#undef SUB_LINK
	};
}

static void
destroy_subsurface_tree(struct wl_surface **surfs,
			struct wl_subsurface **subs, int n)
{
	int i;

	for (i = n; i-- > 0; ) {
		if (surfs[i])
			wl_surface_destroy(surfs[i]);

		if (subs[i])
			wl_subsurface_destroy(subs[i]);
	}
}

static int
has_dupe(int *cnt, int n)
{
	int i;

	for (i = 0; i < n; i++)
		if (cnt[i] == cnt[n])
			return 1;

	return 0;
}

/* Note: number of permutations to test is: set_size! / (set_size - NSTEPS)!
 */
#define NSTEPS 3

struct permu_state {
	int set_size;
	int cnt[NSTEPS];
};

static void
permu_init(struct permu_state *s, int set_size)
{
	int i;

	s->set_size = set_size;
	for (i = 0; i < NSTEPS; i++)
		s->cnt[i] = 0;
}

static int
permu_next(struct permu_state *s)
{
	int k;

	s->cnt[NSTEPS - 1]++;

	while (1) {
		if (s->cnt[0] >= s->set_size) {
			return -1;
		}

		for (k = 1; k < NSTEPS; k++) {
			if (s->cnt[k] >= s->set_size) {
				s->cnt[k - 1]++;
				s->cnt[k] = 0;
				break;
			}

			if (has_dupe(s->cnt, k)) {
				s->cnt[k]++;
				break;
			}
		}

		if (k == NSTEPS)
			return 0;
	}
}

static void
destroy_permu_object(struct wl_surface **surfs,
		     struct wl_subsurface **subs, int i)
{
	int h = (i + 1) / 2;

	if (i & 1) {
709
		testlog(" [sub  %2d]", h);
710 711 712
		wl_subsurface_destroy(subs[h]);
		subs[h] = NULL;
	} else {
713
		testlog(" [surf %2d]", h);
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739
		wl_surface_destroy(surfs[h]);
		surfs[h] = NULL;
	}
}

TEST(test_subsurface_destroy_permutations)
{
	/*
	 * Test wl_surface and wl_subsurface destruction orders in a
	 * complex tree of sub-surfaces.
	 *
	 * In the tree of sub-surfaces, go through every possible
	 * permutation of destroying all wl_surface and wl_subsurface
	 * objects. Execpt, to limit running time to a reasonable level,
	 * execute only the first NSTEPS destructions from each
	 * permutation, and ignore identical cases.
	 */

	const int test_size = 11;
	struct client *client;
	struct wl_surface *surfs[test_size];
	struct wl_subsurface *subs[test_size];
	struct permu_state per;
	int counter = 0;
	int i;

740
	client = create_client_and_test_surface(100, 50, 123, 77);
741 742 743 744 745 746 747 748 749 750
	assert(client);

	permu_init(&per, test_size * 2 - 1);
	while (permu_next(&per) != -1) {
		/* for each permutation of NSTEPS out of test_size */
		memset(surfs, 0, sizeof surfs);
		memset(subs, 0, sizeof subs);

		create_subsurface_tree(client, surfs, subs, test_size);

751
		testlog("permu");
752 753

		for (i = 0; i < NSTEPS; i++)
754
			testlog(" %2d", per.cnt[i]);
755 756 757 758

		for (i = 0; i < NSTEPS; i++)
			destroy_permu_object(surfs, subs, per.cnt[i]);

759
		testlog("\n");
760 761 762 763 764 765 766
		client_roundtrip(client);

		destroy_subsurface_tree(surfs, subs, test_size);
		counter++;
	}

	client_roundtrip(client);
767
	testlog("tried %d destroy permutations\n", counter);
768
}