From patchwork Fri Jul 28 14:23:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Vesely X-Patchwork-Id: 9868955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 220B36037D for ; Fri, 28 Jul 2017 14:23:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EB5927FA1 for ; Fri, 28 Jul 2017 14:23:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13B992884F; Fri, 28 Jul 2017 14:23:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1BC8C285B5 for ; Fri, 28 Jul 2017 14:23:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B47B6F3DD; Fri, 28 Jul 2017 14:23:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id F21E86F3DC for ; Fri, 28 Jul 2017 14:23:25 +0000 (UTC) Received: by mail-qk0-x243.google.com with SMTP id v76so9585241qka.5 for ; Fri, 28 Jul 2017 07:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarletmail-rutgers-edu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=jMchTUYa0Gv/P7c133BCelfKHSrGlwHXzEMcZB3XhnY=; b=M5ZnqQJj31Ffvr3mOeu2lyKn8YzRayDJAZtTWTPSKWcntB2tWgXQzpDKVQDQfT+nnR nntXl4WNSy6tlxXnO74nD1sb7sWnaTjLk0Jj6sLJIZUnsxKF0T7WsfbfeAJFHWdffPOk Ov63NSZ9VuRHcSUzRiFr9f9+Opy+od7s8XuZc+gh54C4egeBQuzt1HgnN+iPO3a9ZIYz RHghOd88jpMTj/gUDysAyX9nW2h0i1KFlyTQxWa54mtHNq5Yt2sTxkI+OOCxwJR5D8ur x3J9R0wLq4nUNH5IZTSnqWZV3KrQ0F5PGEm2xcT4JgTZHW5y0+i+kupL5io0U5Jgfad1 PU5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=jMchTUYa0Gv/P7c133BCelfKHSrGlwHXzEMcZB3XhnY=; b=HCSZZ9BHFIg6fEKWmJ4rNzy7F0cZ2SnCEnpH5etrmg36xJk0nsp5uob3RuSfoZH/4j 1A6XbVvEKRLYfKSXtNT/3H0FA2513/ignfJxe1k5DTP5GQZDFK5TDKdl81JIBcc2WEGR U+W9gX3SZFrSSWldoTgAIVm21KiLJOY4OKQovh4x+Z+k7O0oG01nVEAIhYY5+QvaI4PE Vb5V4iLpGcVxy5WZysi8EeB5dUBz7EOnRZxZk6nnJho6Fz1ZW4sGNQzN/M6KlI7XfC6s 6nYRgx267gq15Rr+2TwOEfDv16wFaPbGE0q1tikT2KDd1tpf5NWCe9og/FbqVv556bs1 FrTw== X-Gm-Message-State: AIVw112mMWyeyBLHvOr+XSCcx/k8C4OPrl3qI+FSJ/KyhilEkNBqtIz2 pugqlKQQ/CEZhu56eGpzVA== X-Received: by 10.55.163.69 with SMTP id m66mr10962422qke.139.1501251804875; Fri, 28 Jul 2017 07:23:24 -0700 (PDT) Received: from adriatix.rutgers.edu (pool-128-6-37-254.nat.rutgers.edu. [128.6.37.254]) by smtp.gmail.com with ESMTPSA id g206sm4329281qkb.13.2017.07.28.07.23.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jul 2017 07:23:24 -0700 (PDT) From: Jan Vesely To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/1] drmsltest: Check expected neighbours Date: Fri, 28 Jul 2017 10:23:22 -0400 Message-Id: <20170728142322.18783-1-jan.vesely@rutgers.edu> X-Mailer: git-send-email 2.13.3 Cc: Emil Velikov X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fixes: 7d8c9464081634f053e16e5eac9655a12fae1dc4 Signed-off-by: Jan Vesely --- I thought I sent this out, but couldn't find it in sent mail. This tests the behaviour set in 3b2ee2b5bfc0d68525fee936e51297a9b6c629f1 more than 2 years ago Jan tests/drmsl.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/drmsl.c b/tests/drmsl.c index d0ac0efa..d1b59a86 100644 --- a/tests/drmsl.c +++ b/tests/drmsl.c @@ -106,7 +106,9 @@ static double do_time(int size, int iter) return usec; } -static void print_neighbors(void *list, unsigned long key) +static void print_neighbors(void *list, unsigned long key, + unsigned long expected_prev, + unsigned long expected_next) { unsigned long prev_key = 0; unsigned long next_key = 0; @@ -119,6 +121,16 @@ static void print_neighbors(void *list, unsigned long key) &next_key, &next_value); printf("Neighbors of %5lu: %d %5lu %5lu\n", key, retval, prev_key, next_key); + if (prev_key != expected_prev) { + fprintf(stderr, "Unexpected neighbor: %5lu. Expected: %5lu\n", + prev_key, expected_prev); + exit(1); + } + if (next_key != expected_next) { + fprintf(stderr, "Unexpected neighbor: %5lu. Expected: %5lu\n", + next_key, expected_next); + exit(1); + } } int main(void) @@ -138,13 +150,13 @@ int main(void) print(list); printf("\n==============================\n\n"); - print_neighbors(list, 0); - print_neighbors(list, 50); - print_neighbors(list, 51); - print_neighbors(list, 123); - print_neighbors(list, 200); - print_neighbors(list, 213); - print_neighbors(list, 256); + print_neighbors(list, 0, 0, 50); + print_neighbors(list, 50, 0, 50); + print_neighbors(list, 51, 50, 123); + print_neighbors(list, 123, 50, 123); + print_neighbors(list, 200, 123, 213); + print_neighbors(list, 213, 123, 213); + print_neighbors(list, 256, 213, 256); printf("\n==============================\n\n"); drmSLDelete(list, 50);