From patchwork Mon Apr 13 16:48:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 6210551 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E4E76BF4A6 for ; Mon, 13 Apr 2015 16:48:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A20D202DD for ; Mon, 13 Apr 2015 16:48:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2ED3220265 for ; Mon, 13 Apr 2015 16:48:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FA0E6E56A; Mon, 13 Apr 2015 09:48:41 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D4D66E56A for ; Mon, 13 Apr 2015 09:48:40 -0700 (PDT) Received: by wgin8 with SMTP id n8so87688701wgi.0 for ; Mon, 13 Apr 2015 09:48:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=QHf6heBJBGZk3f0d1ivbgcPD54Q4bnYyXr09Sep2VGA=; b=cU2ijR2qqVL6wuP45wOxM02QFZ2y5PdHVxQ+cC8b1CPory6GHIXSEB1KU81oURFx0/ 7cFHW9lpPLSeD8sAYM7CwZ6cj1vFphZIOyAaipE3NhaGTZQgKFc5CXLPxw5JZA/9EiM7 0rExPzyt/Jliahxg8bTyT6784cB+L7ROIdQqHtPrLbB9eF4PYZyg5Lp4s3HCJU9eoKMV eBo/YmOzFjxxiXlmjX9XN1n1HZ6sMYUyEDlIzMsllAQ5+F/F48Z56J/ZG6zVAGpyPe6r 6RbhdcTXG1eY5qe1MK7C5/kr0zKOw9XDzU2uLqAK5PxFvrgM4lJ4NMmlmh9N4QCgOcyo cR3A== X-Gm-Message-State: ALoCoQl9kC8dUb+o3m6W+z1OHBcVqk9D1BrmsTaXRJFL6F0FccYZ2R1UzsQy72mM1mN0pqAu1HW+ X-Received: by 10.180.99.67 with SMTP id eo3mr19567230wib.28.1428943718891; Mon, 13 Apr 2015 09:48:38 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id di9sm13525995wib.16.2015.04.13.09.48.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2015 09:48:38 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Mon, 13 Apr 2015 17:48:35 +0100 Message-Id: <1428943716-19775-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [Intel-gfx] [PATCH i-g-t 1/2] lib: use a critical warning when unable to open a data file X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Thomas Wood --- lib/igt_core.c | 5 +++++ tests/testdisplay.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index daef8c6..700604f 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1751,5 +1751,10 @@ FILE *__igt_fopen_data(const char* igt_srcdir, const char* igt_datadir, snprintf(path, sizeof(path), "%s/%s", igt_srcdir, filename); fp = fopen(path, "r"); } + + if (!fp) + igt_critical("Could not open data file \"%s\": %s", filename, + strerror(errno)); + return fp; } diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 92ea08c..58f56a3 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -262,11 +262,8 @@ static void paint_image(cairo_t *cr, const char *file) img_x = (width / 2) - (img_w / 2); fp = igt_fopen_data(file); - if (!fp) { - igt_warn("data file \'%s\' missing: %s\n", - file, strerror(errno)); + if (!fp) return; - } image = cairo_image_surface_create_from_png_stream(&stdio_read_func, (void*)fp);