mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: [musl] Re: [PATCH] iconv: Add check null-check for scd pointer
Date: Thu, 11 Apr 2024 20:43:52 +0200	[thread overview]
Message-ID: <ZhgvaB1T7T9IGYgT@voyager> (raw)
In-Reply-To: <CAEh9MGS=03a9_MMQTC6U1SVkf5FKSVUE26bMJizwrckHzBWfMw@mail.gmail.com>

Am Thu, Apr 11, 2024 at 08:56:56PM +0300 schrieb Maks Mishin:
> Rich, I'm sorry, but it's now always possible to test a particular function.
> Can you tell me how you are testing the library?
> This will help me make more meaningful patches.

You write tests and link them against musl, and then execute them. The
most comprehensive test suite is probably libc-test
(http://nsz.repo.hu/git/?p=libc-test), but for this it would have been
overkill. In case of something like iconv(), I would probably create a
utility similar to iconv(1), link it against musl, then write a shell
script with a few test cases. If you get the expected output, everything
is fine. If not, you broke something.

It would be harder to test something like if_nameindex(), which has a
different right answer on every given machine. But iconv() does not
depend on anything in the system. You just give it input charset, output
charset, and an input, and it generates the same output every time, or
else it is broken.

Ciao,
Markus


      reply	other threads:[~2024-04-11 18:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240324192503.16512-1-maks.mishinFZ@gmail.com>
2024-03-24 19:33 ` Rich Felker
2024-03-25  8:53   ` alice
2024-04-11 17:56     ` Maks Mishin
2024-04-11 18:43       ` Markus Wichmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZhgvaB1T7T9IGYgT@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).