From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BE0810E0C4 for ; Mon, 14 Nov 2022 20:11:15 +0000 (UTC) Date: Mon, 14 Nov 2022 12:08:24 -0800 Message-ID: <878rkdpadj.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Bhanuprakash Modem In-Reply-To: <20221104020005.4098049-1-bhanuprakash.modem@intel.com> References: <20221102110428.4049549-1-bhanuprakash.modem@intel.com> <20221104020005.4098049-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [V2 i-g-t] tests/kms_cursor_crc: Fix SIGABRT in dynamic subtests List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Thu, 03 Nov 2022 19:00:05 -0700, Bhanuprakash Modem wrote: > Hi Bhanu, could you please fix the compile warnings below. Thanks. > @@ -700,65 +700,78 @@ static void test_rapid_movement(data_t *data) > igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh); > } > > -static void run_size_tests(data_t *data, void (*testfunc)(data_t *), > - int w, int h) > +static void run_size_tests(data_t *data, int w, int h) > { > enum pipe pipe; > + struct { > + const char *name; > + void (*testfunc)(data_t *); > + const char *desc; > + } size_tests[] =3D { > + { "cursor-onscreen", test_crc_onscreen, > + "Check if a given-size cursor is well-positioned inside the screen." = }, > + { "cursor-offscreen", test_crc_offscreen, > + "Check if a given-size cursor is well-positioned outside the screen."= }, > + { "cursor-sliding", test_crc_sliding, > + "Check the smooth and pixel-by-pixel given-size cursor movements on h= orizontal, vertical and diagonal." }, > + { "cursor-random", test_crc_random, > + "Check random placement of a cursor with given size." }, > + { "cursor-rapid-movement", test_rapid_movement, > + "Check the rapid update of given-size cursor movements." }, > + }; > + int i; > + char name[16]; > > if (w =3D=3D 0 && h =3D=3D 0) { > w =3D data->cursor_max_w; > h =3D data->cursor_max_h; > > - /* > - * No point in doing the "max-size" test if > - * it was already covered by the other tests. > - */ > - if ((w =3D=3D h) && (w <=3D 512) && (h <=3D 512) && > - is_power_of_two(w) && is_power_of_two(h)) { > - igt_info("Cursor max size %dx%d already covered by other tests\n", w,= h); > - return; > - } > + strcpy(name, "max-size"); > + } else { > + snprintf(name, sizeof(name), "%dx%d", w, h); [305/1132] Compiling C object tests/kms_cursor_crc.p/kms_cursor_crc.c.o ../tests/kms_cursor_crc.c: In function =A1run_size_tests.constprop=A2: ../tests/kms_cursor_crc.c:731:50: warning: =A1%d=A2 directive output may be= truncated writing between 1 and 11 bytes into a region of size between 4 a= nd 14 [-Wformat-truncation=3D] 731 | snprintf(name, sizeof(name), "%dx%d", w, h); | ^~ ../tests/kms_cursor_crc.c:731:46: note: directive argument in the range [-2= 147483648, 1024] 731 | snprintf(name, sizeof(name), "%dx%d", w, h); | ^~~~~~~ In file included from /usr/include/stdio.h:894, from ../lib/igt_core.h:41, from ../lib/drmtest.h:39, from ../lib/igt.h:27, from ../tests/kms_cursor_crc.c:25: In function =A1snprintf=A2, inlined from =A1run_size_tests.constprop=A2 at ../tests/kms_cursor_crc.= c:731:3: /usr/include/bits/stdio2.h:71:10: note: =A1__builtin___snprintf_chk=A2 outp= ut between 4 and 24 bytes into a destination of size 16 71 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - = 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~ 72 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~