Skip to content

Commit 00e8450

Browse files
committed
Add tests for new_event function
Added event_test.c with deterministic stubs that exercise new_event subject/object cache reuse, eviction, skip-path handling, and needs_flush transitions to validate resulting cache state and event fields. Registered the new test in src/tests/Makefile.am, linking against the required static objects so it builds alongside existing test binaries. Documented the event_test cache harness strategy and outlined how to extend the scenarios for future coverage.
1 parent a03d7eb commit 00e8450

2 files changed

Lines changed: 545 additions & 1 deletion

File tree

src/tests/Makefile.am

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
CONFIG_CLEAN_FILES = *.orig *.cur
2323
check_PROGRAMS = avl_test gid_proc_test uid_proc_test escape_test \
24-
attr_sets_test elf_file_test rules_test
24+
attr_sets_test elf_file_test rules_test event_test
2525

2626
AM_CPPFLAGS = -I${top_srcdir}/src/library/
2727
AM_CFLAGS = -std=gnu11
@@ -40,6 +40,17 @@ elf_file_test_LDADD = ${top_builddir}/src/.libs/libfapolicyd.la
4040
rules_test_SOURCES = rules_test.c
4141
rules_test_LDADD = ${top_builddir}/src/.libs/libfapolicyd.la
4242
rules_test_CPPFLAGS = -I${top_srcdir}/src/library/ -DTEST_BASE=\"${top_srcdir}\"
43+
event_test_SOURCES = event_test.c
44+
event_test_LDADD = \
45+
${top_builddir}/src/library/libfapolicyd_la-event.o \
46+
${top_builddir}/src/library/libfapolicyd_la-lru.o \
47+
${top_builddir}/src/library/libfapolicyd_la-subject.o \
48+
${top_builddir}/src/library/libfapolicyd_la-subject-attr.o \
49+
${top_builddir}/src/library/libfapolicyd_la-object.o \
50+
${top_builddir}/src/library/libfapolicyd_la-object-attr.o \
51+
${top_builddir}/src/library/libfapolicyd_la-attr-sets.o \
52+
${top_builddir}/src/library/libfapolicyd_la-avl.o
53+
event_test_DEPENDENCIES = $(event_test_LDADD)
4354

4455
if WITH_RPM
4556
check_PROGRAMS += filter_test

0 commit comments

Comments
 (0)