LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
tests.h
Go to the documentation of this file.
1
9#ifndef KERNEL_KERNEL_TESTS_H
10#define KERNEL_KERNEL_TESTS_H
11
12#include <lib/kstring.h>
13#include <arch/x86_64/gdt.h>
14#include <kernel/kprintf.h>
15#include <kernel/tools.h>
16#include <limits.h>
17
18// STRING.H TESTS
19
26bool test_memcpy(uint64_t dest, uint64_t b);
27
34bool test_memmove(uint64_t dest, uint64_t b);
35
42bool test_memset(uint64_t dest, int value);
43
51bool test_memcmp(uint64_t dest, uint64_t b, int expected_value);
52
59bool test_strlen(const char* str, uint8_t expected_value);
60
65bool test_access_byte(void);
66
71bool test_flag_byte(void);
72
73// KPRINTF.H TESTS
74
78void test_kprintf_values(void);
79
80// FAULT HANDLER TESTS
81
85void test_de_fault(void);
86
90void test_pf_read_fault(void);
91
95void test_pf_write_fault(void);
96
100void test_bp_fault(void);
101
102#endif
Initializes and holds the GDT for the kernel.
Tools for printing to the console and serial output.
Utilities for memory and string operations.
void test_pf_write_fault(void)
Causes a Page fault (write) for handler testing.
Definition tests.c:123
void test_pf_read_fault(void)
Causes a Page fault (read) for handler testing.
Definition tests.c:119
bool test_flag_byte(void)
Tests the flag byte utility for the gdt.
Definition tests.c:81
bool test_memset(uint64_t dest, int value)
Tests the memset utility.
Definition tests.c:38
void test_bp_fault(void)
Triggers a Breakpoint for handler testing.
Definition tests.c:131
bool test_memcpy(uint64_t dest, uint64_t b)
Tests the memcpy utility.
Definition tests.c:18
bool test_strlen(const char *str, uint8_t expected_value)
Tests the strlen utility.
Definition tests.c:67
bool test_memcmp(uint64_t dest, uint64_t b, int expected_value)
Tests the memcmp utility.
Definition tests.c:57
void test_de_fault(void)
Causes a Division error for handler testing.
Definition tests.c:114
void test_kprintf_values(void)
Prints test data and the expected values for visual verification of kprintf.
Definition tests.c:90
bool test_access_byte(void)
Tests the access byte utility for the gdt.
Definition tests.c:74
bool test_memmove(uint64_t dest, uint64_t b)
Tests the memmove utility.
Definition tests.c:28
Extra kernel utilities.