File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
components/drivers/core/utest Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 66 * Change Logs:
77 * Date Author Notes
88 * 2024-05-20 Shell the first version
9+ * 2025-11-13 ChuanN Add standardized utest documentation block
910 */
11+
12+ /**
13+ * Test Case Name: Drivers Core Test
14+ *
15+ * Test Objectives:
16+ * - Validate the correctness and consistency of the rt_device_find() API in the RT-Thread device management subsystem.
17+ * - Test rt_device_find() and rt_console_get_device().
18+ *
19+ * Test Scenarios:
20+ * - Locate a known console device by its actual name retrieved at runtime.
21+ * - Attempt to find the same device using the predefined macro RT_CONSOLE_DEVICE_NAME.
22+ * - Verify identity consistency when querying the same device through different but equivalent name sources.
23+ *
24+ * Verification Metrics:
25+ * - rt_device_find() must return a non-NULL pointer when a valid device name is provided.
26+ * - Pointers returned for the same logical device (via different name expressions) must be identical.
27+ * - When RT_CONSOLE_DEVICE_NAME differs from the actual console name, two distinct but valid devices must be found.
28+ * - All assertions must pass without triggering test failure.
29+ *
30+ * Dependencies:
31+ * - Hardware requirements: QEMU emulator or any hardware platform that supports RT-Thread with console device registration.
32+ * - Software configuration:
33+ * - RT_USING_UTEST must be enabled (select "RT-Thread Utestcases" in menuconfig).
34+ * - BSP_UTEST_DRIVERS_CORE must be enabled (enable via: RT-Thread Utestcases -> Kernel components -> drivers -> Driver core Test).
35+ * - Environmental assumptions: The system has initialized the console device before test execution.
36+ *
37+ * Expected Results:
38+ * - The test will pass silently if all assertions hold.
39+ * - Console will output: "[ PASSED ] [ result ] testcase (components.drivers.core.device_find)".
40+ */
41+
1042#include <rtthread.h>
1143#include <stdlib.h>
1244#include "utest.h"
You can’t perform that action at this time.
0 commit comments