Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3141522rwl; Sun, 2 Apr 2023 01:02:22 -0700 (PDT) X-Google-Smtp-Source: AKy350aCOrwlFztZyB7JACy/1OK3JPu/kvmLJcGYBoTuXiHp72ZpOKYqQuIq6B9+Gy1qyNReb2vZ X-Received: by 2002:a17:906:6a2a:b0:878:711d:9310 with SMTP id qw42-20020a1709066a2a00b00878711d9310mr36391499ejc.1.1680422541751; Sun, 02 Apr 2023 01:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680422541; cv=none; d=google.com; s=arc-20160816; b=mTYGhXdlqrmQGnX9NjRJBvB3EQALfGd9nxEvDVY8xy0x2IeMrAr78Kg6i2XRdh3Ubc gK1m+L6TJkTgmYPvyJn7uGnH0Fmx+onyeJS3PTRIC+XZnyZ59rGjVd7UJI6WoqKfvnLY WZIpmAShKexVaCtW9WplPhcnO6TS+ZUI4sZNngZNaaXscxudz1zcNrHnM+aM1wuY96Dn l51GRc1iIbxOttX2nLTRHXXBFBGb0KogI1j8fqKYmQFd00RYv4X8459I0KuSKaA5jDOo ni1yA2Sv2xzyF+zoaVqTzH7ILtdrAc+0YUY1qx8pcB5VI1YUe7CjrykZVY9uFD0U7+Xh EHbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rL+xmQ7sAStyV6Ok+HwN+36Qa6cRnj2HwZDh+v02KVc=; b=pqg+xybEgTPFjXJ3spmA9rrQ/rYu9Ycskn7PVCHQo4e3Mrp0OTb9tvlbJOgrt/zyQx gMOLhnrIFJC7Rcy97NNwgDKXZNqTfWH709n6tYeCMo52Nlfa9zzk6bjdAFySC4kzZ2d3 3WVgCdXuLgO18MQcykdC58TBnK96h7ghEDbwEnWuUUockCgzDe3o82IFTfDwC5wOQGmx RrV7L3F+yaqeLqAHkMTZgbss9tjzGi1kgiJrqnkJP7KWDFxJJVxV4KOb0PD8dxzTDGnK 64QP5WnBFA1eUzeEEDN+EMg894Mmkovwm/PK01AbgACKHE/tDvErC2fOzAzYDoMn+tNT EO8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h18-20020a1709063b5200b00945201cecbdsi5665575ejf.996.2023.04.02.01.01.57; Sun, 02 Apr 2023 01:02:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230090AbjDBHvS (ORCPT + 99 others); Sun, 2 Apr 2023 03:51:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjDBHvQ (ORCPT ); Sun, 2 Apr 2023 03:51:16 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 792BCCC19; Sun, 2 Apr 2023 00:51:15 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 3327pAp0018344; Sun, 2 Apr 2023 09:51:10 +0200 Date: Sun, 2 Apr 2023 09:51:10 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 3/3] tools/nolibc: add testcases for vfprintf Message-ID: References: <20230328-nolibc-printf-test-v1-0-d7290ec893dd@weissschuh.net> <20230328-nolibc-printf-test-v1-3-d7290ec893dd@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230328-nolibc-printf-test-v1-3-d7290ec893dd@weissschuh.net> X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 28, 2023 at 09:01:31PM +0000, Thomas Wei?schuh wrote: > vfprintf() is complex and so far did not have proper tests. This is an excellent idea, I totally agree, and I wouldn't be surprised if there were still bugs there. > + switch (test + __LINE__ + 1) { > + CASE_TEST(empty); EXPECT_VFPRINTF(0, "", ""); break; > + CASE_TEST(simple); EXPECT_VFPRINTF(3, "foo", "foo"); break; > + CASE_TEST(string); EXPECT_VFPRINTF(3, "foo", "%s", "foo"); break; > + CASE_TEST(number); EXPECT_VFPRINTF(4, "1234", "%d", 1234); break; > + CASE_TEST(negnumber); EXPECT_VFPRINTF(5, "-1234", "%d", -1234); break; > + CASE_TEST(unsigned); EXPECT_VFPRINTF(5, "12345", "%u", 12345); break; > + CASE_TEST(char); EXPECT_VFPRINTF(1, "c", "%c", 'c'); break; > + CASE_TEST(hex); EXPECT_VFPRINTF(1, "f", "%x", 0xf); break; > + CASE_TEST(pointer); EXPECT_VFPRINTF(3, "0x0", "%p", NULL); break; I don't see a reason why not to move them to the stdlib category, since these tests are there to validate that the libc-provided functions do work. Maybe you intended to further extend it ? In this case maybe we could move that to an "stdio" category then but I'd rather avoid having one category per function or it will quickly become annoying to select groups of tests. So let's just prefix these test names with "printf_" and either merge them with "stdlib" or name the category "stdio", as you prefer. Thank you! Willy