From: Daniel Vetter Subject: [PATCH 1/3] lib/igt_core: Add igt_assert_eq Date: Fri, 13 Jun 2014 11:18:07 +0200 Message-ID: <1402651089-4027-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 86DBC6E9E6 for ; Fri, 13 Jun 2014 02:18:21 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id r20so503456wiv.16 for ; Fri, 13 Jun 2014 02:18:20 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Intel Graphics Development Cc: Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org Suggested by Chris Wilson. Not yet rolled out since I'm trying to use cocci for this. Signed-off-by: Daniel Vetter --- lib/igt_core.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/igt_core.h b/lib/igt_core.h index f7f7015a32f5..b54ef61565d0 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -253,6 +253,19 @@ void igt_exit(void) __attribute__((noreturn)); } while (0) /** + * igt_assert_eq: + * @n1: first integer + * @n2: second integer + * + * Fails (sub-)test if the two integers are not equal. Beware that for now this + * only works on integers. + * + * Like igt_assert(), but displays the values being compared on failure instead + * of simply printing the stringified expression. + */ +#define igt_assert_eq(n1, n2) igt_assert_cmpint(n1, ==, n2) + +/** * igt_require: * @expr: condition to test * -- 2.0.0