summaryrefslogtreecommitdiffstats
path: root/src/shared/netif-naming-scheme.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-10-16 12:53:10 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-10-16 21:21:54 +0200
commit386256e69900d02d1413603a0066eb945ca2ec3a (patch)
tree115a2cdbffa0e8b7a9aca8ef37bfaae755495e94 /src/shared/netif-naming-scheme.c
parentshared/netif-naming-scheme: align tables (diff)
downloadsystemd-386256e69900d02d1413603a0066eb945ca2ec3a.tar.xz
systemd-386256e69900d02d1413603a0066eb945ca2ec3a.zip
test: make sure that the default naming scheme name maps back to itself
We were testing the that C constant is defined, but we weren't actually testing that the string name maps back to itself. This would catch the issue fixed by the grandparent commit. The test for the default name is moved to the test file to keep the tests together. The define is renamed to not have "_TEST" in the name. The issue here is complicated by the fact that we allow downstreams to inject additional fields, so we don't know the name of the default scheme if it not set with -Ddefault-net-naming-scheme=, so _DEFAULT_NET_NAMING_SCHEME[_TEST] is not defined in all cases, but at least in principle it could be used in other places. If it exists, it is fully valid.
Diffstat (limited to 'src/shared/netif-naming-scheme.c')
-rw-r--r--src/shared/netif-naming-scheme.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/shared/netif-naming-scheme.c b/src/shared/netif-naming-scheme.c
index 7fe19d4877..fbaf5c5a60 100644
--- a/src/shared/netif-naming-scheme.c
+++ b/src/shared/netif-naming-scheme.c
@@ -6,13 +6,6 @@
#include "string-util.h"
#include "string-table.h"
-#ifdef _DEFAULT_NET_NAMING_SCHEME_TEST
-/* The primary purpose of this check is to verify that _DEFAULT_NET_NAMING_SCHEME_TEST
- * is a valid identifier. If an invalid name is given during configuration, this will
- * fail with a name error. */
-assert_cc(_DEFAULT_NET_NAMING_SCHEME_TEST >= 0);
-#endif
-
static const NamingScheme naming_schemes[] = {
{ "v238", NAMING_V238 },
{ "v239", NAMING_V239 },