mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
test-lldp: use memcmp
to compare bytes (#8054)
Technically, `data` is a sequence of bytes without a trailing zero, so the use of `memcmp` seems to be logical here. Besides, this helps get around a bug that makes `asan` report the false positive mentioned in #8052. Closes #8052.
This commit is contained in:
parent
302af1c250
commit
ce691f31aa
@ -139,7 +139,7 @@ static void test_receive_basic_packet(sd_event *e) {
|
||||
assert_se(sd_lldp_neighbor_get_port_id(neighbors[0], &type, &data, &length) == 0);
|
||||
assert_se(type == SD_LLDP_PORT_SUBTYPE_INTERFACE_NAME);
|
||||
assert_se(length == 3);
|
||||
assert_se(strneq((char *) data, "1/3", 3));
|
||||
assert_se(!memcmp(data, "1/3", 3));
|
||||
|
||||
assert_se(sd_lldp_neighbor_get_port_description(neighbors[0], &str) == 0);
|
||||
assert_se(streq(str, "Port"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user