test: fix ntp_core unit test to disable source selection

If the randomly generated timestamps are close to the current time, the
source can be selected for synchronization, which causes a crash when
logging the source name due to uninitialized ntp_sources.

Specify the source with the noselect option to prevent selection.
This commit is contained in:
Miroslav Lichvar 2022-08-01 16:20:13 +02:00
parent cd1a666e1b
commit 0c2cdd2fb1

View file

@ -385,7 +385,7 @@ add_dummy_auth(NTP_AuthMode auth_mode, uint32_t key_id, NTP_Packet *packet, NTP_
void
test_unit(void)
{
char source_line[] = "127.0.0.1 maxdelaydevratio 1e6";
char source_line[] = "127.0.0.1 maxdelaydevratio 1e6 noselect";
char conf[][100] = {
"allow",
"port 0",