summaryrefslogtreecommitdiffstats
path: root/src/libudev
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-12-23 17:49:57 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-12-23 18:02:18 +0100
commit8161f6086e56dc494a976a6eba14d3d4286ef6a0 (patch)
tree0d9cb3605e25c0b3505a324be754414d62f04162 /src/libudev
parentlog: introduce a knob to make assert_return() critical (diff)
downloadsystemd-8161f6086e56dc494a976a6eba14d3d4286ef6a0.tar.xz
systemd-8161f6086e56dc494a976a6eba14d3d4286ef6a0.zip
test: make assert_return() critical by default on fuzzer and unit tests
Several test cases intentionally trigger assert_return(). So, to avoid the entire test fails, this introduces several macros that tentatively make assert_return() not critical.
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/test-libudev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libudev/test-libudev.c b/src/libudev/test-libudev.c
index e05a062c8e..99934c6f03 100644
--- a/src/libudev/test-libudev.c
+++ b/src/libudev/test-libudev.c
@@ -339,6 +339,9 @@ static void test_hwdb(struct udev *udev, const char *modalias) {
if (!hwdb)
log_warning_errno(errno, "Failed to open hwdb: %m");
+ SAVE_ASSERT_RETURN_IS_CRITICAL;
+ log_set_assert_return_is_critical(hwdb);
+
udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, modalias, 0))
log_info("'%s'='%s'", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));