zpp
Zephyr C++20 Framework
main.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 Erwin Rol <erwin@erwinrol.com>
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#include <zephyr/ztest.h>
8
9
#include <zephyr/kernel.h>
10
11
#include <
zpp/atomic_bitset.hpp
>
12
#include <
zpp/atomic_var.hpp
>
13
14
15
ZTEST_SUITE
(zpp_atomic_tests, NULL, NULL, NULL, NULL, NULL);
16
17
namespace
{
18
19
zpp::atomic_bitset<320>
g_bitset;
20
21
}
// namespace
22
23
ZTEST
(zpp_atomic_tests, test_atomic_bitset)
24
{
25
g_bitset.store(0,
true
);
26
zassert_true(g_bitset.load(0) ==
true
,
"load(0) failed"
);
27
28
g_bitset.store(319,
true
);
29
zassert_true(g_bitset.load(319) ==
true
,
"load(319) failed"
);
30
}
atomic_bitset.hpp
atomic_var.hpp
zpp::atomic_bitset
class wrapping an atomic_var_t array
Definition:
atomic_bitset.hpp:23
ZTEST
ZTEST(zpp_atomic_tests, test_atomic_bitset)
Definition:
main.cpp:23
ZTEST_SUITE
ZTEST_SUITE(zpp_atomic_tests, NULL, NULL, NULL, NULL, NULL)
tests
atomic
src
main.cpp
Generated by
1.9.1