From patchwork Tue Feb 3 11:35:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44220 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E96D21513 for ; Tue, 3 Feb 2015 11:36:24 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gm9sf20361851lab.0 for ; Tue, 03 Feb 2015 03:36:23 -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:in-reply-to :references: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=J+haivECZEzUUNPxzk+f4pPT7gSD5qjG8R6VfOOrFNA=; b=Guj7U6dDmdEkVpst19ZqKiQJVnCuZC6yHUWyoAOx9uspL3XoEA4/m2e7Y4DWjsMPNx QgvnJ1sU4FN3UsdP49Z/JUeYWaTCprTLN9yINNj3BAlVgiqfh20E6P+mD4RZrBCmWzrN nLc5hBlxVJEM3ebwT1szkarBAr69Nvtx9Ed8ZUDOrqsM4xDPITv37Rwdet5Imf3AZv1Y sr5LxlY+SaK+mPg+AMMg0O64Pbu2z/LWFX5hTtBnUuRKNpRN8luIh2Egt9yU95/VxFgx nztPzLXUXo7PUK03ZOOoTMRlbhgkxcx7TVSPRjXWSgKAwd9WE3tKlpzBLiutzeZJ/bUx zjOg== X-Gm-Message-State: ALoCoQkk0IoT+x5qZT/OBGbKPOQhNLq8qaSdy/g8XY3XdwClGs9KPzYWlx92sS1iyll0hf82lLYf X-Received: by 10.112.64.171 with SMTP id p11mr2999016lbs.12.1422963383618; Tue, 03 Feb 2015 03:36:23 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.197 with SMTP id g5ls764437lam.99.gmail; Tue, 03 Feb 2015 03:36:23 -0800 (PST) X-Received: by 10.112.142.201 with SMTP id ry9mr24099948lbb.4.1422963383215; Tue, 03 Feb 2015 03:36:23 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id o4si18934888lbc.57.2015.02.03.03.36.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 03:36:22 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id gf13so50437380lab.8 for ; Tue, 03 Feb 2015 03:36:22 -0800 (PST) X-Received: by 10.152.44.228 with SMTP id h4mr18153224lam.31.1422963382400; Tue, 03 Feb 2015 03:36:22 -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 h5csp1879302lbj; Tue, 3 Feb 2015 03:36:21 -0800 (PST) X-Received: by 10.224.88.196 with SMTP id b4mr51668623qam.14.1422963381130; Tue, 03 Feb 2015 03:36:21 -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 b3si28562446qai.12.2015.02.03.03.36.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 03:36:21 -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 1YIbmD-0000Il-II; Tue, 03 Feb 2015 11:36:17 +0000 Received: from mail-qa0-f46.google.com ([209.85.216.46]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIblp-0000FU-5i for lng-odp@lists.linaro.org; Tue, 03 Feb 2015 11:35:53 +0000 Received: by mail-qa0-f46.google.com with SMTP id j7so33340780qaq.5 for ; Tue, 03 Feb 2015 03:35:48 -0800 (PST) X-Received: by 10.229.37.136 with SMTP id x8mr8302051qcd.30.1422963348034; Tue, 03 Feb 2015 03:35:48 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id e88sm20973034qgf.22.2015.02.03.03.35.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 03:35:47 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 3 Feb 2015 06:35:28 -0500 Message-Id: <1422963328-31760-6-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422963328-31760-1-git-send-email-mike.holmes@linaro.org> References: <1422963328-31760-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 5/5] validation: init: add test for replace abort 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: 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.215.49 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 --- test/validation/.gitignore | 1 + test/validation/Makefile.am | 5 ++-- test/validation/odp_init_abort.c | 62 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 test/validation/odp_init_abort.c diff --git a/test/validation/.gitignore b/test/validation/.gitignore index 4a1ccb4..242e576 100644 --- a/test/validation/.gitignore +++ b/test/validation/.gitignore @@ -1,6 +1,7 @@ *.log *.trs odp_init +odp_init_abort odp_queue odp_crypto odp_classification diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 703d9b6..a57be1a 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -6,17 +6,18 @@ AM_LDFLAGS += -static TESTS_ENVIRONMENT = ODP_PLATFORM=${with_platform} if test_vald -TESTS = odp_init odp_queue odp_crypto odp_shm odp_schedule odp_pktio_run odp_buffer odp_system odp_timer odp_time odp_synchronizers odp_classification +TESTS = odp_init odp_init_abort odp_queue odp_crypto odp_shm odp_schedule odp_pktio_run odp_buffer odp_system odp_timer odp_time odp_synchronizers odp_classification endif dist_bin_SCRIPTS = $(srcdir)/odp_pktio_run -bin_PROGRAMS = odp_init odp_queue odp_crypto odp_shm odp_schedule odp_pktio odp_buffer odp_system odp_timer odp_time odp_synchronizers odp_classification +bin_PROGRAMS = odp_init odp_init_abort odp_queue odp_crypto odp_shm odp_schedule odp_pktio odp_buffer odp_system odp_timer odp_time odp_synchronizers odp_classification odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto odp_buffer_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/buffer odp_classification_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/classification dist_odp_init_SOURCES = odp_init.c +dist_odp_init_abort_SOURCES = odp_init_abort.c dist_odp_pktio_SOURCES = odp_pktio.c common/odp_cunit_common.c dist_odp_queue_SOURCES = odp_queue.c common/odp_cunit_common.c dist_odp_crypto_SOURCES = crypto/odp_crypto_test_async_inp.c \ diff --git a/test/validation/odp_init_abort.c b/test/validation/odp_init_abort.c new file mode 100644 index 0000000..c291146 --- /dev/null +++ b/test/validation/odp_init_abort.c @@ -0,0 +1,62 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include + +static void odp_init_abort(void) ODP_NORETURN; + +static void test_odp_init_global_replace_abort(void) +{ + int status; + struct odp_init_t init_data; + + memset(&init_data, 0, sizeof(init_data)); + init_data.abort_fn = &odp_init_abort; + + status = odp_init_global(&init_data, NULL); + CU_ASSERT_FATAL(status == 0); + + status = odp_term_global(); + CU_ASSERT(status == 0); +} + +CU_TestInfo test_odp_init[] = { + {"replace abort", test_odp_init_global_replace_abort}, + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo odp_testsuites[] = { + {"Init", NULL, NULL, NULL, NULL, test_odp_init}, + CU_SUITE_INFO_NULL, +}; + +int main(void) +{ + int ret; + + printf("\tODP API version: %s\n", odp_version_api_str()); + printf("\tODP implementation version: %s\n", odp_version_impl_str()); + + CU_set_error_action(CUEA_ABORT); + + CU_initialize_registry(); + CU_register_suites(odp_testsuites); + CU_basic_set_mode(CU_BRM_VERBOSE); + CU_basic_run_tests(); + + ret = CU_get_number_of_failure_records(); + + CU_cleanup_registry(); + + return ret; +} + +void odp_init_abort(void) +{ + abort(); +}