All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/1] drmsltest: Check expected neighbours
@ 2017-07-28 14:23 Jan Vesely
  2017-08-14  2:44 ` Jan Vesely
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Vesely @ 2017-07-28 14:23 UTC (permalink / raw)
  To: dri-devel; +Cc: Emil Velikov

Fixes: 7d8c9464081634f053e16e5eac9655a12fae1dc4
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---

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);
-- 
2.13.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH libdrm 1/1] drmsltest: Check expected neighbours
  2017-07-28 14:23 [PATCH libdrm 1/1] drmsltest: Check expected neighbours Jan Vesely
@ 2017-08-14  2:44 ` Jan Vesely
  2017-08-16  1:51   ` Emil Velikov
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Vesely @ 2017-08-14  2:44 UTC (permalink / raw)
  To: dri-devel; +Cc: Emil Velikov


[-- Attachment #1.1: Type: text/plain, Size: 2608 bytes --]

On Fri, 2017-07-28 at 10:23 -0400, Jan Vesely wrote:
> Fixes: 7d8c9464081634f053e16e5eac9655a12fae1dc4
> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

ping.
Emil, should I just drop this patch?
another alternative is to remove the list implementation entirely,
since nobody noticed when it got broken.

Jan

> ---
> 
> 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);

-- 
Jan Vesely <jan.vesely@rutgers.edu>

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH libdrm 1/1] drmsltest: Check expected neighbours
  2017-08-14  2:44 ` Jan Vesely
@ 2017-08-16  1:51   ` Emil Velikov
  2017-08-21 12:19     ` Emil Velikov
  0 siblings, 1 reply; 5+ messages in thread
From: Emil Velikov @ 2017-08-16  1:51 UTC (permalink / raw)
  To: Jan Vesely; +Cc: ML dri-devel

Hi Jan,

On 14 August 2017 at 03:44, Jan Vesely <jan.vesely@rutgers.edu> wrote:
> On Fri, 2017-07-28 at 10:23 -0400, Jan Vesely wrote:
>> Fixes: 7d8c9464081634f053e16e5eac9655a12fae1dc4
>> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
>
> ping.
> Emil, should I just drop this patch?
> another alternative is to remove the list implementation entirely,
> since nobody noticed when it got broken.
>
libdrm stuff has been under my radar for a bit.
I'll try to take a look tomorrow/the day after.

I've been travelling over the last few days and I'm still in the
middle of it :-\

-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH libdrm 1/1] drmsltest: Check expected neighbours
  2017-08-16  1:51   ` Emil Velikov
@ 2017-08-21 12:19     ` Emil Velikov
  0 siblings, 0 replies; 5+ messages in thread
From: Emil Velikov @ 2017-08-21 12:19 UTC (permalink / raw)
  To: Jan Vesely; +Cc: ML dri-devel

On 16 August 2017 at 02:51, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> Hi Jan,
>
> On 14 August 2017 at 03:44, Jan Vesely <jan.vesely@rutgers.edu> wrote:
>> On Fri, 2017-07-28 at 10:23 -0400, Jan Vesely wrote:
>>> Fixes: 7d8c9464081634f053e16e5eac9655a12fae1dc4
>>> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
>>
>> ping.
>> Emil, should I just drop this patch?
>> another alternative is to remove the list implementation entirely,
>> since nobody noticed when it got broken.
>>
> libdrm stuff has been under my radar for a bit.
> I'll try to take a look tomorrow/the day after.
>
> I've been travelling over the last few days and I'm still in the
> middle of it :-\
>
Thanks for the patience Jan.
Pushed the patch to master.

-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH libdrm 1/1] drmsltest: Check expected neighbours
@ 2017-05-26 17:15 Jan Vesely
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Vesely @ 2017-05-26 17:15 UTC (permalink / raw)
  To: dri-devel, Emil Velikov

This test cements behaviour set in
3b2ee2b5bfc0d68525fee936e51297a9b6c629f1 drmSL: Fix neighbor lookup (2015-02-27)

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---

 tests/drmsl.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/tests/drmsl.c b/tests/drmsl.c
index d0ac0ef..d1b59a8 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);
-- 
2.9.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-21 12:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-28 14:23 [PATCH libdrm 1/1] drmsltest: Check expected neighbours Jan Vesely
2017-08-14  2:44 ` Jan Vesely
2017-08-16  1:51   ` Emil Velikov
2017-08-21 12:19     ` Emil Velikov
  -- strict thread matches above, loose matches on Subject: below --
2017-05-26 17:15 Jan Vesely

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.