Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: sprintf: convert normal test to use ztest #1282

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/kernel/sprintf/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ CONFIG_STDOUT_CONSOLE=y
CONFIG_NUM_IRQS=2
CONFIG_FLOAT=y
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_ZTEST=y
3 changes: 2 additions & 1 deletion tests/kernel/sprintf/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ccflags-y += -I${ZEPHYR_BASE}/tests/include
include ${ZEPHYR_BASE}/tests/Makefile.test

obj-y = test_sprintf.o
obj-y = test_sprintf.o main.o
36 changes: 36 additions & 0 deletions tests/kernel/sprintf/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

/**
* @addtogroup t_kernel_sprintf
* @{
* @defgroup t_sprintf_api test_sorintf_fn
* @}
*/

#include <ztest.h>
extern void sprintf_double_test(void);
extern void vsnprintf_test(void);
extern void vsprintf_test(void);
extern void snprintf_test(void);
extern void sprintf_misc_test(void);
extern void sprintf_integer_test(void);
extern void sprintf_stringtest(void);

/*test case main entry*/
void test_main(void *p1, void *p2, void *p3)
{
ztest_test_suite(test_sprintf_fn,
ztest_unit_test(sprintf_double_test),
ztest_unit_test(vsnprintf_test),
ztest_unit_test(vsprintf_test),
ztest_unit_test(snprintf_test),
ztest_unit_test(sprintf_misc_test),
ztest_unit_test(sprintf_integer_test),
ztest_unit_test(sprintf_stringtest));

ztest_run_test_suite(test_sprintf_fn);
}
Loading