]> git.ipfire.org Git - people/ms/libloc.git/commit
tests: Ensure loc_database_lookup finds a match
authorValters Jansons <valter.jansons@gmail.com>
Mon, 7 Apr 2025 01:29:29 +0000 (04:29 +0300)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 7 Apr 2025 08:55:23 +0000 (08:55 +0000)
commitc0898d1dc3d441119d5560df938aff68a19f9e48
treea0bc445df7b560c2923441d8e82c8809cc83a56d
parente2c4cd7b67ad4161809dea21e5e2d2cd203fc56a
tests: Ensure loc_database_lookup finds a match

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.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/test-network.c