public inbox for location@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: Valters Jansons <valter.jansons@gmail.com>
Cc: location@lists.ipfire.org
Subject: Re: [PATCH] tests: Ensure loc_database_lookup finds a match
Date: Mon, 7 Apr 2025 11:10:10 +0100	[thread overview]
Message-ID: <E171B241-4469-4621-B7E7-51109425C447@ipfire.org> (raw)
In-Reply-To: <20250407012929.19255-1-valter.jansons@gmail.com>

Hello Valters,

Thank you for this patch.

I have merged it. Indeed there should be no error returned, but the result pointer should be NULL. That was a change in the API but it should always have been like this.

On all the architectures that we are now testing on Jenkins, this is building just fine. I currently don’t build for hppa.

-Michael

> On 7 Apr 2025, at 02:29, Valters Jansons <valter.jansons@gmail.com> wrote:
> 
> Commit 9e72b8a modified the lookup function to return 0 even if no
> matches are found. As result, the test case could pass even if the
> database lookup did not find any matches.
> 
> This commit restores the original intent of the test case, by adding
> a failure condition when `network1` is NULL. This is similar to how
> the subsequent test case was modified for the inverse condition.
> ---
> I was checking https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021952
> and wondering why the "Could not look up 2001:db8::" issue would
> suddenly disappear. This change popped up as a potential reason.
> So I am expecting hppa builds will start failing intermittently again.
> 
> src/test-network.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/test-network.c b/src/test-network.c
> index 0cac1a4..73062f4 100644
> --- a/src/test-network.c
> +++ b/src/test-network.c
> @@ -351,7 +351,7 @@ int main(int argc, char** argv) {
> 
> // Lookup an address in the subnet
> err = loc_database_lookup_from_string(db, "2001:db8::", &network1);
> - if (err) {
> + if (err || !network1) {
> fprintf(stderr, "Could not look up 2001:db8::\n");
> exit(EXIT_FAILURE);
> }
> -- 
> 2.49.0
> 
> 



      reply	other threads:[~2025-04-07 10:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  1:29 Valters Jansons
2025-04-07 10:10 ` Michael Tremer [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=E171B241-4469-4621-B7E7-51109425C447@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=location@lists.ipfire.org \
    --cc=valter.jansons@gmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox