[PATCH fbtest 15/17] test013: Fix off-by-one error in maximum circle calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A circle with radius R has an actual diameter of 2*R+1 instead of 2*R.

Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
---
 tests/test013.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test013.c b/tests/test013.c
index 96fc1cd216b81b0a..25904270901eaded 100644
--- a/tests/test013.c
+++ b/tests/test013.c
@@ -63,10 +63,10 @@ static enum test_res test013_func(void)
 
     while (1)
 	for (i = 0; i < sizeof(sizes)/sizeof(*sizes); i++) {
-	    size = sizes[i];
+	    size = sizes[i] + 1;
 	    if (size > fb_var.xres_virtual || size > fb_var.yres_virtual)
 		goto out;
-	    benchmark_circles(size/2);
+	    benchmark_circles(sizes[i]/2);
 	    sizes[i] *= 10;
 	}
 
-- 
2.34.1





[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux