Re: [PATCH 3/4] queue-test: Add another assertion

2014-10-08 Thread Marek Chalupa
Hi,

yes, this is normal in tests - the fact is that without assert the tests
won't compile anyway, as Otto wrote, so the asserts are always present
there.

This patch is:
Reviewed-by: Marek Chalupa mchqwe...@gmail.com

On 29 September 2014 08:09, Karsten Otto karsten.o...@posteo.de wrote:

 Indeed, I just followed the lead of the other tests, which use assert
 exactly like this. I think what makes it OK are these lines in
 test-runner.h:

 #ifdef NDEBUG
 #error Tests must not be built with NDEBUG defined, they rely on
 assert().
 #endif

 Cheers, Karsten

 Am 29.09.2014 um 05:48 schrieb Dima Ryazanov d...@gmail.com:

  I've brought this up once, but looks like it's acceptable in the test
 suite since it already relies on asserts:
 
 http://lists.freedesktop.org/archives/wayland-devel/2013-February/007454.html
 
  On Sep 28, 2014 6:57 PM, Bill Spitzak spit...@gmail.com wrote:
  On 09/28/2014 11:49 AM, Karsten Otto wrote:
 
  -   wl_display_roundtrip(display);
  +   assert(wl_display_roundtrip(display) != -1);
 
  You can't put code that you require to run in an assert.
 
  ___
  wayland-devel mailing list
  wayland-devel@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/wayland-devel
  ___
  wayland-devel mailing list
  wayland-devel@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/wayland-devel

 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH 3/4] queue-test: Add another assertion

2014-09-29 Thread Karsten Otto
Indeed, I just followed the lead of the other tests, which use assert exactly 
like this. I think what makes it OK are these lines in test-runner.h:

#ifdef NDEBUG
#error Tests must not be built with NDEBUG defined, they rely on assert().
#endif

Cheers, Karsten

Am 29.09.2014 um 05:48 schrieb Dima Ryazanov d...@gmail.com:

 I've brought this up once, but looks like it's acceptable in the test suite 
 since it already relies on asserts:
 http://lists.freedesktop.org/archives/wayland-devel/2013-February/007454.html
 
 On Sep 28, 2014 6:57 PM, Bill Spitzak spit...@gmail.com wrote:
 On 09/28/2014 11:49 AM, Karsten Otto wrote:
 
 -   wl_display_roundtrip(display);
 +   assert(wl_display_roundtrip(display) != -1);
 
 You can't put code that you require to run in an assert.
 
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 3/4] queue-test: Add another assertion

2014-09-28 Thread Karsten Otto
From: Philip Withnall phi...@tecnocode.co.uk

Ensure that the round trip succeeds.

[KAO: adjusted to current test framework]

Signed-off-by: Philip Withnall phi...@tecnocode.co.uk
---
 tests/queue-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/queue-test.c b/tests/queue-test.c
index 96f2100..6e2e932 100644
--- a/tests/queue-test.c
+++ b/tests/queue-test.c
@@ -66,7 +66,7 @@ client_test_proxy_destroy(void)
assert(registry != NULL);
wl_registry_add_listener(registry, registry_listener,
 counter);
-   wl_display_roundtrip(display);
+   assert(wl_display_roundtrip(display) != -1);
 
assert(counter == 1);
 
-- 
1.9.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH 3/4] queue-test: Add another assertion

2014-09-28 Thread Bill Spitzak

On 09/28/2014 11:49 AM, Karsten Otto wrote:


-   wl_display_roundtrip(display);
+   assert(wl_display_roundtrip(display) != -1);


You can't put code that you require to run in an assert.

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH 3/4] queue-test: Add another assertion

2014-09-28 Thread Dima Ryazanov
I've brought this up once, but looks like it's acceptable in the test suite
since it already relies on asserts:
http://lists.freedesktop.org/archives/wayland-devel/2013-February/007454.html
On Sep 28, 2014 6:57 PM, Bill Spitzak spit...@gmail.com wrote:

 On 09/28/2014 11:49 AM, Karsten Otto wrote:

  -   wl_display_roundtrip(display);
 +   assert(wl_display_roundtrip(display) != -1);


 You can't put code that you require to run in an assert.

 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel