lldp: add test coverage for sd_lldp_get_neighbors() with multiple neighbors
authorFilipe Brandenburger <filbranden@google.com>
Thu, 6 Dec 2018 07:58:58 +0000 (23:58 -0800)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Dec 2018 10:28:10 +0000 (11:28 +0100)
commit7f09920585f65c62e042af77b47b2a217e46d779
treedf8056b36ac73b658c1e11965121bd08718608ae
parent8ae1a821b36683fae6514dcd317a2049d0824779
lldp: add test coverage for sd_lldp_get_neighbors() with multiple neighbors

In particular, check that the order of the results is consistent.

This test coverage will be useful in order to refactor the compare_func
used while sorting the results.

When introduced, this test also uncovered a memory leak in sd_lldp_stop(),
which was then fixed by a separate commit using a specialized function
as destructor of the LLDP Hashmap.

Tested:
  $ ninja -C build/ test
  $ valgrind --leak-check=full build/test-lldp
src/libsystemd-network/test-lldp.c