[v1] test/event: fix return value of timer test setup

Message ID 7d28b0e4a5e0eb715eaced93b98af833da34b63b.1620382076.git.sthotton@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v1] test/event: fix return value of timer test setup |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/github-robot success github build: passed
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS

Commit Message

Shijith Thotton May 7, 2021, 10:12 a.m. UTC
  Test case setup should return -ENOTSUP, if it is not supported.

Fixes: 7d761b07fcf6 ("test/event: add unit tests for periodic timer")

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 app/test/test_event_timer_adapter.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Jerin Jacob May 9, 2021, 4:06 p.m. UTC | #1
On Fri, May 7, 2021 at 3:42 PM Shijith Thotton <sthotton@marvell.com> wrote:
>
> Test case setup should return -ENOTSUP, if it is not supported.
>
> Fixes: 7d761b07fcf6 ("test/event: add unit tests for periodic timer")
Cc: stable@dpdk.org


>
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-eventdev/for-main. Thanks.

> ---
>  app/test/test_event_timer_adapter.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_timer_adapter.c
> index c36ab32ac..121c2d93e 100644
> --- a/app/test/test_event_timer_adapter.c
> +++ b/app/test/test_event_timer_adapter.c
> @@ -303,10 +303,8 @@ _timdev_setup(uint64_t max_tmo_ns, uint64_t bkt_tck_ns, uint64_t flags)
>                                 "failed to get adapter capabilities");
>
>         if (flags & RTE_EVENT_TIMER_ADAPTER_F_PERIODIC &&
> -           !(caps & RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC)) {
> -               printf("Adapter does not support periodic timers\n");
> -               return TEST_SKIPPED;
> -       }
> +           !(caps & RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC))
> +               return -ENOTSUP;
>
>         if (!(caps & RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT)) {
>                 timdev = rte_event_timer_adapter_create_ext(&config,
> --
> 2.25.1
>
  

Patch

diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_timer_adapter.c
index c36ab32ac..121c2d93e 100644
--- a/app/test/test_event_timer_adapter.c
+++ b/app/test/test_event_timer_adapter.c
@@ -303,10 +303,8 @@  _timdev_setup(uint64_t max_tmo_ns, uint64_t bkt_tck_ns, uint64_t flags)
 				"failed to get adapter capabilities");
 
 	if (flags & RTE_EVENT_TIMER_ADAPTER_F_PERIODIC &&
-	    !(caps & RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC)) {
-		printf("Adapter does not support periodic timers\n");
-		return TEST_SKIPPED;
-	}
+	    !(caps & RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC))
+		return -ENOTSUP;
 
 	if (!(caps & RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT)) {
 		timdev = rte_event_timer_adapter_create_ext(&config,