mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
fuzz-link-parser: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing assertion logs the values involved.
This commit is contained in:
1 parent
5fcce5b5fa
commit
c36fdc94a2
1 file changed
+4
-3
@@ -3,6 +3,7 @@
|
||||
#include "fd-util.h"
|
||||
#include "fuzz.h"
|
||||
#include "link-config.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
@@ -15,12 +16,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
|
||||
fuzz_setup_logging();
|
||||
|
||||
assert_se(fmkostemp_safe(filename, "r+", &f) == 0);
|
||||
ASSERT_OK_ZERO(fmkostemp_safe(filename, "r+", &f));
|
||||
if (size != 0)
|
||||
assert_se(fwrite(data, size, 1, f) == 1);
|
||||
ASSERT_EQ(fwrite(data, size, 1, f), (size_t) 1);
|
||||
|
||||
fflush(f);
|
||||
assert_se(link_config_ctx_new(&ctx) >= 0);
|
||||
ASSERT_OK(link_config_ctx_new(&ctx));
|
||||
(void) link_load_one(ctx, filename);
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user