From patchwork Mon Feb 23 17:15:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44903 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C989021562 for ; Mon, 23 Feb 2015 17:16:12 +0000 (UTC) Received: by wesw55 with SMTP id w55sf13159188wes.0 for ; Mon, 23 Feb 2015 09:16:12 -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=Tksu0dd3VB0c2VMWN8Q8VZMP6DqnNkYaofRR9DKD4BE=; b=PId9LtP9FxNfz9xD8bqzrQILURrvQjWrdMLWrro0cf1IJ/ySCuKxvFAlklENMUPv48 aNyz2fw2zRq8v48lnsMnr1QQKYAiPhntQ3pI/AwsL/lEunBJ7ODW4ytBD9aSotxQzv35 IpnIoc1SfxGW4CAKi/hylnX6PScQWpgLnCRPpGSR3pSt0eC9zLfGLEUXl/ommFbYPZGo rENfY4uZqiH0MOQSO50uCDPGY3kAW29XmTPYXvvjGGTE0/0POn6ElzTvwTvuoyNTJZ+F +0yEq1Y2dJvVZcpUkh6+GzaJGcr09IJ0hCApRKYflxsxVH5KZNLyQCXAfvayXRYwxyq5 5bkw== X-Gm-Message-State: ALoCoQl7NhRUc5r7JbuhgsMy84KSBIPSzdk2LBtg7E80eRr2y8Eo37StePrg97e/SDRgsfWDh6Fc X-Received: by 10.112.124.142 with SMTP id mi14mr1481671lbb.1.1424711772099; Mon, 23 Feb 2015 09:16:12 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.129 with SMTP id d1ls475296laf.18.gmail; Mon, 23 Feb 2015 09:16:11 -0800 (PST) X-Received: by 10.152.116.18 with SMTP id js18mr10777768lab.106.1424711771942; Mon, 23 Feb 2015 09:16:11 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id sm5si24050906lbb.39.2015.02.23.09.16.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 09:16:11 -0800 (PST) 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 lbjf15 with SMTP id f15so19719251lbj.13 for ; Mon, 23 Feb 2015 09:16:11 -0800 (PST) X-Received: by 10.112.188.165 with SMTP id gb5mr10940933lbc.35.1424711771842; Mon, 23 Feb 2015 09:16:11 -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 h5csp1397731lbj; Mon, 23 Feb 2015 09:16:11 -0800 (PST) X-Received: by 10.140.104.242 with SMTP id a105mr26069936qgf.89.1424711770418; Mon, 23 Feb 2015 09:16:10 -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 21si28248439qhs.70.2015.02.23.09.16.05 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 09:16:10 -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 1YPwbz-0006Jk-L0; Mon, 23 Feb 2015 17:16:03 +0000 Received: from mail-qc0-f170.google.com ([209.85.216.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YPwbr-0006G7-KY for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 17:15:55 +0000 Received: by qcvp6 with SMTP id p6so12088487qcv.12 for ; Mon, 23 Feb 2015 09:15:50 -0800 (PST) X-Received: by 10.140.238.208 with SMTP id j199mr22911864qhc.56.1424711750413; Mon, 23 Feb 2015 09:15:50 -0800 (PST) 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 191sm17794401qht.13.2015.02.23.09.15.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Feb 2015 09:15:49 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 12:15:40 -0500 Message-Id: <1424711740-21699-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424711740-21699-1-git-send-email-mike.holmes@linaro.org> References: <1424711740-21699-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/2] valididation: errno: add sunnyday test 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.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 Call the public APIs for errno in a sunny day configuration. Signed-off-by: Mike Holmes --- test/validation/.gitignore | 1 + test/validation/Makefile.am | 5 +++-- test/validation/odp_errno.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 test/validation/odp_errno.c diff --git a/test/validation/.gitignore b/test/validation/.gitignore index 197b094..9c2ff37 100644 --- a/test/validation/.gitignore +++ b/test/validation/.gitignore @@ -14,3 +14,4 @@ odp_buffer odp_timer odp_time odp_synchronizers +odp_errno diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index f9d7d7a..f808aba 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_init_abort odp_init_log 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_init_log odp_queue odp_crypto odp_shm odp_schedule odp_pktio_run odp_buffer odp_system odp_timer odp_time odp_synchronizers odp_classification odp_errno endif dist_bin_SCRIPTS = $(srcdir)/odp_pktio_run -bin_PROGRAMS = odp_init odp_init_abort odp_init_log 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_init_log odp_queue odp_crypto odp_shm odp_schedule odp_pktio odp_buffer odp_system odp_timer odp_time odp_synchronizers odp_classification odp_errno 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_errno_SOURCES = odp_errno.c common/odp_cunit_common.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 diff --git a/test/validation/odp_errno.c b/test/validation/odp_errno.c new file mode 100644 index 0000000..4e292e6 --- /dev/null +++ b/test/validation/odp_errno.c @@ -0,0 +1,32 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include "odp_cunit_common.h" + +#define ERR_STR_LEN 128 +static void test_odp_errno_sunny_day(void) +{ + int my_errno; + char my_error_string[ERR_STR_LEN]; + odp_errno_zero(); + my_errno = odp_errno(); + CU_ASSERT_TRUE(my_errno == 0); + odp_errno_print("odp_errno"); + + strncpy(my_error_string, odp_errno_str(my_errno), ERR_STR_LEN-1); + CU_ASSERT_STRING_EQUAL(my_error_string, "Success"); +} + +CU_TestInfo test_odp_errno[] = { + {"sunny day", test_odp_errno_sunny_day}, + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo odp_testsuites[] = { + {"Errno", NULL, NULL, NULL, NULL, test_odp_errno}, + CU_SUITE_INFO_NULL, +};