resolve: use enum for several fields

Unfortunately, we have already exposed dnssec with hyphen, so we cannot
change it as enum.
This commit is contained in:
Yu Watanabe
2025-11-10 11:02:33 +09:00
parent c6b6ac63ea
commit 76c674ec25
4 changed files with 75 additions and 7 deletions
+6
View File
@@ -13,6 +13,7 @@
#include "json-util.h"
#include "network-util.h"
#include "pretty-print.h"
#include "resolve-util.h"
#include "tests.h"
#include "varlink-idl-util.h"
#include "varlink-io.systemd.h"
@@ -512,13 +513,18 @@ static void test_enum_to_string_name(const char *n, const sd_varlink_symbol *sym
TEST(enums_idl) {
TEST_IDL_ENUM(BootEntryType, boot_entry_type, vl_type_BootEntryType);
TEST_IDL_ENUM_TO_STRING(BootEntrySource, boot_entry_source, vl_type_BootEntrySource);
TEST_IDL_ENUM(PartitionDesignator, partition_designator, vl_type_PartitionDesignator);
TEST_IDL_ENUM(LinkAddressState, link_address_state, vl_type_LinkAddressState);
TEST_IDL_ENUM_TO_STRING(LinkAddressState, link_address_state, vl_type_LinkAddressState);
TEST_IDL_ENUM(LinkOnlineState, link_online_state, vl_type_LinkOnlineState);
TEST_IDL_ENUM_TO_STRING(LinkOnlineState, link_online_state, vl_type_LinkOnlineState);
TEST_IDL_ENUM(AddressFamily, link_required_address_family, vl_type_LinkRequiredAddressFamily);
TEST_IDL_ENUM_TO_STRING(AddressFamily, link_required_address_family, vl_type_LinkRequiredAddressFamily);
TEST_IDL_ENUM(DnsOverTlsMode, dns_over_tls_mode, vl_type_DNSOverTLSMode);
TEST_IDL_ENUM(ResolveSupport, resolve_support, vl_type_ResolveSupport);
}
DEFINE_TEST_MAIN(LOG_DEBUG);