From patchwork Tue Apr 21 21:26:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 47404 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 284B620553 for ; Tue, 21 Apr 2015 21:27:23 +0000 (UTC) Received: by lbos2 with SMTP id s2sf2794504lbo.2 for ; Tue, 21 Apr 2015 14:27:22 -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: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=xabAgsNtSjoM7Ygn9pH7mBDzH2kdBeDJAsKUNp7e+bY=; b=iDqaRwlpiJKS49l5+JhP3BQpqLJC5nLI7IU65Te8Az1jkjQs4sVYyRCPO75VbbxLQM 0eraCc7B9KhPAZTkx8nSnfegKZjkWsWTJ0nMPZ4UG+0VZ5Vp3eldNVnDmhKO6v4620iZ gQgTmJb5JZr7FEvrSquZrOmKaAt4Trr4C6bM1CC1otktq4TNPZcQL9A1LiiNJYv5h3pr /nGSF4ngbeDU5dM6VG+Yb7SM4gr0dVAUa8OI4dJ44mNnPpk9Y+xHBpJwO+SQbrweazuK ZlL1eEVOeFIB6WkFju3Ik1MhZB6kZ121bN36EPq/ACa09c4o4cPB1dqpNVWn5mvJUTLy 6l2w== X-Gm-Message-State: ALoCoQmzxIAJo2pftYmSftrPH57nZNkVSfNdXZL5lqqywPGhjNu0cy8YDbMS6PB1w4W2zpDrp+3+ X-Received: by 10.180.106.10 with SMTP id gq10mr28146wib.0.1429651642040; Tue, 21 Apr 2015 14:27:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.35 with SMTP id cr3ls92699lad.47.gmail; Tue, 21 Apr 2015 14:27:21 -0700 (PDT) X-Received: by 10.152.121.42 with SMTP id lh10mr22429918lab.0.1429651641779; Tue, 21 Apr 2015 14:27:21 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id mw9si2280579lbc.9.2015.04.21.14.27.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Apr 2015 14:27:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbcga7 with SMTP id ga7so165930750lbc.1 for ; Tue, 21 Apr 2015 14:27:21 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr21575522lac.41.1429651641675; Tue, 21 Apr 2015 14:27:21 -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 l1csp877775lbt; Tue, 21 Apr 2015 14:27:21 -0700 (PDT) X-Received: by 10.55.20.139 with SMTP id 11mr41565254qku.28.1429651640488; Tue, 21 Apr 2015 14:27:20 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f132si3134102qhc.118.2015.04.21.14.27.19; Tue, 21 Apr 2015 14:27:20 -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 6C98F61E8E; Tue, 21 Apr 2015 21:27:19 +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_H2, 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 435C261D27; Tue, 21 Apr 2015 21:27:16 +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 B398661E6A; Tue, 21 Apr 2015 21:27:14 +0000 (UTC) Received: from mail-qg0-f47.google.com (mail-qg0-f47.google.com [209.85.192.47]) by lists.linaro.org (Postfix) with ESMTPS id A1BCB61D27 for ; Tue, 21 Apr 2015 21:26:51 +0000 (UTC) Received: by qgfi89 with SMTP id i89so74693767qgf.1 for ; Tue, 21 Apr 2015 14:26:51 -0700 (PDT) X-Received: by 10.55.20.30 with SMTP id e30mr42849886qkh.45.1429651611408; Tue, 21 Apr 2015 14:26:51 -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 72sm2215047qhx.32.2015.04.21.14.26.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Apr 2015 14:26:50 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 21 Apr 2015 17:26:44 -0400 Message-Id: <1429651604-1263-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] validation: thread: add odp_thread sunnyday tests 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.170 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 Add test cases for APIs in the logical ODP THREAD grouping Signed-off-by: Mike Holmes Reviewed-by: Christophe Milard Reviewed-by: Anders Roxell --- test/validation/.gitignore | 1 + test/validation/Makefile.am | 4 +++- test/validation/odp_thread.c | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 test/validation/odp_thread.c diff --git a/test/validation/.gitignore b/test/validation/.gitignore index 01092d1..cd27c92 100644 --- a/test/validation/.gitignore +++ b/test/validation/.gitignore @@ -19,3 +19,4 @@ odp_synchronizers odp_system odp_time odp_timer +odp_thread diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 4c28325..6bac101 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -22,7 +22,8 @@ EXECUTABLES = odp_buffer \ odp_synchronizers \ odp_time \ odp_timer \ - odp_errno + odp_errno \ + odp_thread COMPILE_ONLY = odp_pktio @@ -63,3 +64,4 @@ dist_odp_packet_SOURCES = odp_packet.c $(ODP_CU_COMMON) dist_odp_pool_SOURCES = odp_pool.c $(ODP_CU_COMMON) dist_odp_errno_SOURCES = odp_errno.c $(ODP_CU_COMMON) dist_odp_cpumask_SOURCES = odp_cpumask.c $(ODP_CU_COMMON) +dist_odp_thread_SOURCES = odp_thread.c $(ODP_CU_COMMON) diff --git a/test/validation/odp_thread.c b/test/validation/odp_thread.c new file mode 100644 index 0000000..84db1e7 --- /dev/null +++ b/test/validation/odp_thread.c @@ -0,0 +1,41 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include + +/* Helper macro for CU_TestInfo initialization */ +#define _CU_TEST_INFO(test_func) {#test_func, test_func} + +static void test_odp_cpu_id(void) +{ + (void) odp_cpu_id(); + CU_PASS(); +} + +static void test_odp_thread_id(void) +{ + (void) odp_thread_id(); + CU_PASS(); +} + +static void test_odp_thread_count(void) +{ + (void) odp_thread_count(); + CU_PASS(); +} + +CU_TestInfo test_odp_thread[] = { + _CU_TEST_INFO(test_odp_cpu_id), + _CU_TEST_INFO(test_odp_thread_id), + _CU_TEST_INFO(test_odp_thread_count), + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo odp_testsuites[] = { + {"thread", NULL, NULL, NULL, NULL, test_odp_thread}, + CU_SUITE_INFO_NULL, +};