diff mbox

[PATCHv3,1/7] validation: classification: add unit tests for strong type display functions

Message ID 1425855170-4191-1-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit 1a5d4fc76b49fa0b92ab6f91a270fb1229d9c1b4
Headers show

Commit Message

Bill Fischofer March 8, 2015, 10:52 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 test/validation/classification/odp_classification_basic.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Mike Holmes March 9, 2015, 7:19 p.m. UTC | #1
On 8 March 2015 at 18:52, Bill Fischofer <bill.fischofer@linaro.org> wrote:

> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>

For the series

Reviewed-by: Mike Holmes <mike.holmes@linaro.org>



> ---
>  test/validation/classification/odp_classification_basic.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/test/validation/classification/odp_classification_basic.c
> b/test/validation/classification/odp_classification_basic.c
> index ac2fe8e..2d4c2ac 100644
> --- a/test/validation/classification/odp_classification_basic.c
> +++ b/test/validation/classification/odp_classification_basic.c
> @@ -15,6 +15,7 @@ static void classification_create_cos(void)
>         sprintf(name, "ClassOfService");
>         cos = odp_cos_create(name);
>         CU_ASSERT_FATAL(cos != ODP_COS_INVALID);
> +       CU_ASSERT(odp_cos_to_u64(cos) != odp_cos_to_u64(ODP_COS_INVALID));
>         odp_cos_destroy(cos);
>  }
>
> @@ -41,6 +42,7 @@ static void classification_create_pmr_match(void)
>         mask = 0xffff;
>         pmr = odp_pmr_create_match(ODP_PMR_TCP_SPORT, &val, &mask,
> sizeof(val));
>         CU_ASSERT(pmr != ODP_PMR_INVAL);
> +       CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL));
>         odp_pmr_destroy(pmr);
>  }
>
> @@ -54,6 +56,7 @@ static void classification_create_pmr_range(void)
>         pmr = odp_pmr_create_range(ODP_PMR_TCP_SPORT, &val1,
>                                    &val2, sizeof(val1));
>         CU_ASSERT(pmr != ODP_PMR_INVAL);
> +       CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL));
>         odp_pmr_destroy(pmr);
>  }
>
> @@ -132,6 +135,8 @@ static void classification_pmr_match_set_create(void)
>
>         retval = odp_pmr_match_set_create(PMR_SET_NUM, pmr_terms,
> &pmr_set);
>         CU_ASSERT(retval > 0);
> +       CU_ASSERT(odp_pmr_set_to_u64(pmr_set) !=
> +                 odp_pmr_set_to_u64(ODP_PMR_SET_INVAL));
>
>         retval = odp_pmr_match_set_destroy(pmr_set);
>         CU_ASSERT(retval == 0);
> --
> 2.1.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Balasubramanian Manoharan March 10, 2015, 6:23 a.m. UTC | #2
Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

On 10 March 2015 at 00:49, Mike Holmes <mike.holmes@linaro.org> wrote:
>
>
> On 8 March 2015 at 18:52, Bill Fischofer <bill.fischofer@linaro.org> wrote:
>>
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>
>
> For the series
>
> Reviewed-by: Mike Holmes <mike.holmes@linaro.org>
>
>
>>
>> ---
>>  test/validation/classification/odp_classification_basic.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/test/validation/classification/odp_classification_basic.c
>> b/test/validation/classification/odp_classification_basic.c
>> index ac2fe8e..2d4c2ac 100644
>> --- a/test/validation/classification/odp_classification_basic.c
>> +++ b/test/validation/classification/odp_classification_basic.c
>> @@ -15,6 +15,7 @@ static void classification_create_cos(void)
>>         sprintf(name, "ClassOfService");
>>         cos = odp_cos_create(name);
>>         CU_ASSERT_FATAL(cos != ODP_COS_INVALID);
>> +       CU_ASSERT(odp_cos_to_u64(cos) != odp_cos_to_u64(ODP_COS_INVALID));
>>         odp_cos_destroy(cos);
>>  }
>>
>> @@ -41,6 +42,7 @@ static void classification_create_pmr_match(void)
>>         mask = 0xffff;
>>         pmr = odp_pmr_create_match(ODP_PMR_TCP_SPORT, &val, &mask,
>> sizeof(val));
>>         CU_ASSERT(pmr != ODP_PMR_INVAL);
>> +       CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL));
>>         odp_pmr_destroy(pmr);
>>  }
>>
>> @@ -54,6 +56,7 @@ static void classification_create_pmr_range(void)
>>         pmr = odp_pmr_create_range(ODP_PMR_TCP_SPORT, &val1,
>>                                    &val2, sizeof(val1));
>>         CU_ASSERT(pmr != ODP_PMR_INVAL);
>> +       CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL));
>>         odp_pmr_destroy(pmr);
>>  }
>>
>> @@ -132,6 +135,8 @@ static void classification_pmr_match_set_create(void)
>>
>>         retval = odp_pmr_match_set_create(PMR_SET_NUM, pmr_terms,
>> &pmr_set);
>>         CU_ASSERT(retval > 0);
>> +       CU_ASSERT(odp_pmr_set_to_u64(pmr_set) !=
>> +                 odp_pmr_set_to_u64(ODP_PMR_SET_INVAL));
>>
>>         retval = odp_pmr_match_set_destroy(pmr_set);
>>         CU_ASSERT(retval == 0);
>> --
>> 2.1.0
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org │ Open source software for ARM SoCs
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov March 10, 2015, 10:49 a.m. UTC | #3
Merged,
Maxim.


On 03/10/15 09:23, Bala Manoharan wrote:
> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
>
> On 10 March 2015 at 00:49, Mike Holmes <mike.holmes@linaro.org> wrote:
>>
>> On 8 March 2015 at 18:52, Bill Fischofer <bill.fischofer@linaro.org> wrote:
>>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>>
>> For the series
>>
>> Reviewed-by: Mike Holmes <mike.holmes@linaro.org>
>>
>>
>>> ---
>>>   test/validation/classification/odp_classification_basic.c | 5 +++++
>>>   1 file changed, 5 insertions(+)
>>>
>>> diff --git a/test/validation/classification/odp_classification_basic.c
>>> b/test/validation/classification/odp_classification_basic.c
>>> index ac2fe8e..2d4c2ac 100644
>>> --- a/test/validation/classification/odp_classification_basic.c
>>> +++ b/test/validation/classification/odp_classification_basic.c
>>> @@ -15,6 +15,7 @@ static void classification_create_cos(void)
>>>          sprintf(name, "ClassOfService");
>>>          cos = odp_cos_create(name);
>>>          CU_ASSERT_FATAL(cos != ODP_COS_INVALID);
>>> +       CU_ASSERT(odp_cos_to_u64(cos) != odp_cos_to_u64(ODP_COS_INVALID));
>>>          odp_cos_destroy(cos);
>>>   }
>>>
>>> @@ -41,6 +42,7 @@ static void classification_create_pmr_match(void)
>>>          mask = 0xffff;
>>>          pmr = odp_pmr_create_match(ODP_PMR_TCP_SPORT, &val, &mask,
>>> sizeof(val));
>>>          CU_ASSERT(pmr != ODP_PMR_INVAL);
>>> +       CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL));
>>>          odp_pmr_destroy(pmr);
>>>   }
>>>
>>> @@ -54,6 +56,7 @@ static void classification_create_pmr_range(void)
>>>          pmr = odp_pmr_create_range(ODP_PMR_TCP_SPORT, &val1,
>>>                                     &val2, sizeof(val1));
>>>          CU_ASSERT(pmr != ODP_PMR_INVAL);
>>> +       CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL));
>>>          odp_pmr_destroy(pmr);
>>>   }
>>>
>>> @@ -132,6 +135,8 @@ static void classification_pmr_match_set_create(void)
>>>
>>>          retval = odp_pmr_match_set_create(PMR_SET_NUM, pmr_terms,
>>> &pmr_set);
>>>          CU_ASSERT(retval > 0);
>>> +       CU_ASSERT(odp_pmr_set_to_u64(pmr_set) !=
>>> +                 odp_pmr_set_to_u64(ODP_PMR_SET_INVAL));
>>>
>>>          retval = odp_pmr_match_set_destroy(pmr_set);
>>>          CU_ASSERT(retval == 0);
>>> --
>>> 2.1.0
>>>
>>>
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org │ Open source software for ARM SoCs
>>
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/test/validation/classification/odp_classification_basic.c b/test/validation/classification/odp_classification_basic.c
index ac2fe8e..2d4c2ac 100644
--- a/test/validation/classification/odp_classification_basic.c
+++ b/test/validation/classification/odp_classification_basic.c
@@ -15,6 +15,7 @@  static void classification_create_cos(void)
 	sprintf(name, "ClassOfService");
 	cos = odp_cos_create(name);
 	CU_ASSERT_FATAL(cos != ODP_COS_INVALID);
+	CU_ASSERT(odp_cos_to_u64(cos) != odp_cos_to_u64(ODP_COS_INVALID));
 	odp_cos_destroy(cos);
 }
 
@@ -41,6 +42,7 @@  static void classification_create_pmr_match(void)
 	mask = 0xffff;
 	pmr = odp_pmr_create_match(ODP_PMR_TCP_SPORT, &val, &mask, sizeof(val));
 	CU_ASSERT(pmr != ODP_PMR_INVAL);
+	CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL));
 	odp_pmr_destroy(pmr);
 }
 
@@ -54,6 +56,7 @@  static void classification_create_pmr_range(void)
 	pmr = odp_pmr_create_range(ODP_PMR_TCP_SPORT, &val1,
 				   &val2, sizeof(val1));
 	CU_ASSERT(pmr != ODP_PMR_INVAL);
+	CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL));
 	odp_pmr_destroy(pmr);
 }
 
@@ -132,6 +135,8 @@  static void classification_pmr_match_set_create(void)
 
 	retval = odp_pmr_match_set_create(PMR_SET_NUM, pmr_terms, &pmr_set);
 	CU_ASSERT(retval > 0);
+	CU_ASSERT(odp_pmr_set_to_u64(pmr_set) !=
+		  odp_pmr_set_to_u64(ODP_PMR_SET_INVAL));
 
 	retval = odp_pmr_match_set_destroy(pmr_set);
 	CU_ASSERT(retval == 0);