feat: add sched GC predicate statics; wire sel_optimize_set(1) in sched_init (6-4, 6-9)
This commit is contained in:
parent
72546d3a22
commit
acda9bb228
3 changed files with 39 additions and 1 deletions
|
|
@ -5,6 +5,8 @@
|
|||
#include <stdatomic.h>
|
||||
#include <unity/unity.h>
|
||||
|
||||
#include "resreq.h"
|
||||
|
||||
/* Minimal struct declaration to verify atomic fields exist.
|
||||
* We avoid including scheduler.h to prevent dependency on capnp headers. */
|
||||
typedef struct {
|
||||
|
|
@ -87,6 +89,20 @@ test_scheduler_t_has_atomic_gc_fields(void)
|
|||
TEST_ASSERT_EQUAL_INT(0, atomic_load(&sched.staging_merge_complete));
|
||||
}
|
||||
|
||||
static void
|
||||
test_sel_optimize_set_at_scheduler_startup(void)
|
||||
{
|
||||
/* sel_optimize_set(1) is called in sched_init.
|
||||
* Since we can't call sched_init (it starts threads/network),
|
||||
* verify the setter/getter contract directly. */
|
||||
sel_optimize_set(1);
|
||||
TEST_ASSERT_EQUAL_INT(1, sel_get_optimize_level());
|
||||
/* reset for clean test isolation */
|
||||
#ifdef UNIT_TEST
|
||||
sel_optimize_test_reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
#define TEST(x) \
|
||||
do { \
|
||||
if (check_test(&arguments, #x)) { \
|
||||
|
|
@ -101,6 +117,7 @@ int main(int argc, char* argv[])
|
|||
UNITY_BEGIN();
|
||||
|
||||
TEST(test_scheduler_t_has_atomic_gc_fields);
|
||||
TEST(test_sel_optimize_set_at_scheduler_startup);
|
||||
|
||||
return UNITY_END();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue