Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] unit: Reuse define_test() macro for /TP/SERVER/BRW/* tests
@ 2013-01-09 15:19 Anderson Lizardo
  2013-01-09 15:19 ` [PATCH BlueZ 2/3] unit: Rename x_pdu() macro on SDP test program Anderson Lizardo
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Anderson Lizardo @ 2013-01-09 15:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo

This is made possible by adding the mtu parameter, given
/TP/SERVER/BRW/* tests use MTU of 672.
---
 unit/test-sdp.c |   24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/unit/test-sdp.c b/unit/test-sdp.c
index 315a5cd..e9cbcdf 100644
--- a/unit/test-sdp.c
+++ b/unit/test-sdp.c
@@ -68,34 +68,22 @@ struct test_data {
 		.cont_len = cont,				\
 	}
 
-#define define_test(name, args...) \
+#define define_test(name, _mtu, args...) \
 	do {								\
 		const struct sdp_pdu pdus[] = {				\
 			args, { }, { }					\
 		};							\
 		static struct test_data data;				\
-		data.mtu = 48;						\
+		data.mtu = _mtu;					\
 		data.pdu_list = g_malloc(sizeof(pdus));			\
 		memcpy(data.pdu_list, pdus, sizeof(pdus));		\
 		g_test_add_data_func(name, &data, test_sdp);		\
 	} while (0)
 
-#define define_ss(name, args...) define_test("/TP/SERVER/SS/" name, args)
-#define define_sa(name, args...) define_test("/TP/SERVER/SA/" name, args)
-#define define_ssa(name, args...) define_test("/TP/SERVER/SSA/" name, args)
-
-#define define_brw(name, args...) \
-	do {								\
-		const struct sdp_pdu pdus[] = {				\
-			args, { }, { }					\
-		};							\
-		static struct test_data data;				\
-		data.mtu = 672;						\
-		data.pdu_list = g_malloc(sizeof(pdus));			\
-		memcpy(data.pdu_list, pdus, sizeof(pdus));		\
-		g_test_add_data_func("/TP/SERVER/BRW/" name,		\
-						&data, test_sdp);	\
-	} while (0)
+#define define_ss(name, args...) define_test("/TP/SERVER/SS/" name, 48, args)
+#define define_sa(name, args...) define_test("/TP/SERVER/SA/" name, 48, args)
+#define define_ssa(name, args...) define_test("/TP/SERVER/SSA/" name, 48, args)
+#define define_brw(name, args...) define_test("/TP/SERVER/BRW/" name, 672, args)
 
 struct context {
 	GMainLoop *main_loop;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-09 20:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09 15:19 [PATCH BlueZ 1/3] unit: Reuse define_test() macro for /TP/SERVER/BRW/* tests Anderson Lizardo
2013-01-09 15:19 ` [PATCH BlueZ 2/3] unit: Rename x_pdu() macro on SDP test program Anderson Lizardo
2013-01-09 19:10   ` Marcel Holtmann
2013-01-09 15:19 ` [PATCH v2 BlueZ 3/3] unit: Implement tests for sdp_extract_attr() Anderson Lizardo
2013-01-09 19:50   ` Marcel Holtmann
2013-01-09 20:13     ` Anderson Lizardo
2013-01-09 19:08 ` [PATCH BlueZ 1/3] unit: Reuse define_test() macro for /TP/SERVER/BRW/* tests Marcel Holtmann
2013-01-09 20:06   ` Anderson Lizardo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox