From patchwork Fri Mar 6 09:40:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 45476 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B3611204BC for ; Fri, 6 Mar 2015 09:41:28 +0000 (UTC) Received: by wghk14 with SMTP id k14sf11256741wgh.3 for ; Fri, 06 Mar 2015 01:41:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=GGvfz7y4bjEscCJzk7byY7cgbwyCW3s6gg9RYiOhTSQ=; b=UMcA5KFNzAatNgihQld2kquARs9bSUy9gZXV3R1KLmYRTSjVcAAYZkd3+G1cfsVrAB EKUiIgfHEbMCMQSLtQ7LjxD6fmm5RkB87BW1h7LBvFIrS7GbmkOdNpQ5PAQ8bVmIW+SE VNB20SoXe0Fh1ljk6ZIBP7vnWJu2OdP9dUkf5D42IYhTNPGW24HSuNFGxmlDAWDbW8oC 6TSMpS9kwTB4CsXe+llwfYexcI9hI8ONhMFcDW9/wIiSB2UMsK6cxYiwgYldJ49uz27z hes6WIrjppRqmkf9cWmEiBXhzmEC/p2QVx/hgqRIqV5kKjm+Uz7khOxJXBFwYXUWaTFc MXSA== X-Gm-Message-State: ALoCoQm+PcHLTdGPcRqTVzAYvINl4QF6buChrUYkdJ5LvsMkScvvXk3eamhacraWyueNwhRRDKl0 X-Received: by 10.112.147.35 with SMTP id th3mr2100440lbb.15.1425634887990; Fri, 06 Mar 2015 01:41:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.101 with SMTP id lv5ls50547lac.22.gmail; Fri, 06 Mar 2015 01:41:27 -0800 (PST) X-Received: by 10.112.170.72 with SMTP id ak8mr11312285lbc.95.1425634887840; Fri, 06 Mar 2015 01:41:27 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id h4si3819923laf.93.2015.03.06.01.41.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2015 01:41:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labhs14 with SMTP id hs14so56507800lab.4 for ; Fri, 06 Mar 2015 01:41:27 -0800 (PST) X-Received: by 10.152.26.201 with SMTP id n9mr11755732lag.29.1425634887422; Fri, 06 Mar 2015 01:41:27 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1020600lbj; Fri, 6 Mar 2015 01:41:26 -0800 (PST) X-Received: by 10.140.107.75 with SMTP id g69mr17399784qgf.103.1425634885930; Fri, 06 Mar 2015 01:41:25 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 78si8628426qha.113.2015.03.06.01.41.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 06 Mar 2015 01:41:25 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YTokw-0003vh-4h; Fri, 06 Mar 2015 09:41:18 +0000 Received: from mail-lb0-f170.google.com ([209.85.217.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YTokp-0003vG-EM for lng-odp@lists.linaro.org; Fri, 06 Mar 2015 09:41:11 +0000 Received: by lbdu10 with SMTP id u10so9558425lbd.4 for ; Fri, 06 Mar 2015 01:41:04 -0800 (PST) X-Received: by 10.112.26.165 with SMTP id m5mr11806580lbg.61.1425634864788; Fri, 06 Mar 2015 01:41:04 -0800 (PST) Received: from macmini.lan (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id an8sm1712534lbc.45.2015.03.06.01.41.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Mar 2015 01:41:03 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Fri, 6 Mar 2015 10:40:57 +0100 Message-Id: <1425634857-11435-1-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: timers patch Subject: [lng-odp] [PATCHv3] validation: odp_timer: cleanup for clean termination X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ola.liljedahl@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Free queue and timeouts, destroy timeout pool before termination. https://bugs.linaro.org/show_bug.cgi?id=1285 Signed-off-by: Ola Liljedahl --- (This document/code contribution attached is provided under the terms of agreement LES-LTM-21309) v2: Removed reference to Linaro CARDS as this is internal. v3: Added check of return value from odp_queue_destroy(). test/validation/odp_timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c index 88af61b..4cb2379 100644 --- a/test/validation/odp_timer.c +++ b/test/validation/odp_timer.c @@ -336,6 +336,12 @@ static void *worker_entrypoint(void *arg) if (ev != ODP_EVENT_INVALID) CU_FAIL("Unexpected event received"); + int rc = odp_queue_destroy(queue); + CU_ASSERT(rc == 0); + for (i = 0; i < NTIMERS; i++) { + if (tt[i].ev != ODP_EVENT_INVALID) + odp_timeout_free(odp_timeout_from_event(tt[i].ev)); + } LOG_DBG("Thread %u: exiting\n", thr); return NULL; } @@ -426,6 +432,10 @@ static void test_odp_timer_all(void) /* Destroy timer pool, all timers must have been freed */ odp_timer_pool_destroy(tp); + /* Destroy timeout pool, all timeouts must have been freed */ + int rc = odp_pool_destroy(tbp); + CU_ASSERT(rc == 0); + CU_PASS("ODP timer test"); }