[PATCH xorg-gtest] xserver: Pass given timeout value

Chase Douglas chase.douglas at canonical.com
Thu Jul 26 15:42:12 PDT 2012


On 07/26/2012 03:40 PM, Peter Hutterer wrote:
> From: Olivier Fourdan <ofourdan at redhat.com>
>
> WaitForDevice() can take an optional timeout parameter
> but that timeout should be passed down to WaitForEventOfType()
> and in turn to WaitForEvent()
>
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>   src/xserver.cpp |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/xserver.cpp b/src/xserver.cpp
> index 6449954..bac89ea 100644
> --- a/src/xserver.cpp
> +++ b/src/xserver.cpp
> @@ -125,7 +125,7 @@ bool xorg::testing::XServer::WaitForEvent(::Display *display, time_t timeout)
>   bool xorg::testing::XServer::WaitForEventOfType(::Display *display, int type, int extension,
>                                                   int evtype, time_t timeout)
>   {
> -    while (WaitForEvent(display)) {
> +    while (WaitForEvent(display), timeout) {
>           XEvent event;
>           if (!XPeekEvent(display, &event))
>               throw std::runtime_error("Failed to peek X event");
> @@ -169,7 +169,7 @@ bool xorg::testing::XServer::WaitForDevice(::Display *display, const std::string
>           throw std::runtime_error("Failed to query XInput extension");
>
>       while (WaitForEventOfType(display, GenericEvent, opcode,
> -                              XI_HierarchyChanged)) {
> +                              XI_HierarchyChanged, timeout)) {
>           XEvent event;
>           if (XNextEvent(display, &event) != Success)
>               throw std::runtime_error("Failed to get X event");

Ahh, nuts... Right after I released it...

Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

I'll let it sit for a bit before releasing a point release in case we 
find any other nuggets.

Thanks!


More information about the xorg-devel mailing list