Skip to content

Commit 063c039

Browse files
MariuszSkamracarlescufi
authored andcommitted
test: net: buf_simple: Add unit tests for simple buffers
This adds set of unit tests for simple network buffers. The suite is based of the test cases that are already defined for network buffers. Those test_net_buf_byte_order test case have been split to smaller tests testing one functionality at a time. Signed-off-by: Mariusz Skamra <[email protected]>
1 parent 5862c82 commit 063c039

File tree

7 files changed

+507
-0
lines changed

7 files changed

+507
-0
lines changed

tests/net/buf_simple/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.20.0)
4+
5+
project(buf_simple)
6+
7+
find_package(Zephyr COMPONENTS unittest HINTS $ENV{ZEPHYR_BASE})
8+
9+
add_subdirectory(${ZEPHYR_BASE}/tests/net/mocks net_mocks)
10+
11+
target_link_libraries(testbinary PRIVATE net_mocks)
12+
13+
target_sources(testbinary
14+
PRIVATE
15+
src/main.c
16+
17+
${ZEPHYR_BASE}/subsys/net/buf_simple.c
18+
)

tests/net/buf_simple/prj.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CONFIG_ZTEST=y
2+
CONFIG_ZTEST_NEW_API=y
3+
CONFIG_ASSERT=y
4+
CONFIG_ASSERT_LEVEL=2
5+
CONFIG_ASSERT_VERBOSE=y
6+
CONFIG_ASSERT_ON_ERRORS=y
7+
CONFIG_NET_BUF=y
8+
#CONFIG_NET_BUF_LOG=y
9+
#CONFIG_NET_BUF_LOG_LEVEL_DBG=y
10+
#CONFIG_NET_BUF_SIMPLE_LOG=y

0 commit comments

Comments
 (0)