tests: rename client_create to create_client_and_test_surface

A more descriptive name to not be confused with create_client().

v2: Rebased: fix also devices-test.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
This commit is contained in:
Pekka Paalanen 2015-03-26 12:56:10 +02:00
parent 1ffd4615e8
commit 4ac06ff97e
12 changed files with 41 additions and 41 deletions

View File

@ -64,7 +64,7 @@ TEST(test_truncated_shm_file)
struct wl_surface *surface;
int frame;
client = client_create(46, 76, 111, 134);
client = create_client_and_test_surface(46, 76, 111, 134);
assert(client);
surface = client->surface->wl_surface;

View File

@ -124,7 +124,7 @@ TEST(test_buffer_count)
uint32_t buffer_count;
int i;
test_data.client = client_create(10, 10, 10, 10);
test_data.client = create_client_and_test_surface(10, 10, 10, 10);
if (!test_data.client->has_wl_drm)
skip("compositor has not bound its display to EGL\n");

View File

@ -31,7 +31,7 @@ TEST(simple_button_test)
struct client *client;
struct pointer *pointer;
client = client_create(100, 100, 100, 100);
client = create_client_and_test_surface(100, 100, 100, 100);
assert(client);
pointer = client->input->pointer;

View File

@ -41,7 +41,7 @@
* some devices are removed */
TEST(seat_capabilities_test)
{
struct client *cl = client_create(100, 100, 100, 100);
struct client *cl = create_client_and_test_surface(100, 100, 100, 100);
assert(cl->input->caps == WL_SEAT_CAPABILITY_ALL);
assert(cl->input->pointer);
@ -97,7 +97,7 @@ TEST(seat_capabilities_test)
TEST(multiple_device_add_and_remove)
{
int i;
struct client *cl = client_create(100, 100, 100, 100);
struct client *cl = create_client_and_test_surface(100, 100, 100, 100);
/* add device a lot of times */
for (i = 0; i < COUNT; ++i) {
@ -133,7 +133,7 @@ TEST(multiple_device_add_and_remove)
TEST(device_release_before_destroy)
{
struct client *cl = client_create(100, 100, 100, 100);
struct client *cl = create_client_and_test_surface(100, 100, 100, 100);
/* we can release pointer when we won't be using it anymore.
* Do it and see what happens if the device is destroyed
@ -188,7 +188,7 @@ TEST(device_release_before_destroy_multiple)
/* normal work-flow test */
TEST(device_release_after_destroy)
{
struct client *cl = client_create(100, 100, 100, 100);
struct client *cl = create_client_and_test_surface(100, 100, 100, 100);
weston_test_device_release(cl->test->weston_test, "pointer");
wl_pointer_release(cl->input->pointer->wl_pointer);
@ -240,7 +240,7 @@ TEST(device_release_after_destroy_multiple)
* suffer from this bug atm, but it is worth of testing. */
TEST(get_device_after_destroy)
{
struct client *cl = client_create(100, 100, 100, 100);
struct client *cl = create_client_and_test_surface(100, 100, 100, 100);
struct wl_pointer *wl_pointer;
struct wl_keyboard *wl_keyboard;
struct wl_touch *wl_touch;

View File

@ -69,7 +69,7 @@ TEST(test_pointer_top_left)
struct client *client;
int x, y;
client = client_create(46, 76, 111, 134);
client = create_client_and_test_surface(46, 76, 111, 134);
assert(client);
/* move pointer outside top left */
@ -94,7 +94,7 @@ TEST(test_pointer_bottom_left)
struct client *client;
int x, y;
client = client_create(99, 100, 100, 98);
client = create_client_and_test_surface(99, 100, 100, 98);
assert(client);
/* move pointer outside bottom left */
@ -119,7 +119,7 @@ TEST(test_pointer_top_right)
struct client *client;
int x, y;
client = client_create(48, 100, 67, 100);
client = create_client_and_test_surface(48, 100, 67, 100);
assert(client);
/* move pointer outside top right */
@ -144,7 +144,7 @@ TEST(test_pointer_bottom_right)
struct client *client;
int x, y;
client = client_create(100, 123, 100, 69);
client = create_client_and_test_surface(100, 123, 100, 69);
assert(client);
/* move pointer outside bottom right */
@ -169,7 +169,7 @@ TEST(test_pointer_top_center)
struct client *client;
int x, y;
client = client_create(100, 201, 100, 50);
client = create_client_and_test_surface(100, 201, 100, 50);
assert(client);
/* move pointer outside top center */
@ -194,7 +194,7 @@ TEST(test_pointer_bottom_center)
struct client *client;
int x, y;
client = client_create(100, 45, 67, 100);
client = create_client_and_test_surface(100, 45, 67, 100);
assert(client);
/* move pointer outside bottom center */
@ -219,7 +219,7 @@ TEST(test_pointer_left_center)
struct client *client;
int x, y;
client = client_create(167, 45, 78, 100);
client = create_client_and_test_surface(167, 45, 78, 100);
assert(client);
/* move pointer outside left center */
@ -244,7 +244,7 @@ TEST(test_pointer_right_center)
struct client *client;
int x, y;
client = client_create(110, 37, 100, 46);
client = create_client_and_test_surface(110, 37, 100, 46);
assert(client);
/* move pointer outside right center */
@ -268,7 +268,7 @@ TEST(test_pointer_surface_move)
{
struct client *client;
client = client_create(100, 100, 100, 100);
client = create_client_and_test_surface(100, 100, 100, 100);
assert(client);
/* move pointer outside of client */
@ -310,7 +310,7 @@ TEST(test_surface_output)
struct client *client;
int x, y;
client = client_create(100, 100, 100, 100);
client = create_client_and_test_surface(100, 100, 100, 100);
assert(client);
assert(output_contains_client(client));
@ -375,7 +375,7 @@ TEST(buffer_release)
int buf3_released = 0;
int frame;
client = client_create(100, 100, 100, 100);
client = create_client_and_test_surface(100, 100, 100, 100);
assert(client);
surface = client->surface->wl_surface;

View File

@ -32,7 +32,7 @@ TEST(simple_keyboard_test)
uint32_t expect_key = 0;
uint32_t expect_state = 0;
client = client_create(10, 10, 1, 1);
client = create_client_and_test_surface(10, 10, 1, 1);
assert(client);
keyboard = client->input->keyboard;

View File

@ -217,7 +217,7 @@ TEST(test_presentation_feedback_simple)
struct client *client;
struct feedback *fb;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
wl_surface_attach(client->surface->wl_surface,

View File

@ -91,7 +91,7 @@ TEST(test_role_conflict_sub_wlshell)
struct wl_shell *shell;
struct wl_shell_surface *shsurf;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
subco = get_subcompositor(client);
@ -119,7 +119,7 @@ TEST(test_role_conflict_wlshell_sub)
struct wl_shell *shell;
struct wl_shell_surface *shsurf;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
subco = get_subcompositor(client);

View File

@ -89,7 +89,7 @@ TEST(test_subsurface_basic_protocol)
struct compound_surface com1;
struct compound_surface com2;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
populate_compound_surface(&com1, client);
@ -104,7 +104,7 @@ TEST(test_subsurface_position_protocol)
struct compound_surface com;
int i;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
populate_compound_surface(&com, client);
@ -120,7 +120,7 @@ TEST(test_subsurface_placement_protocol)
struct client *client;
struct compound_surface com;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
populate_compound_surface(&com, client);
@ -139,7 +139,7 @@ TEST(test_subsurface_paradox)
struct wl_surface *parent;
struct wl_subcompositor *subco;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
subco = get_subcompositor(client);
@ -157,7 +157,7 @@ TEST(test_subsurface_identical_link)
struct client *client;
struct compound_surface com;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
populate_compound_surface(&com, client);
@ -175,7 +175,7 @@ TEST(test_subsurface_change_link)
struct compound_surface com;
struct wl_surface *stranger;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
stranger = wl_compositor_create_surface(client->wl_compositor);
@ -194,7 +194,7 @@ TEST(test_subsurface_nesting)
struct compound_surface com;
struct wl_surface *stranger;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
stranger = wl_compositor_create_surface(client->wl_compositor);
@ -212,7 +212,7 @@ TEST(test_subsurface_nesting_parent)
struct compound_surface com;
struct wl_surface *stranger;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
stranger = wl_compositor_create_surface(client->wl_compositor);
@ -230,7 +230,7 @@ TEST(test_subsurface_loop_paradox)
struct wl_surface *surface[3];
struct wl_subcompositor *subco;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
subco = get_subcompositor(client);
@ -253,7 +253,7 @@ TEST(test_subsurface_place_above_stranger)
struct compound_surface com;
struct wl_surface *stranger;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
stranger = wl_compositor_create_surface(client->wl_compositor);
@ -272,7 +272,7 @@ TEST(test_subsurface_place_below_stranger)
struct compound_surface com;
struct wl_surface *stranger;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
stranger = wl_compositor_create_surface(client->wl_compositor);
@ -291,7 +291,7 @@ TEST(test_subsurface_place_above_foreign)
struct compound_surface com1;
struct compound_surface com2;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
populate_compound_surface(&com1, client);
@ -310,7 +310,7 @@ TEST(test_subsurface_place_below_foreign)
struct compound_surface com1;
struct compound_surface com2;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
populate_compound_surface(&com1, client);
@ -328,7 +328,7 @@ TEST(test_subsurface_destroy_protocol)
struct client *client;
struct compound_surface com;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
populate_compound_surface(&com, client);
@ -527,7 +527,7 @@ TEST(test_subsurface_destroy_permutations)
int counter = 0;
int i;
client = client_create(100, 50, 123, 77);
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
permu_init(&per, test_size * 2 - 1);

View File

@ -169,7 +169,7 @@ TEST(text_test)
struct wl_text_input *text_input;
struct text_input_state state;
client = client_create(100, 100, 100, 100);
client = create_client_and_test_surface(100, 100, 100, 100);
assert(client);
factory = NULL;

View File

@ -782,7 +782,7 @@ create_client(void)
}
struct client *
client_create(int x, int y, int width, int height)
create_client_and_test_surface(int x, int y, int width, int height)
{
struct client *client;
struct surface *surface;

View File

@ -147,7 +147,7 @@ struct client *
create_client(void);
struct client *
client_create(int x, int y, int width, int height);
create_client_and_test_surface(int x, int y, int width, int height);
struct wl_buffer *
create_shm_buffer(struct client *client, int width, int height, void **pixels);