summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-04-22 17:32:51 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-04-22 20:28:33 +0200
commit8b2f2a568d39755ff97a0a0c8b9e17ec564f24dc (patch)
tree12946cc33adf0fcf93587d6a6d5d2c11960e6aea /src/test
parentMerge pull request #32412 from weblate/weblate-systemd-main (diff)
downloadsystemd-8b2f2a568d39755ff97a0a0c8b9e17ec564f24dc.tar.xz
systemd-8b2f2a568d39755ff97a0a0c8b9e17ec564f24dc.zip
test: ensure all architecture ids we define definitely fit into .v/ patterns
Just some safety checks so that we never regress on this: make sure all architectur IDs we define are embeddable safely in .v/ entry file names.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-architecture.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/test-architecture.c b/src/test/test-architecture.c
index b245e862c8..6b7777d284 100644
--- a/src/test/test-architecture.c
+++ b/src/test/test-architecture.c
@@ -3,6 +3,7 @@
#include "architecture.h"
#include "errno-util.h"
#include "log.h"
+#include "path-util.h"
#include "tests.h"
#include "virt.h"
@@ -49,5 +50,17 @@ int main(int argc, char *argv[]) {
log_info("primary library architecture=" LIB_ARCH_TUPLE);
+ for (Architecture i = 0; i < _ARCHITECTURE_MAX; i++) {
+ const char *n = ASSERT_PTR(architecture_to_string(i));
+
+ /* Let's validate that all architecture names we define are good for inclusion in .v/
+ * filename patterns which use "." and "_" as field separators in the filenames. */
+ assert(filename_part_is_valid(n));
+ assert(!strchr(n, '_'));
+ assert(!strchr(n, '.'));
+
+ log_info("Good for inclusion in .v/ filenames: %s", n);
+ }
+
return 0;
}