From patchwork Tue Apr 21 19:14:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 47401 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 327502121F for ; Tue, 21 Apr 2015 19:14:57 +0000 (UTC) Received: by wicmx19 with SMTP id mx19sf6815069wic.3 for ; Tue, 21 Apr 2015 12:14:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:cc: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=VV2yf29uYAf0F1ap675Y1YgH2N5U4Pt5TpQ9nnM00Es=; b=XCPUf7tWjpxG0k4kknhiH6AIn5lc9FR9eCTJmAo2VFvQ+ZELfaD80ZkjmQi8+itPfy 6Nfchz5ZLKWAip5H/hBZy75dwHmFqe5HmOlsxe7WXwAnlqhauhy57CL/t2TzX4zSlVEW +d3M103huGM5uUWLgXJVPyi7hmzVzP98MO9uZ3pTk2uptL8ilsilFuX3d48wVSufQkPp /dVuc8IdOulWUIkWLOEQJCTtGC+0KC4HbCBELuzlDWGs3YRQTLpvJD0W5cmlNB3+fj+j OdjSEmMRHg8IU99imQVijjdT+apI3PnKXyPqx039LCvQBBqF5Z6BgFFMc/AETDRNKHpc DKQQ== X-Gm-Message-State: ALoCoQnSJJYcw8nQngagawdtpqz/bLVIBGo8Z8NozJiRL6W+QRhKmNY1sq6OXASb24DOT5buQQHX X-Received: by 10.112.26.5 with SMTP id h5mr10122746lbg.4.1429643696432; Tue, 21 Apr 2015 12:14:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.231 with SMTP id i7ls88865lae.85.gmail; Tue, 21 Apr 2015 12:14:56 -0700 (PDT) X-Received: by 10.112.168.165 with SMTP id zx5mr21238228lbb.111.1429643696219; Tue, 21 Apr 2015 12:14:56 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id lb7si2036580lac.89.2015.04.21.12.14.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Apr 2015 12:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbuc2 with SMTP id uc2so163313085lbb.2 for ; Tue, 21 Apr 2015 12:14:56 -0700 (PDT) X-Received: by 10.152.27.98 with SMTP id s2mr14887381lag.106.1429643695942; Tue, 21 Apr 2015 12:14:55 -0700 (PDT) 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.67.65 with SMTP id l1csp820428lbt; Tue, 21 Apr 2015 12:14:55 -0700 (PDT) X-Received: by 10.140.30.100 with SMTP id c91mr6789664qgc.81.1429643694798; Tue, 21 Apr 2015 12:14:54 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i13si2775650qkh.127.2015.04.21.12.14.53; Tue, 21 Apr 2015 12:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id B3BF161E75; Tue, 21 Apr 2015 19:14:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 762FA61CC5; Tue, 21 Apr 2015 19:14:52 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 47EBE61E6E; Tue, 21 Apr 2015 19:14:50 +0000 (UTC) Received: from mail-qk0-f181.google.com (mail-qk0-f181.google.com [209.85.220.181]) by lists.linaro.org (Postfix) with ESMTPS id E4DB561CC5 for ; Tue, 21 Apr 2015 19:14:49 +0000 (UTC) Received: by qkx62 with SMTP id 62so213456208qkx.0 for ; Tue, 21 Apr 2015 12:14:49 -0700 (PDT) X-Received: by 10.140.40.137 with SMTP id x9mr24673900qgx.75.1429643689658; Tue, 21 Apr 2015 12:14:49 -0700 (PDT) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id 143sm1980513qhw.21.2015.04.21.12.14.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Apr 2015 12:14:49 -0700 (PDT) From: Mike Holmes To: christophe.milard@linaro.org Date: Tue, 21 Apr 2015 15:14:43 -0400 Message-Id: <1429643683-9050-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH] validation: odp_pool: add double destroy X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@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.217.169 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 Signed-off-by: Mike Holmes Reviewed-by: Bill Fischofer --- test/validation/odp_pool.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/validation/odp_pool.c b/test/validation/odp_pool.c index 1a518a0..c2f9a1b 100644 --- a/test/validation/odp_pool.c +++ b/test/validation/odp_pool.c @@ -11,6 +11,30 @@ static int pool_name_number = 1; static const int default_buffer_size = 1500; static const int default_buffer_num = 1000; +static void pool_double_destroy(void) +{ + odp_pool_param_t params = { + .buf = { + .size = default_buffer_size, + .align = ODP_CACHE_LINE_SIZE, + .num = default_buffer_num, + }, + .type = ODP_POOL_BUFFER, + }; + odp_pool_t pool; + char pool_name[ODP_POOL_NAME_LEN]; + + snprintf(pool_name, sizeof(pool_name), + "test_pool-%d", pool_name_number++); + + pool = odp_pool_create(pool_name, ODP_SHM_INVALID, ¶ms); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + CU_ASSERT(odp_pool_to_u64(pool) != + odp_pool_to_u64(ODP_POOL_INVALID)); + CU_ASSERT(odp_pool_destroy(pool) == 0); + CU_ASSERT(odp_pool_destroy(pool) < 0); +} + static void pool_create_destroy(odp_pool_param_t *params) { odp_pool_t pool; @@ -133,6 +157,7 @@ CU_TestInfo pool_tests[] = { _CU_TEST_INFO(pool_create_destroy_timeout), _CU_TEST_INFO(pool_create_destroy_buffer_shm), _CU_TEST_INFO(pool_lookup_info_print), + _CU_TEST_INFO(pool_double_destroy), CU_TEST_INFO_NULL, };