All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] unit/avctp: Add connection establishment dummy tests
@ 2014-02-03 12:23 Andrei Emeltchenko
  2014-02-04 11:53 ` Andrei Emeltchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Emeltchenko @ 2014-02-03 12:23 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Add some tests checking that L2CAP connection is established, so they
are basically dummy tests.
---
 unit/test-avctp.c | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/unit/test-avctp.c b/unit/test-avctp.c
index 041e0c0..c0d16a4 100644
--- a/unit/test-avctp.c
+++ b/unit/test-avctp.c
@@ -220,10 +220,8 @@ static struct context *create_context(uint16_t version, gconstpointer data)
 	return context;
 }
 
-static void execute_context(struct context *context)
+static void destroy_context(struct context *context)
 {
-	g_main_loop_run(context->main_loop);
-
 	if (context->source > 0)
 		g_source_remove(context->source);
 
@@ -235,6 +233,13 @@ static void execute_context(struct context *context)
 	g_free(context);
 }
 
+static void execute_context(struct context *context)
+{
+	g_main_loop_run(context->main_loop);
+
+	destroy_context(context);
+}
+
 static void test_client(gconstpointer data)
 {
 	struct context *context = create_context(0x0100, data);
@@ -253,6 +258,13 @@ static void test_server(gconstpointer data)
 	execute_context(context);
 }
 
+static void test_dummy(gconstpointer data)
+{
+	struct context *context = create_context(0x0100, data);
+
+	destroy_context(context);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -260,6 +272,18 @@ int main(int argc, char *argv[])
 	if (g_test_verbose())
 		__btd_log_init("*", 0);
 
+	/* Connection Channel Management tests */
+
+	/*
+	 * Tests are checking that IUT is able to request establishing
+	 * channels, since we already have connection through socketpair
+	 * the tests are dummy.
+	 */
+	define_test("/TP/CCM/BV-01-C", test_dummy, raw_pdu(0x00));
+	define_test("/TP/CCM/BV-02-C", test_dummy, raw_pdu(0x00));
+	define_test("/TP/CCM/BV-03-C", test_dummy, raw_pdu(0x00));
+	define_test("/TP/CCM/BV-04-C", test_dummy, raw_pdu(0x00));
+
 	define_test("/TP/NFR/BV-01-C", test_client,
 				raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x00, 0x00));
 
-- 
1.8.3.2


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

* Re: [PATCH] unit/avctp: Add connection establishment dummy tests
  2014-02-03 12:23 [PATCH] unit/avctp: Add connection establishment dummy tests Andrei Emeltchenko
@ 2014-02-04 11:53 ` Andrei Emeltchenko
  2014-02-04 13:46   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Emeltchenko @ 2014-02-04 11:53 UTC (permalink / raw)
  To: linux-bluetooth

On Mon, Feb 03, 2014 at 02:23:18PM +0200, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

ping

> 
> Add some tests checking that L2CAP connection is established, so they
> are basically dummy tests.
> ---
>  unit/test-avctp.c | 30 +++++++++++++++++++++++++++---
>  1 file changed, 27 insertions(+), 3 deletions(-)
> 
> diff --git a/unit/test-avctp.c b/unit/test-avctp.c
> index 041e0c0..c0d16a4 100644
> --- a/unit/test-avctp.c
> +++ b/unit/test-avctp.c
> @@ -220,10 +220,8 @@ static struct context *create_context(uint16_t version, gconstpointer data)
>  	return context;
>  }
>  
> -static void execute_context(struct context *context)
> +static void destroy_context(struct context *context)
>  {
> -	g_main_loop_run(context->main_loop);
> -
>  	if (context->source > 0)
>  		g_source_remove(context->source);
>  
> @@ -235,6 +233,13 @@ static void execute_context(struct context *context)
>  	g_free(context);
>  }
>  
> +static void execute_context(struct context *context)
> +{
> +	g_main_loop_run(context->main_loop);
> +
> +	destroy_context(context);
> +}
> +
>  static void test_client(gconstpointer data)
>  {
>  	struct context *context = create_context(0x0100, data);
> @@ -253,6 +258,13 @@ static void test_server(gconstpointer data)
>  	execute_context(context);
>  }
>  
> +static void test_dummy(gconstpointer data)
> +{
> +	struct context *context = create_context(0x0100, data);
> +
> +	destroy_context(context);
> +}
> +
>  int main(int argc, char *argv[])
>  {
>  	g_test_init(&argc, &argv, NULL);
> @@ -260,6 +272,18 @@ int main(int argc, char *argv[])
>  	if (g_test_verbose())
>  		__btd_log_init("*", 0);
>  
> +	/* Connection Channel Management tests */
> +
> +	/*
> +	 * Tests are checking that IUT is able to request establishing
> +	 * channels, since we already have connection through socketpair
> +	 * the tests are dummy.
> +	 */
> +	define_test("/TP/CCM/BV-01-C", test_dummy, raw_pdu(0x00));
> +	define_test("/TP/CCM/BV-02-C", test_dummy, raw_pdu(0x00));
> +	define_test("/TP/CCM/BV-03-C", test_dummy, raw_pdu(0x00));
> +	define_test("/TP/CCM/BV-04-C", test_dummy, raw_pdu(0x00));
> +
>  	define_test("/TP/NFR/BV-01-C", test_client,
>  				raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x00, 0x00));
>  
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] unit/avctp: Add connection establishment dummy tests
  2014-02-04 11:53 ` Andrei Emeltchenko
@ 2014-02-04 13:46   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2014-02-04 13:46 UTC (permalink / raw)
  To: Andrei Emeltchenko, linux-bluetooth@vger.kernel.org

Hi Andrei,

On Tue, Feb 4, 2014 at 1:53 PM, Andrei Emeltchenko
<Andrei.Emeltchenko.news@gmail.com> wrote:
> On Mon, Feb 03, 2014 at 02:23:18PM +0200, Andrei Emeltchenko wrote:
>> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> ping
>
>>
>> Add some tests checking that L2CAP connection is established, so they
>> are basically dummy tests.
>> ---
>>  unit/test-avctp.c | 30 +++++++++++++++++++++++++++---
>>  1 file changed, 27 insertions(+), 3 deletions(-)
>>
>> diff --git a/unit/test-avctp.c b/unit/test-avctp.c
>> index 041e0c0..c0d16a4 100644
>> --- a/unit/test-avctp.c
>> +++ b/unit/test-avctp.c
>> @@ -220,10 +220,8 @@ static struct context *create_context(uint16_t version, gconstpointer data)
>>       return context;
>>  }
>>
>> -static void execute_context(struct context *context)
>> +static void destroy_context(struct context *context)
>>  {
>> -     g_main_loop_run(context->main_loop);
>> -
>>       if (context->source > 0)
>>               g_source_remove(context->source);
>>
>> @@ -235,6 +233,13 @@ static void execute_context(struct context *context)
>>       g_free(context);
>>  }
>>
>> +static void execute_context(struct context *context)
>> +{
>> +     g_main_loop_run(context->main_loop);
>> +
>> +     destroy_context(context);
>> +}
>> +
>>  static void test_client(gconstpointer data)
>>  {
>>       struct context *context = create_context(0x0100, data);
>> @@ -253,6 +258,13 @@ static void test_server(gconstpointer data)
>>       execute_context(context);
>>  }
>>
>> +static void test_dummy(gconstpointer data)
>> +{
>> +     struct context *context = create_context(0x0100, data);
>> +
>> +     destroy_context(context);
>> +}
>> +
>>  int main(int argc, char *argv[])
>>  {
>>       g_test_init(&argc, &argv, NULL);
>> @@ -260,6 +272,18 @@ int main(int argc, char *argv[])
>>       if (g_test_verbose())
>>               __btd_log_init("*", 0);
>>
>> +     /* Connection Channel Management tests */
>> +
>> +     /*
>> +      * Tests are checking that IUT is able to request establishing
>> +      * channels, since we already have connection through socketpair
>> +      * the tests are dummy.
>> +      */
>> +     define_test("/TP/CCM/BV-01-C", test_dummy, raw_pdu(0x00));
>> +     define_test("/TP/CCM/BV-02-C", test_dummy, raw_pdu(0x00));
>> +     define_test("/TP/CCM/BV-03-C", test_dummy, raw_pdu(0x00));
>> +     define_test("/TP/CCM/BV-04-C", test_dummy, raw_pdu(0x00));
>> +
>>       define_test("/TP/NFR/BV-01-C", test_client,
>>                               raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x00, 0x00));
>>
>> --
>> 1.8.3.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --

Applied, thanks.


-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2014-02-04 13:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-03 12:23 [PATCH] unit/avctp: Add connection establishment dummy tests Andrei Emeltchenko
2014-02-04 11:53 ` Andrei Emeltchenko
2014-02-04 13:46   ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.