From patchwork Sun Nov 30 07:31:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yan.songming" X-Patchwork-Id: 41716 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 29A3824001 for ; Sun, 30 Nov 2014 07:31:52 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf5451451lbv.5 for ; Sat, 29 Nov 2014 23:31:51 -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=1ILVDmIHA4K2iFX9pD1soe3Ms/uDIql7wAYa4eTI+gg=; b=h4JjdQVj8oYLypjVWSxoZxudDqjcv6DpMBS014IVUWOgP9tl3/Qc+T2SY0YZu740ek 9/PF3cLNNPqPqnTKxdP4ZA5pC+5Om18BqjHHjiJlFP41PzAe9ZNBCHr/+H5NiY6NOifB qbACssuNHPiOWF2TMmMF9tF3vbZRvEh6PSBsceofOUrNsbw5nmPKK5MsxHr1SpfFdcda 7vn9LDexeLImB8nGVgNcBprNObSQEgftbjA2PVfvzojhYsTKun9IGuXO46jGL3u/1KRp x1fEaTcz0yipf4MYjkbPnu9xDYSJaop23lRAkHNvQUYLyK6Z+7zLixrpXaIsTFiiBWS2 GsMA== X-Gm-Message-State: ALoCoQmm86l0uhxemUZjM6B2G0U8H8uGHnkUNzPYE1fB4GoAGR4DPSjBTa4zfsIZ0WJvZ2uSlBPi X-Received: by 10.180.105.97 with SMTP id gl1mr10993939wib.7.1417332710955; Sat, 29 Nov 2014 23:31:50 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.226 with SMTP id z2ls15367lal.5.gmail; Sat, 29 Nov 2014 23:31:50 -0800 (PST) X-Received: by 10.152.234.140 with SMTP id ue12mr50266835lac.78.1417332710554; Sat, 29 Nov 2014 23:31:50 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id li6si14285794lbc.87.2014.11.29.23.31.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 29 Nov 2014 23:31:50 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so8052775lbj.9 for ; Sat, 29 Nov 2014 23:31:50 -0800 (PST) X-Received: by 10.112.38.4 with SMTP id c4mr35512058lbk.46.1417332710079; Sat, 29 Nov 2014 23:31:50 -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.184.201 with SMTP id ew9csp112455lbc; Sat, 29 Nov 2014 23:31:49 -0800 (PST) X-Received: by 10.224.69.200 with SMTP id a8mr42974402qaj.40.1417332708483; Sat, 29 Nov 2014 23:31:48 -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 dg10si16952212qcb.0.2014.11.29.23.31.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 29 Nov 2014 23:31:48 -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 1Xuyyu-00027u-Ai; Sun, 30 Nov 2014 07:31:44 +0000 Received: from mail-pa0-f43.google.com ([209.85.220.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xuyyn-00027p-SJ for lng-odp@lists.linaro.org; Sun, 30 Nov 2014 07:31:37 +0000 Received: by mail-pa0-f43.google.com with SMTP id kx10so9117890pab.2 for ; Sat, 29 Nov 2014 23:31:32 -0800 (PST) X-Received: by 10.70.131.104 with SMTP id ol8mr3036338pdb.81.1417332692204; Sat, 29 Nov 2014 23:31:32 -0800 (PST) Received: from ysm-linux.localdomain ([223.65.140.174]) by mx.google.com with ESMTPSA id fv6sm14197105pdb.83.2014.11.29.23.31.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Nov 2014 23:31:31 -0800 (PST) From: Yan Songming To: lng-odp@lists.linaro.org Date: Sun, 30 Nov 2014 15:31:21 +0800 Message-Id: <1417332681-23462-1-git-send-email-yan.songming@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Topics: patch Subject: [lng-odp] [PATCH v1] validation: queue: use CU_register_suites() for tests registration 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: yan.songming@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.178 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: Yan Songming --- test/validation/odp_queue.c | 56 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/test/validation/odp_queue.c b/test/validation/odp_queue.c index 09dba0e..9431511 100644 --- a/test/validation/odp_queue.c +++ b/test/validation/odp_queue.c @@ -109,6 +109,22 @@ static int init_suite(void) { printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); + return 0; +} + +CU_TestInfo test_odp_queue[] = { + {"test_odp_queue_sunnyday", test_odp_queue_sunnyday}, + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo suites[] = { + {"test_odp_queue", init_suite, NULL, NULL, NULL, test_odp_queue}, + CU_SUITE_INFO_NULL, +}; + +int main(void) +{ + int ret; if (0 != odp_init_global(NULL, NULL)) { printf("odp_init_global fail.\n"); @@ -118,43 +134,25 @@ static int init_suite(void) printf("odp_init_local fail.\n"); return -1; } + if (0 != test_odp_buffer_pool_init()) { printf("test_odp_buffer_pool_init fail.\n"); return -1; } - return 0; -} -static int finalize(void) -{ - odp_term_local(); - odp_term_global(); - return 0; -} + CU_set_error_action(CUEA_ABORT); -int main(void) -{ - CU_pSuite ptr_suite = NULL; + CU_initialize_registry(); + CU_register_suites(suites); + CU_basic_set_mode(CU_BRM_VERBOSE); + CU_basic_run_tests(); - /* initialize the CUnit test registry */ - if (CUE_SUCCESS != CU_initialize_registry()) - return CU_get_error(); + ret = CU_get_number_of_failure_records(); - /* add the tests to the queue suite */ - ptr_suite = CU_add_suite(__FILE__, init_suite, finalize); - if (NULL == ptr_suite) { - CU_cleanup_registry(); - return CU_get_error(); - } + CU_cleanup_registry(); - if (NULL == CU_ADD_TEST(ptr_suite, test_odp_queue_sunnyday)) { - CU_cleanup_registry(); - return CU_get_error(); - } + odp_term_local(); + odp_term_global(); - /* Run all tests using the CUnit Basic interface */ - CU_basic_set_mode(CU_BRM_VERBOSE); - CU_basic_run_tests(); - CU_cleanup_registry(); - return CU_get_error(); + return ret; }