From patchwork Thu Jan 29 22:52:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 43996 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 357EF24128 for ; Thu, 29 Jan 2015 22:53:19 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id h11sf16439524wiw.1 for ; Thu, 29 Jan 2015 14:53:18 -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=0rB0xIpHC/yyd741TUmQm/PT8yUwq2stpI+zSV9gUcg=; b=YQJk5vlF62EGGY5gQeyeA3hH+uVtkjI6aS4X4DyYBElnWqNoee6In5q/kilE70fEPX UxSnD/1iDYpCLvY5Qw6mh+FyNqLMPsSXMi8hgqs2ZSS800zVzrbfg1fIr8sy9bgmiYzm jR3GLb8v7LTiq0gbIf0N4EX5ti8ZUGOziO8V0x6JgogeBUpobxAb67SlUN4T51sjlOXI Re2rHfP0Lf9m1Wu5d9HSwFfVMiE+6B7pKptcE3ZH0sveqma4W/9q+kTwXq7e2a9NYK0e dAPEJ/YF9ROBYUWoBWfzB0dnTNs8M6S86tr9zcWxOv5qYjoyLPLPAmGf8uZNMdaZ9XNZ ++2Q== X-Gm-Message-State: ALoCoQnLBLSlfAMFyae98M01QENNu3I9jecz3A/00FPemAOa9xzHQGgbZuLxP0x8YXPUXqtNZc1U X-Received: by 10.180.93.165 with SMTP id cv5mr425256wib.6.1422571998543; Thu, 29 Jan 2015 14:53:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.201 with SMTP id e9ls311240lag.67.gmail; Thu, 29 Jan 2015 14:53:18 -0800 (PST) X-Received: by 10.152.28.194 with SMTP id d2mr3549653lah.85.1422571998277; Thu, 29 Jan 2015 14:53:18 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id w1si1086907lag.6.2015.01.29.14.53.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 14:53:18 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id 10so33427170lbg.10 for ; Thu, 29 Jan 2015 14:53:18 -0800 (PST) X-Received: by 10.112.44.230 with SMTP id h6mr3625189lbm.98.1422571998095; Thu, 29 Jan 2015 14:53:18 -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 h5csp95477lbj; Thu, 29 Jan 2015 14:53:17 -0800 (PST) X-Received: by 10.224.151.140 with SMTP id c12mr6327804qaw.80.1422571996571; Thu, 29 Jan 2015 14:53:16 -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 j10si12041563qga.33.2015.01.29.14.53.14 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 14:53:16 -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 1YGxxY-0008MU-TZ; Thu, 29 Jan 2015 22:53:12 +0000 Received: from mail-qg0-f51.google.com ([209.85.192.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YGxxB-0008Ki-JX for lng-odp@lists.linaro.org; Thu, 29 Jan 2015 22:52:49 +0000 Received: by mail-qg0-f51.google.com with SMTP id z107so35435479qgd.10 for ; Thu, 29 Jan 2015 14:52:44 -0800 (PST) X-Received: by 10.229.248.138 with SMTP id mg10mr6314494qcb.29.1422571964475; Thu, 29 Jan 2015 14:52:44 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id q5sm8304624qat.47.2015.01.29.14.52.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 14:52:44 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 17:52:32 -0500 Message-Id: <1422571952-5132-5-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422571952-5132-1-git-send-email-mike.holmes@linaro.org> References: <1422571952-5132-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 5/5] validation: odp_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.217.179 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/odp_init.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/validation/odp_init.c b/test/validation/odp_init.c index c8e5a11..cbb04b0 100644 --- a/test/validation/odp_init.c +++ b/test/validation/odp_init.c @@ -14,6 +14,7 @@ int replacement_logging_used; static int odp_init_log(odp_log_level_e level , const char *fmt, ...); +static void odp_init_abort(void) ODP_NORETURN; static void test_odp_init_global(void) { @@ -30,6 +31,7 @@ static void test_odp_init_global_replace_log(void) int status; struct odp_init_t init_data; + memset(&init_data, 0, sizeof(init_data)); init_data.log_fn = &odp_init_log; replacement_logging_used = 0; @@ -43,9 +45,25 @@ static void test_odp_init_global_replace_log(void) CU_ASSERT(status == 0); } +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[] = { {"test_odp_init_global", test_odp_init_global}, {"replace log", test_odp_init_global_replace_log}, + {"replace abort", test_odp_init_global_replace_abort}, CU_TEST_INFO_NULL, }; @@ -90,3 +108,8 @@ int odp_init_log(odp_log_level_e level __attribute__((unused)), return r; } + +void odp_init_abort(void) +{ + abort(); +}