54TEST_CASE(
"JAU DArray Test 01 - jau::darray initializer list",
"[datatype][jau][darray]" ) {
83TEST_CASE(
"JAU DArray Test 02 - jau::darray immutable type (const)",
"[const][jau][darray]" ) {
120template<
class Payload>
124template<
class Payload>
128template<
class Payload>
149template<
class Payload>
170template<
class Payload>
174template<
class Payload>
178template<
class Payload>
199template<
class Payload>
220template<
class Payload>
225 std::shared_ptr<Payload> sp(std::make_shared<Payload>( name+i ));
229 std::shared_ptr<Payload> sp(
new Payload( name+i ));
234template<
class Payload>
243template<
class Payload>
248 std::shared_ptr<Payload> sp(std::make_shared<Payload>( name+i ));
252 std::shared_ptr<Payload> sp(
new Payload( name+i ));
257template<
class Payload>
262 Payload sp( name+i );
266 Payload sp( name+i );
271template<
class Payload>
276 Payload sp( name+i );
280 Payload sp( name+i );
294#define CHECK_TRAITS 0
296template<
class Cont >
300 printf(
"\nContainer Type %s (a darray, a cow %d):\n - Uses memmove %d (trivially_copyable %d); realloc %d; base_of jau::callocator %d; secmem %d; size %d bytes\n",
303 std::is_trivially_copyable<typename Cont::value_type>::value,
314 printf(
"\nContainer Type %s (!darray, a cow %d); size %d bytes\n",
319template<
class Payload>
329 CHECK(
true == std::is_trivially_copyable<Payload>::value);
354 CHECK(
true == std::is_trivially_copyable<Payload>::value);
379 CHECK(
true == std::is_trivially_copyable<std::shared_ptr<Payload>>::value);
409 Holder holder{ data };
419 r1r1 = holder.get_ref2();
426 CHECK(
true == std::is_trivially_copyable<std::shared_ptr<Payload>>::value);
456 CHECK(
true == GattCharacteristicSpecList::uses_realloc);
458 CHECK(
true == GattCharacteristicSpecList::uses_memmove);
459 CHECK(
true == std::is_trivially_copyable<GattCharacteristicSpec>::value);
478TEST_CASE(
"JAU DArray Test 10 - jau::darray value_type behavior (type traits)",
"[datatype][jau][darray]" ) {
479 testDArrayValueType<uint64_t>(
"uint64_t");
480 testDArrayValueType<Addr48Bit>(
"Addr48Bit");
481 testDArrayValueType<DataType01>(
"DataType01");
482 testDArrayValueType<DataType02_Memmove_Secmem>(
"DataType02");
Implementation of a dynamic linear array storage, aka vector.
constexpr iterator end() noexcept
constexpr void push_back(const value_type &x)
Like std::vector::push_back(), copy.
constexpr const_iterator cbegin() const noexcept
constexpr iterator begin() noexcept
constexpr iterator erase(const_iterator pos)
Like std::vector::erase(), removes the elements at pos.
constexpr UnaryFunction for_each(InputIt first, InputIt last, UnaryFunction f)
Like std::for_each() of 'algorithm'.
std::string to_string(const endian_t v) noexcept
Return std::string representation of the given endian.
std::string to_string(const alphabet &v) noexcept
#define JAU_TYPENAME_CUE_ALL(A)
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
std::string toString() const noexcept
jau::darray< GattCharacteristicSpec > characteristics
PayloadListDefault< Payload > payload
std::string toString() const noexcept
PayloadListMemMove< Payload > payload
std::string toString() const noexcept
std::string toString() const noexcept
SharedPayloadListDefault< Payload > payload
std::string toString() const noexcept
SharedPayloadListMemMove< Payload > payload
A simple allocator using POSIX C functions: ::malloc(), ::free() and ::realloc().
template< class T > is_cow_type<T>::value compile-time Type Trait, determining whether the given temp...
template< class T > is_darray_type<T>::value compile-time Type Trait, determining whether the given t...
static int countGattCharacteristicSpecList01ConstRef(const jau::darray< const GattCharacteristicSpec > &clist)
static NamedSharedPayloadListDefault< Payload > makeNamedSharedPayloadListDefault(int name)
static NamedSharedPayloadListMemMove< Payload > makeNamedSharedPayloadListMemMove(int name)
static void print_container_info(const std::string &type_id, const Cont &c, std::enable_if_t< jau::is_darray_type< Cont >::value, bool >=true)
static void testDArrayValueType(const std::string &type_id)
static NamedPayloadListDefault< Payload > makeNamedPayloadListDefault(int name)
static GattServiceCharacteristic returnGattSrvcChar(int i)
static NamedPayloadListMemMove< Payload > makeNamedPayloadListMemMove(int name)
TEST_CASE("JAU DArray Test 01 - jau::darray initializer list", "[datatype][jau][darray]")
static NamedSharedPayloadListDefault< Payload > modifyCopyOfNamedSharedPayloadListDefault(NamedSharedPayloadListDefault< Payload > src)
static int countGattCharacteristicSpecList02Copy(jau::darray< const GattCharacteristicSpec > clist)
static void testDArrayGattServiceCharacteristic()
const jau::darray< const GattServiceCharacteristic * > GATT_SERVICES
@ ReliableWriteExt
FIXME: extension?
@ AuxWriteExt
FIXME: extension?
int printf(const char *format,...)
Operating Systems predefined macros.