From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DFB2945656; Fri, 19 Jul 2024 19:10:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE75340EF1; Fri, 19 Jul 2024 19:10:04 +0200 (CEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 7A7A440E11 for ; Fri, 19 Jul 2024 19:10:02 +0200 (CEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1fc65329979so15488915ad.0 for ; Fri, 19 Jul 2024 10:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1721409002; x=1722013802; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ErtLEHpnAvKXyd+fQtY2h5TZATMMSVyOlbbGDKWFfcI=; b=CWLplXpL0mO3kjVzR56Qz0ARZMqoFADT8wRjOa9LAqyE8OsBTDyEBj4aAsW5YCWpai SAN7JVv7uhsy1JpwTv3nBmzytrBU5kFTiQs7n651c8+7Z/KseRvzotsChd1pKzLDo3M7 p2jIF82hl5lvS+VNryPfEVNJyYP/xxdhsBfsnN41nO4bYOu9Bga/3l7pBuJeUkKkcEiS HHpvhQbW3m1a+cZTE+kZK97GnVsOKgCpqsXKC5Lg1b9+1WYJ9aQHkCNF9wcKONyqXur9 1JjjI9/jeUTlkci9o2b2307xMKKRQze9g28oU9r74dbBeNFdc+q74Yv/POgwa9UvDM0r OIMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721409002; x=1722013802; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ErtLEHpnAvKXyd+fQtY2h5TZATMMSVyOlbbGDKWFfcI=; b=oyvVENNSPpiWqAo/7li2DVTudUWR2vlnNqZVt4smiqgeIBHVGRXuzXK37cKfH17tW5 lZ5LQAlBwnN5fUdXk8kRvBjoj7cV20y8ck4Lbw+U9cIMNyfZ5ySDXOH1yDXl9VoxzoTB kigkBp+nMOOIqKYjmW7tVwe2pAzW9FCysl4e98fhftHjPZGxTAkju96p+kjkOAMad/En YBwgewoom2POotlnwQIT22kHD7vhEQCebCziWsGHIrobq632Bbxb888IBr1hg3XPYuFw abx9rKzfzucEfe989v9joJXkAZHOEkKFU7xGhwxsO/mvkuQ3a4efKcjU5b4NoPTfcQxp vyog== X-Gm-Message-State: AOJu0YwxZKmLJpOorpnfD6SMprqmb6Z5mmZPNBTCJ5Lv0gByPGZsdBqd CC77IjmaSbbdYBj98HsoBkxp0DGC9rsaeXZtJCvEW/38hNS7Ksl11pQmf1uECeA= X-Google-Smtp-Source: AGHT+IGjznHfTz9GOmyaclxm6PFcoWnoKjKImSNreHmSfgFlNiRAOQsK84xxs+Fbr+ZM3ieknkhHtg== X-Received: by 2002:a17:903:188:b0:1fb:8a3b:ee8b with SMTP id d9443c01a7336-1fd74572840mr4690765ad.31.1721409001968; Fri, 19 Jul 2024 10:10:01 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f45764asm7074565ad.233.2024.07.19.10.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jul 2024 10:10:01 -0700 (PDT) Date: Fri, 19 Jul 2024 10:09:59 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: , Tyler Retzlaff Subject: Re: [PATCH 1/4] test: update alarm test Message-ID: <20240719101000.187e76b6@hermes.local> In-Reply-To: References: <20240718191049.84865-1-stephen@networkplumber.org> <20240718191049.84865-2-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 19 Jul 2024 11:17:43 +0100 Bruce Richardson wrote: > On Thu, Jul 18, 2024 at 12:07:12PM -0700, Stephen Hemminger wrote: > > This test should be using the TEST_ASSERT macros, and can be > > run as part of the fast test suite now. > > > > Signed-off-by: Stephen Hemminger > > --- > > app/test/test_alarm.c | 53 ++++++++++++++++--------------------------- > > 1 file changed, 20 insertions(+), 33 deletions(-) > > > > diff --git a/app/test/test_alarm.c b/app/test/test_alarm.c > > index 70e97a3109..4ba8aa1af2 100644 > > --- a/app/test/test_alarm.c > > +++ b/app/test/test_alarm.c > > @@ -10,7 +10,8 @@ > > > > #include "test.h" > > > > -#ifndef RTE_EXEC_ENV_WINDOWS > > +#define US_PER_SEC 1000000 > > + > > static volatile int flag; > > > > static void > > @@ -19,46 +20,32 @@ test_alarm_callback(void *cb_arg) > > flag = 1; > > printf("Callback setting flag - OK. [cb_arg = %p]\n", cb_arg); > > } > > -#endif > > > > static int > > test_alarm(void) > > { > > -#ifdef RTE_EXEC_ENV_FREEBSD > > - printf("The alarm API is not supported on FreeBSD\n"); > > - return 0; > > -#endif > > + int ret; > > + > > + ret = rte_eal_alarm_set(0, test_alarm_callback, NULL); > > + TEST_ASSERT_FAIL(ret, "should not be succeed with 0 us value"); > > + > > + ret = rte_eal_alarm_set(UINT64_MAX - 1, test_alarm_callback, NULL); > > + TEST_ASSERT_FAIL(ret, "should not be succeed with (UINT64_MAX-1) us value"); > > + > > + ret = rte_eal_alarm_set(10, NULL, NULL); > > + TEST_ASSERT_FAIL(ret, "should not succeed with null callback parameter"); > > > > +1 to use of TEST_ASSERT_FAIL, the test is a lot cleaner now. > However, I think we still need the #ifdefs in it if some of it doesn't work > on Windows/BSD. > > /Bruce It looks like alarm API's exist on Windows (see lib/eal/windows/eal_alarm.c) therefore should be tested but aren't being now.