-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fb3b81
commit 547a4fb
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from building import * | ||
|
||
src = [] | ||
|
||
if GetDepend('RT_USING_CI_ACTION'): | ||
src += Glob('utest_*.c') | ||
|
||
group = DefineGroup('utestcases', src, depend = ['']) | ||
|
||
Return('group') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2006-2019, RT-Thread Development Team | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Change Logs: | ||
* Date Author Notes | ||
* 2024-12-21 Meco Man the first version | ||
*/ | ||
#include <rtklibc.h> | ||
#include <utest.h> | ||
|
||
static rt_err_t utest_tc_init(void) | ||
{ | ||
return RT_EOK; | ||
} | ||
|
||
static rt_err_t utest_tc_cleanup(void) | ||
{ | ||
return RT_EOK; | ||
} | ||
|
||
static void tc_rt_memcpy_1(void) | ||
{ | ||
const char src[] = "Hello, memcpy!"; | ||
char dest[20]; | ||
rt_memcpy(dest, src, sizeof(src)); | ||
uassert_true(rt_strcmp(src, dest) == 0); | ||
} | ||
|
||
static void utest_do_tc(void) | ||
{ | ||
UTEST_UNIT_RUN(tc_rt_memcpy_1); | ||
} | ||
|
||
UTEST_TC_EXPORT(utest_do_tc, "klibc.kstdlibc", utest_tc_init, utest_tc_cleanup, 1000); |