Skip to content

Agent KB_tests_p2

grisun0 edited this page Oct 23, 2026 · 12 revisions

Subsystem: tests (page 2 of 2)

Previous: KB_tests.md

tests/test_pci.c

  • Doc: Docstring: Host test for headers/drivers/pci.h (make test-pci).
  • Layer: testing
  • Language: c
  • Symbols:
    • fake_outl (function, line 39) static void fake_outl(unsigned short port, unsigned val)
    • fake_inl (function, line 60) static unsigned fake_inl(unsigned short port)
    • set_dev (function, line 73) static void set_dev(unsigned bus, unsigned dev, unsigned func, unsigned id, u...
    • main (function, line 79) int main(void)
    • CHECK (macro, line 26) #define CHECK(cond, msg)
    • FAKE_BUSES (macro, line 33) #define FAKE_BUSES
    • FAKE_REGS (macro, line 34) #define FAKE_REGS
  • Depends on: headers/drivers/pci.h

tests/test_pcm.c

  • Doc: Host-side unit test for the PCM ring buffer (headers/pcm_ring.h).
  • Layer: testing
  • Language: c
  • Symbols:
    • t_roundtrip (function, line 28) static void t_roundtrip(void)
    • t_wrap (function, line 44) static void t_wrap(void)
    • t_overrun (function, line 61) static void t_overrun(void)
    • t_underrun (function, line 75) static void t_underrun(void)
    • t_zero_cap (function, line 91) static void t_zero_cap(void)
    • lcg_next (function, line 104) static unsigned lcg_next(void)
    • t_model (function, line 109) static void t_model(void)
    • main (function, line 144) int main(void)
    • CHECK (macro, line 21) #define CHECK(cond, msg)
  • Depends on: headers/pcm_ring.h, kernel/string.c

tests/test_percpu_rq.c

  • Doc: Docstring: Host test for kernel/percpu_rq.c (make test-percpu-rq).
  • Layer: testing
  • Language: c
  • Symbols:
    • main (function, line 24) int main(void)
    • CHECK (macro, line 17) #define CHECK(cond, msg)
  • Depends on: headers/percpu_rq.h

tests/test_pipe.c

  • Doc: Docstring: Host test for headers/pipe.h (make test-pipe).
  • Layer: testing
  • Language: c
  • Symbols:
    • main (function, line 23) int main(void)
    • CHECK (macro, line 16) #define CHECK(cond, msg)
  • Depends on: headers/pipe.h

tests/test_ps2_keymap.c

  • Doc: test_ps2_keymap - host suite for the PS/2 set 1 to keysym translator.
  • Layer: testing
  • Language: c
  • Symbols:
    • check (function, line 19) static void check(int cond, const char *name)
    • feed_seq (function, line 29) static int feed_seq(ps2_state *s, const unsigned char *seq, int n, ps2_key *out)
    • press (function, line 36) static int press(ps2_state *s, unsigned char code, ps2_key *out)
    • release (function, line 41) static int release(ps2_state *s, unsigned char code, ps2_key *out)
    • test_letters_and_shift (function, line 45) static void test_letters_and_shift(void)
    • test_caps_lock (function, line 69) static void test_caps_lock(void)
    • test_punctuation (function, line 90) static void test_punctuation(void)
    • test_control_key_text (function, line 111) static void test_control_key_text(void)
    • test_chords_have_no_text (function, line 128) static void test_chords_have_no_text(void)
    • test_extended_keys (function, line 150) static void test_extended_keys(void)
    • test_function_keys (function, line 202) static void test_function_keys(void)
    • test_keypad_num_lock (function, line 218) static void test_keypad_num_lock(void)
    • test_prefix_sequences (function, line 263) static void test_prefix_sequences(void)
    • test_fail_closed (function, line 280) static void test_fail_closed(void)
    • main (function, line 293) int main(void)
  • Depends on: kernel/string.c, progs/freedomui/ps2_keymap.h

tests/test_randmix.c

  • Doc: host test for the getrandom mixer in randmix.h
  • Layer: testing
  • Language: c
  • Symbols:
    • popcount64 (function, line 18) static int popcount64(unsigned long x)
    • main (function, line 24) int main(void)
    • CHECK (macro, line 16) #define CHECK(c, m)
  • Depends on: headers/randmix.h

tests/test_rcu.c

  • Doc: Docstring: Host test for kernel/rcu.c (make test-rcu).
  • Layer: testing
  • Language: c
  • Symbols:
    • rcu_host_cpu (function, line 19) cpu_t *rcu_host_cpu(void)
    • test_cb (function, line 23) static void test_cb(void *arg)
    • main (function, line 37) int main(void)
    • CHECK (macro, line 30) #define CHECK(cond, msg)
  • Depends on: headers/rcu.h

tests/test_rtc.c

  • Doc: host test for the pure date math in drivers/rtc.c
  • Layer: testing
  • Language: c
  • Symbols:
    • main (function, line 18) int main(void)
    • CHECK (macro, line 16) #define CHECK(c, m)
  • Depends on: headers/rtc.h

tests/test_sanitize.c

  • Doc: Docstring: Host test for sanitize.h (make test-sanitize).
  • Layer: testing
  • Language: c
  • Symbols:
    • user_range_ok (function, line 20) int user_range_ok(unsigned long p, unsigned long len)
    • user_str_ok (function, line 26) int user_str_ok(unsigned long p, unsigned long maxlen)
    • kmemcpy (function, line 32) void *kmemcpy(void *dst, const void *src, unsigned long n)
    • range_probe (function, line 48) static long range_probe(unsigned long p, long len)
    • str_probe (function, line 54) static long str_probe(unsigned long p)
    • copy_probe (function, line 61) static long copy_probe(unsigned long uptr, long count, unsigned long elemsz)
    • main (function, line 67) int main(void)
    • EFAULT (macro, line 13) #define EFAULT
    • CHECK (macro, line 41) #define CHECK(cond, msg)
  • Depends on: headers/sanitize.h, kernel/string.c

tests/test_seccomp_bpf.c

  • Doc: Docstring: Host test for kernel/seccomp_bpf.c (make test-seccomp-bpf).
  • Layer: testing
  • Language: c
  • Symbols:
    • data_for (function, line 34) static sbpf_data data_for(int nr, unsigned long long a2)
    • test_freedom_shape (function, line 43) static void test_freedom_shape(void)
    • test_check_refusals (function, line 88) static void test_check_refusals(void)
    • test_scratch_flow (function, line 130) static void test_scratch_flow(void)
    • test_alu_and_jumps (function, line 150) static void test_alu_and_jumps(void)
    • test_action_rank (function, line 199) static void test_action_rank(void)
    • main (function, line 210) int main(void)
    • CHECK (macro, line 17) #define CHECK(cond, msg)
    • STMT (macro, line 21) #define STMT(c, k)
    • JUMP (macro, line 22) #define JUMP(c, k, t, f)
    • NR_READ (macro, line 24) #define NR_READ
    • NR_WRITE (macro, line 25) #define NR_WRITE
    • NR_OPEN (macro, line 26) #define NR_OPEN
    • NR_MMAP (macro, line 27) #define NR_MMAP
    • NR_MPROTECT (macro, line 28) #define NR_MPROTECT
    • PROT_EXEC (macro, line 29) #define PROT_EXEC
    • ARGS2_OFF (macro, line 30) #define ARGS2_OFF
  • Depends on: headers/seccomp_bpf.h, kernel/string.c

tests/test_select_map.c

  • Doc: Docstring: Host test for headers/select_map.h (make test-select-map).
  • Layer: testing
  • Language: c
  • Symbols:
    • test_bit_ops (function, line 25) static void test_bit_ops(void)
    • test_count_and_build (function, line 50) static void test_count_and_build(void)
    • test_union_events (function, line 72) static void test_union_events(void)
    • test_result_classes (function, line 90) static void test_result_classes(void)
    • test_result_only_requested (function, line 123) static void test_result_only_requested(void)
    • test_result_hup_read_only (function, line 142) static void test_result_hup_read_only(void)
    • test_badfd (function, line 160) static void test_badfd(void)
    • main (function, line 169) int main(void)
    • CHECK (macro, line 18) #define CHECK(cond, msg)
  • Depends on: headers/select_map.h, kernel/string.c

tests/test_sign.c

  • Doc: Docstring: Host test for kernel/ed25519.c plus headers/sign.h.
  • Layer: testing
  • Language: c
  • Symbols:
    • hexval (function, line 27) static unsigned hexval(char c)
    • unhex (function, line 33) static void unhex(unsigned char *out, const char *in, unsigned n)
    • main (function, line 51) int main(void)
    • CHECK (macro, line 20) #define CHECK(cond, msg)
  • Depends on: headers/sign.h, kernel/string.c

tests/test_sync.c

  • Doc: Host-side unit test for the blocking sync primitives (kernel/sync.c).
  • Layer: testing
  • Language: c
  • Symbols:
    • proc_get (function, line 24) proc_t *proc_get(int pid)
    • schedule (function, line 30) void schedule(void)
    • fresh_proc (function, line 44) static void fresh_proc(int pid)
    • fresh_all (function, line 52) static void fresh_all(void)
    • main (function, line 63) int main(void)
    • CHECK (macro, line 37) #define CHECK(cond, msg)
  • Depends on: headers/sync.h

tests/test_theme.c

  • Doc: Docstring: host test for the shared Nuklear theme contract.
  • Layer: testing
  • Language: c
  • Symbols:
    • tslot (struct, line 23)
    • t_name_ok (function, line 34) static int t_name_ok(const char *name)
    • t_parse_line (function, line 46) static int t_parse_line(const char *line, int *idx, long v[3])
    • cube_exact (function, line 74) static int cube_exact(long v)
    • check_theme_file (function, line 78) static void check_theme_file(const char *path)
    • main (function, line 107) int main(void)
    • CHECK (macro, line 16) #define CHECK(cond, msg)
    • X (macro, line 29) #define X(k, i)
  • Depends on: kernel/string.c, progs/nuklear/nuklear_theme.h

tests/test_tick.c

  • Doc: Docstring: Host test for kernel/tick.c (make test-tick).
  • Layer: testing
  • Language: c
  • Symbols:
    • rec_a (function, line 24) static void rec_a(void *ctx)
    • rec_b (function, line 31) static void rec_b(void *ctx)
    • rec_d (function, line 38) static void rec_d(void *ctx)
    • dummy (function, line 47) static void dummy(void *ctx)
    • main (function, line 52) int main(void)
    • CHECK (macro, line 17) #define CHECK(cond, msg)
  • Depends on: headers/tick.h

tests/test_usbblk.c

  • Doc: Docstring: Host test for the USB mass-storage driver (make test-usbblk).
  • Layer: testing
  • Language: c
  • Symbols:
    • device_register (function, line 20) int device_register(device_t *dev)
    • device_find (function, line 26) device_t *device_find(const char *name)
    • main (function, line 43) int main(void)
    • CHECK (macro, line 36) #define CHECK(cond, msg)
  • Depends on: drivers/usbblk.c, drivers/xhci.c, headers/driver.h, headers/drivers/usbblk.h

tests/test_usbhid.c

  • Doc: Docstring: Host test for the USB HID driver (make test-usbhid).
  • Layer: testing
  • Language: c
  • Symbols:
    • kbd_feed_scancode (function, line 22) int kbd_feed_scancode(unsigned char sc)
    • kbd_q_push (function, line 30) void kbd_q_push(unsigned char c)
    • check_usage (function, line 48) static void check_usage(unsigned usage, unsigned char want_sc, int want_e0, ...
    • main (function, line 59) int main(void)
    • CHECK (macro, line 41) #define CHECK(cond, msg)
  • Depends on: drivers/usbhid.c, drivers/xhci.c, headers/drivers/usbhid.h, kernel/string.c

tests/test_vedit_build.c

  • Doc: Docstring: Host test for the vedit IDE build contract (make test-vedit).
  • Layer: testing
  • Language: c
  • Symbols:
    • t_has_ext (function, line 40) static int t_has_ext(const char *fname, const char *ext)
    • t_base_of (function, line 51) static int t_base_of(const char *fname, char *dst, size_t cap)
    • t_join (function, line 71) static int t_join(const char *dir, const char *base, const char *ext, char *dst...
    • t_link_fmt (function, line 87) static int t_link_fmt(const char *s)
    • t_lang_of (function, line 101) static int t_lang_of(const char *fname)
    • t_run_kind (function, line 121) static int t_run_kind(const char *fname)
    • t_str_case (function, line 131) static void t_str_case(char *s, int mode)
    • t_transpose (function, line 157) static void t_transpose(char *s, int len, int pos)
    • t_mclass (function, line 166) static int t_mclass(int c, const char *cls)
    • t_matom (function, line 188) static int t_matom(const char *pat, int c, int *atom_len)
    • t_mhere (function, line 211) static int t_mhere(const char *text, const char *pat, int *mlen)
    • t_magic (function, line 268) static int t_magic(const char *text, const char *pat, int *mlen)
    • t_cmd (function, line 299) static int t_cmd(const char *name)
    • t_parse_key (function, line 312) static int t_parse_key(const char *s)
    • main (function, line 345) int main(void)
    • CHECK (macro, line 33) #define CHECK(cond, msg)
  • Depends on: kernel/string.c

tests/test_vma.c

  • Doc: Host-side unit test for the VMA red-black tree (vma.c).
  • Layer: testing
  • Language: c
  • Symbols:
    • black_height (function, line 27) static int black_height(const vma_node_t *n)
    • tree_valid (function, line 38) static int tree_valid(const vma_node_t *root)
    • count_nodes (function, line 75) static int count_nodes(const vma_node_t *root)
    • test_insert_find_delete (function, line 89) static void test_insert_find_delete(void)
    • test_pool_exhaustion (function, line 136) static void test_pool_exhaustion(void)
    • test_full_drain (function, line 153) static void test_full_drain(void)
    • test_file_tags_and_containing (function, line 167) static void test_file_tags_and_containing(void)
    • test_node_recycling (function, line 201) static void test_node_recycling(void)
    • main (function, line 231) int main(void)
    • CHECK (macro, line 20) #define CHECK(cond, msg)
  • Depends on: headers/vma.h

tests/test_vma_bench.c

  • Doc: RB-tree vs sorted-list benchmark (boyscout gap #9).
  • Layer: testing
  • Language: c
  • Symbols:
    • now_us (function, line 13) static long now_us(void)
    • l_insert (function, line 23) static void l_insert(unsigned long b)
    • l_find (function, line 28) static int l_find(unsigned long b)
    • bench (function, line 34) static void bench(int n)
    • main (function, line 54) int main(void)
    • LIST_MAX (macro, line 20) #define LIST_MAX
  • Depends on: headers/vma.h, kernel/time.c

tests/test_wl.c

tests/test_wm.c

tests/test_xhci.c

  • Doc: Docstring: Host test for the xHCI controller driver (make test-xhci).
  • Layer: testing
  • Language: c
  • Symbols:
    • main (function, line 30) int main(void)
    • CHECK (macro, line 23) #define CHECK(cond, msg)
  • Depends on: drivers/xhci.c, headers/drivers/xhci.h, kernel/string.c

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally