#include <zephyr/ztest.h>
#include <zephyr/kernel.h>
#include <zpp/fifo.hpp>
#include <zpp/thread.hpp>
#include <zpp/sem.hpp>
#include <array>
Go to the source code of this file.
|
| ZTEST_SUITE (test_zpp_fifo, NULL, NULL, NULL, NULL, NULL) |
|
| ZTEST (test_zpp_fifo, test_fifo) |
|
◆ ZTEST()
ZTEST |
( |
test_zpp_fifo |
, |
|
|
test_fifo |
|
|
) |
| |
Definition at line 36 of file main.cpp.
39 using namespace std::chrono;
51 for (
auto& item: g_item_array) {
53 item.more_data = 0x5678;
54 g_fifo.push_back(&item);
63 for (
auto& item: g_item_array) {
64 auto res = g_fifo.try_pop_front();
65 zassert_equal(res->data, 0x1234,
nullptr);
66 zassert_equal(res->more_data, 0x5678,
nullptr);
67 zassert_equal(res, &item,
nullptr);
73 for (
auto& item: g_item_array) {
74 g_fifo.push_back(&item);
82 zassert_equal(!!res,
true,
"");
87 for (
auto& item: g_item_array) {
88 auto res = g_fifo.try_pop_front();
89 zassert_equal(res->data, 0x1234,
nullptr);
90 zassert_equal(res->more_data, 0x5678,
nullptr);
91 zassert_equal(res, &item,
nullptr);
Thread creation attributes.
static constexpr thread_prio preempt(int prio) noexcept
Create a preemptive priority value.
The class thread repecents a single Zephyr thread.
auto join() noexcept
join the thread this object mamages.
References zpp::thread::join(), zpp::no, zpp::thread_prio::preempt(), and zpp::yes.
◆ ZTEST_SUITE()
ZTEST_SUITE |
( |
test_zpp_fifo |
, |
|
|
NULL |
, |
|
|
NULL |
, |
|
|
NULL |
, |
|
|
NULL |
, |
|
|
NULL |
|
|
) |
| |