Direct-BT
v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
jaulib
test
test_lfringbuffer01.cpp
Go to the documentation of this file.
1
/*
2
* Author: Sven Gothel <sgothel@jausoft.com>
3
* Copyright (c) 2020 Gothel Software e.K.
4
*
5
* Permission is hereby granted, free of charge, to any person obtaining
6
* a copy of this software and associated documentation files (the
7
* "Software"), to deal in the Software without restriction, including
8
* without limitation the rights to use, copy, modify, merge, publish,
9
* distribute, sublicense, and/or sell copies of the Software, and to
10
* permit persons to whom the Software is furnished to do so, subject to
11
* the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be
14
* included in all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
*/
24
#include <cassert>
25
#include <cinttypes>
26
#include <cstring>
27
#include <memory>
28
29
#include <
jau/ringbuffer.hpp
>
30
31
#include "
test_lfringbuffer_a.hpp
"
32
33
using namespace
jau
;
34
35
typedef
uint8_t
Integral_type
;
36
typedef
uint8_t
Value_type
;
37
38
template
<>
39
Value_type
getDefault
() {
return
(
Value_type
)0xff; }
40
41
template
<>
42
Value_type
createValue
(
const
Integral_type
& v) {
return
v; }
43
44
template
<>
45
Integral_type
getValue
(
const
Value_type
& e) {
return
e; }
46
47
TEST_CASE
(
"TestRingbuffer_A_01_a<Integral_type=uint8_t, Value_type=uint8_t, Size_type=jau::nsize_t, exp_memmove=true, exp_memcpy=true, exp_secmem=false>"
,
"[ringbuffer_A_01a]"
) {
48
PerformRingbufferTests
<
Integral_type
,
Value_type
,
jau::nsize_t
,
49
true
/* exp_memmove */
,
true
/* exp_memcpy */
,
false
/* exp_secmem */
>();
50
}
51
52
TEST_CASE
(
"TestRingbuffer_A_01_b<Integral_type=uint8_t, Value_type=uint8_t, Size_type=jau::nsize_t, exp_memmove=true, exp_memcpy=true, exp_secmem=true>"
,
"[ringbuffer_A_01b]"
) {
53
PerformRingbufferTests
<
Integral_type
,
Value_type
,
jau::nsize_t
,
54
true
/* exp_memmove */
,
true
/* exp_memcpy */
,
true
/* exp_secmem */
,
55
true
/* use_memmove */
,
true
/* use_memcpy */
,
true
/* use_secmem */
>();
56
}
57
58
TEST_CASE
(
"TestRingbuffer_A_01_c<Integral_type=uint8_t, Value_type=uint8_t, Size_type=jau::nsize_t, exp_memmove=false, exp_memcpy=false, exp_secmem=true>"
,
"[ringbuffer_A_01c]"
) {
59
PerformRingbufferTests
<
Integral_type
,
Value_type
,
jau::nsize_t
,
60
false
/* exp_memmove */
,
false
/* exp_memcpy */
,
true
/* exp_secmem */
,
61
false
/* use_memmove */
,
false
/* use_memcpy */
,
true
/* use_secmem */
>();
62
}
63
jau::nsize_t
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
Definition:
int_types.hpp:53
jau
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
Definition:
backtrace.hpp:32
ringbuffer.hpp
createValue
Value_type createValue(const Integral_type &v)
Definition:
test_lfringbuffer01.cpp:42
getDefault
Value_type getDefault()
Definition:
test_lfringbuffer01.cpp:39
Value_type
uint8_t Value_type
Definition:
test_lfringbuffer01.cpp:36
getValue
Integral_type getValue(const Value_type &e)
Definition:
test_lfringbuffer01.cpp:45
Integral_type
uint8_t Integral_type
Definition:
test_lfringbuffer01.cpp:35
TEST_CASE
TEST_CASE("TestRingbuffer_A_01_a<Integral_type=uint8_t, Value_type=uint8_t, Size_type=jau::nsize_t, exp_memmove=true, exp_memcpy=true, exp_secmem=false>", "[ringbuffer_A_01a]")
Definition:
test_lfringbuffer01.cpp:47
test_lfringbuffer_a.hpp
PerformRingbufferTests
void PerformRingbufferTests()
Definition:
test_lfringbuffer_a.hpp:854
Generated on Sun May 12 2024 09:25:36 for Direct-BT by
1.9.4