[PATCH v2] event-test: more aggressive event testing
Eoff, Ullysses A
ullysses.a.eoff at intel.com
Fri Sep 28 06:12:25 PDT 2012
>-----Original Message-----
>From: Pekka Paalanen [mailto:ppaalanen at gmail.com]
>Sent: Thursday, September 27, 2012 11:31 PM
>To: Eoff, Ullysses A
>Cc: wayland-devel at lists.freedesktop.org
>Subject: Re: [PATCH v2] event-test: more aggressive event testing
>
>On Tue, 25 Sep 2012 14:13:45 -0700
>"U. Artie Eoff" <ullysses.a.eoff at intel.com> wrote:
>
>> From: "U. Artie Eoff" <ullysses.a.eoff at intel.com>
>>
>> Test surface pointer enter/leave/motion and surface leave/enter
>> events more aggressively.
>>
>> Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
>
>Hi Artie,
>
>since you asked...
>
>> ---
>> tests/event-test.c | 269
>++++++++++++++++++++++++++++++++++++++++++++++++----
>> tests/test-client.c | 60 ++++++++++--
>> tests/test-runner.c | 8 +-
>> 3 files changed, 305 insertions(+), 32 deletions(-)
>>
>> diff --git a/tests/event-test.c b/tests/event-test.c
>> index 2cbfc2d..9572c91 100644
>> --- a/tests/event-test.c
>> +++ b/tests/event-test.c
>> @@ -25,50 +25,280 @@
>> #include <sys/socket.h>
>> #include <assert.h>
>> #include <unistd.h>
>> -
>> #include <string.h>
>>
>> #include "test-runner.h"
>>
>> +struct state {
>> + int px; // pointer x
>> + int py; // pointer y
>> + int sx; // surface x
>> + int sy; // surface y
>> + int sw; // surface width
>> + int sh; // surface height
>> +};
>> +
>> +static size_t state_size = sizeof(struct state);
>> +
>> +struct context {
>> + struct weston_layer *layer;
>> + struct weston_seat *seat;
>> + struct weston_surface *surface;
>> + int pointer_x; // server pointer x
>> + int pointer_y; // server pointer y
>> + size_t index;
>> + struct wl_array states;
>> +};
>> +
>> +static void
>> +resize(struct context *context, int w, int h)
>> +{
>> + // resize the surface if the width or height is different
>> + if (context->surface->geometry.width != w ||
>> + context->surface->geometry.height != h) {
>
>Continuation lines are usually aligned to the opening parenthesis, like
>this:
>
> if (context->surface->geometry.width != w ||
> context->surface->geometry.height != h) {
>
>> +
>> + weston_surface_configure(context->surface,
>> + context->surface->geometry.x,
>> + context->surface->geometry.y,
>> + w, h);
>
>except here it looks like the it would be a too long line, so I'd guess
>this one is ok...
>
>> + weston_surface_update_transform(context->surface);
>> + weston_surface_damage(context->surface);
>> +
>> + fprintf(stderr, "resize surface: %d %d\n",
>> + context->surface->geometry.width,
>> + context->surface->geometry.height);
>
>This one is already good. ;-)
>
>Other than that, comments, and some pretty long lines,
>looks good to me. Some of the too long lines I would probably not
>break, though. Max line length is 80 (I think? I try to keep under 78),
>and tabs are 8-wide.
>
>
>Thanks,
>pq
This is great feedback... Thanks! Fortunately, my editor aligns the continuation
lines automatically as you've described so this makes it easy :)
I'll fix up this patch along with my other patches and resubmit.
U. Artie
More information about the wayland-devel
mailing list