diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-07-10 11:31:46 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-07-10 11:31:46 +0800 |
| commit | e90b72ec3082588b296956730bd2930cf8d5d671 (patch) | |
| tree | 36ff6916af9b4176ea5a9662219d11e721f0b691 /na/test/test_fdt.cc | |
| parent | 1767d390fbf3d0c65389de46caf0b6d43ef3b6ad (diff) | |
| download | lume-e90b72ec3082588b296956730bd2930cf8d5d671.tar.gz lume-e90b72ec3082588b296956730bd2930cf8d5d671.tar.xz | |
refactor: promote new architecture to repository root
Archive the deprecated implementation under lume-legacy, make the new kernel the default root-level build, and update repository entry points without changing kernel behavior.
Diffstat (limited to 'na/test/test_fdt.cc')
| -rw-r--r-- | na/test/test_fdt.cc | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/na/test/test_fdt.cc b/na/test/test_fdt.cc deleted file mode 100644 index cf09029..0000000 --- a/na/test/test_fdt.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* Copyright (C) 2026 Richard Qin */ - -/* - * Boot Self-Test: FDT (Flattened Device Tree) - */ - -#include <lume/selftest.h> -#include <lume/fdt.h> - -// Manually declare what we need to avoid header conflicts with toolchain libc -extern "C" int strcmp(const char *s1, const char *s2); - -void selftest_fdt() { - st_begin("fdt: tree root access"); - { - DeviceNode* root = fdt_get_node_by_path("/"); - ST_ASSERT(root != nullptr); - ST_ASSERT_EQ(strcmp(root->get_name(), ""), 0); - } - st_pass(); - - st_begin("fdt: find existing compatible node (UART)"); - { - // QEMU virt RISC-V platform always has a ns16550a UART - DeviceNode* uart = fdt_find_compatible("ns16550a"); - ST_ASSERT(uart != nullptr); - - // Use get_prop_string which is convenience helper - const char* compat = uart->get_prop_string("compatible"); - ST_ASSERT(compat != nullptr); - - // Check raw property access - const FdtProperty* reg = uart->get_prop("reg"); - ST_ASSERT(reg != nullptr); - ST_ASSERT(reg->value != nullptr); - ST_ASSERT(reg->len > 0); - } - st_pass(); - - st_begin("fdt: non-existent node/compatible queries"); - { - DeviceNode* missing1 = fdt_get_node_by_path("/definitely_does_not_exist_node_12345"); - ST_ASSERT(missing1 == nullptr); - - DeviceNode* missing2 = fdt_find_compatible("invalid_compatible_string_xyz"); - ST_ASSERT(missing2 == nullptr); - } - st_pass(); -} |
