Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Macros | Typedefs | Functions
test_cow_iterator_01.cpp File Reference
#include <iostream>
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <random>
#include <vector>
#include <type_traits>
#include <catch2/catch_amalgamated.hpp>
#include <jau/test/catch2_ext.hpp>
#include <jau/basic_algos.hpp>
#include <jau/basic_types.hpp>
#include <jau/darray.hpp>
#include <jau/cow_darray.hpp>
#include <jau/cow_vector.hpp>
#include <jau/counting_allocator.hpp>
#include <jau/callocator.hpp>
#include <jau/counting_callocator.hpp>
Include dependency graph for test_cow_iterator_01.cpp:

Go to the source code of this file.

Macros

#define CATCH_CONFIG_RUNNER
 

Typedefs

typedef std::vector< uint64_t, counting_allocator< uint64_t > > std_vector_uint64_t
 
typedef jau::darray< uint64_t, counting_callocator< uint64_t > > jau_darray_uint64_t
 
typedef jau::cow_vector< uint64_t, counting_allocator< uint64_t > > jau_cow_vector_uint64_t
 
typedef jau::cow_darray< uint64_t, counting_callocator< uint64_t > > jau_cow_darray_uint64_t
 

Functions

template<class T >
static void print_list (T &data)
 
template<class T >
static void print_list (const std::string &pre, T &data)
 
template<class T >
static void fill_list (T &data, const std::size_t size)
 
template<class Iter >
static void print_iterator_info (const std::string &typedefname, typename std::enable_if< std::is_class< Iter >::value >::type *=0)
 
template<class Iter >
static void print_iterator_info (const std::string &typedefname, typename std::enable_if< !std::is_class< Iter >::value >::type *=0)
 
template<class T >
static bool test_00_inspect_iterator_types (const std::string &type_id)
 
template<class T , typename iterator_type1 , typename iterator_type2 >
static void test_iterator_equal (iterator_type1 &citer1, iterator_type2 &citer2)
 
template<class T , typename iterator_type1 , typename iterator_type2 >
static void test_iterator_notequal (iterator_type1 &citer1, iterator_type2 &citer2)
 
template<class T , typename iterator_type1 , typename iterator_type2 , typename iterator_type3 , typename iterator_type4 >
static void test_iterator_compare (const typename T::size_type size, iterator_type1 &begin, iterator_type2 &end, iterator_type3 &citer1, iterator_type4 &citer2, const typename T::difference_type citer1_idx, const typename T::difference_type citer2_idx)
 
template<class T , typename iterator_type1 , typename iterator_type2 >
static void test_iterator_dereference (const typename T::size_type size, iterator_type1 &begin, iterator_type2 &end)
 
template<class T , typename iterator_type1 , typename iterator_type2 >
static void test_iterator_arithmetic (const typename T::size_type size, iterator_type1 &begin, iterator_type2 &end)
 
template<class T >
static bool test_citer_type_ops (const std::string &type_id, std::enable_if_t< is_cow_type< T >::value, bool >=true)
 
template<class T >
static bool test_citer_type_ops (const std::string &type_id, std::enable_if_t< !is_cow_type< T >::value, bool >=true)
 
template<class T >
static bool test_mutable_iterator_ops (const std::string &type_id, std::enable_if_t< is_cow_type< T >::value, bool >=true)
 
template<class T >
static bool test_mutable_iterator_ops (const std::string &type_id, std::enable_if_t< !is_cow_type< T >::value, bool >=true)
 
template<class T >
static bool test_01_validate_iterator_ops (const std::string &type_id)
 
template<class T >
static bool test_01_cow_iterator_properties (const std::string &type_id)
 
 TEST_CASE ("Iterator Test 00 - Inspect all Iterator Types", "[datatype][std][vector][darray][cow_vector][cow_darray]")
 
 TEST_CASE ("STD Vector Test 01 - Validate Iterator and Index Operations", "[datatype][std][vector]")
 
 TEST_CASE ("JAU DArray Test 02 - Validate Iterator and Index Operations", "[datatype][jau][darray]")
 
 TEST_CASE ("JAU COW_Vector Test 11 - Validate Iterator Operations", "[datatype][jau][cow_vector]")
 
 TEST_CASE ("JAU COW_DArray Test 21 - Validate Iterator Operations", "[datatype][jau][cow_darray]")
 

Macro Definition Documentation

◆ CATCH_CONFIG_RUNNER

#define CATCH_CONFIG_RUNNER

Definition at line 33 of file test_cow_iterator_01.cpp.

Typedef Documentation

◆ jau_cow_darray_uint64_t

Examples
test_cow_iterator_01.cpp.

Definition at line 58 of file test_cow_iterator_01.cpp.

◆ jau_cow_vector_uint64_t

Examples
test_cow_iterator_01.cpp.

Definition at line 57 of file test_cow_iterator_01.cpp.

◆ jau_darray_uint64_t

typedef jau::darray<uint64_t, counting_callocator<uint64_t> > jau_darray_uint64_t
Examples
test_cow_iterator_01.cpp.

Definition at line 56 of file test_cow_iterator_01.cpp.

◆ std_vector_uint64_t

typedef std::vector<uint64_t, counting_allocator<uint64_t> > std_vector_uint64_t
Examples
test_cow_iterator_01.cpp.

Definition at line 55 of file test_cow_iterator_01.cpp.

Function Documentation

◆ fill_list()

template<class T >
static void fill_list ( T &  data,
const std::size_t  size 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 84 of file test_cow_iterator_01.cpp.

Here is the caller graph for this function:

◆ print_iterator_info() [1/2]

template<class Iter >
static void print_iterator_info ( const std::string &  typedefname,
typename std::enable_if< !std::is_class< Iter >::value >::type *  = 0 
)
static

Definition at line 111 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:

◆ print_iterator_info() [2/2]

template<class Iter >
static void print_iterator_info ( const std::string &  typedefname,
typename std::enable_if< std::is_class< Iter >::value >::type *  = 0 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 97 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:

◆ print_list() [1/2]

template<class T >
static void print_list ( const std::string &  pre,
T &  data 
)
static

Definition at line 75 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:

◆ print_list() [2/2]

template<class T >
static void print_list ( T &  data)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 66 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_00_inspect_iterator_types()

template<class T >
static bool test_00_inspect_iterator_types ( const std::string &  type_id)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 120 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:

◆ test_01_cow_iterator_properties()

template<class T >
static bool test_01_cow_iterator_properties ( const std::string &  type_id)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 1122 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:

◆ test_01_validate_iterator_ops()

template<class T >
static bool test_01_validate_iterator_ops ( const std::string &  type_id)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 1112 of file test_cow_iterator_01.cpp.

◆ TEST_CASE() [1/5]

TEST_CASE ( "Iterator Test 00 - Inspect all Iterator Types"  ,
""  [datatype][std][vector][darray][cow_vector][cow_darray] 
)
Examples
test_cow_iterator_01.cpp.

Definition at line 1263 of file test_cow_iterator_01.cpp.

◆ TEST_CASE() [2/5]

TEST_CASE ( "JAU COW_DArray Test 21 - Validate Iterator Operations"  ,
""  [datatype][jau][cow_darray] 
)

Definition at line 1284 of file test_cow_iterator_01.cpp.

◆ TEST_CASE() [3/5]

TEST_CASE ( "JAU COW_Vector Test 11 - Validate Iterator Operations"  ,
""  [datatype][jau][cow_vector] 
)

Definition at line 1278 of file test_cow_iterator_01.cpp.

◆ TEST_CASE() [4/5]

TEST_CASE ( "JAU DArray Test 02 - Validate Iterator and Index Operations"  ,
""  [datatype][jau][darray] 
)

Definition at line 1274 of file test_cow_iterator_01.cpp.

◆ TEST_CASE() [5/5]

TEST_CASE ( "STD Vector Test 01 - Validate Iterator and Index Operations"  ,
""  [datatype][std][vector] 
)

Definition at line 1270 of file test_cow_iterator_01.cpp.

◆ test_citer_type_ops() [1/2]

template<class T >
static bool test_citer_type_ops ( const std::string &  type_id,
std::enable_if_t< !is_cow_type< T >::value, bool >  = true 
)
static

Definition at line 429 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:

◆ test_citer_type_ops() [2/2]

template<class T >
static bool test_citer_type_ops ( const std::string &  type_id,
std::enable_if_t< is_cow_type< T >::value, bool >  = true 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 389 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:

◆ test_iterator_arithmetic()

template<class T , typename iterator_type1 , typename iterator_type2 >
static void test_iterator_arithmetic ( const typename T::size_type  size,
iterator_type1 &  begin,
iterator_type2 &  end 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 295 of file test_cow_iterator_01.cpp.

◆ test_iterator_compare()

template<class T , typename iterator_type1 , typename iterator_type2 , typename iterator_type3 , typename iterator_type4 >
static void test_iterator_compare ( const typename T::size_type  size,
iterator_type1 &  begin,
iterator_type2 &  end,
iterator_type3 &  citer1,
iterator_type4 &  citer2,
const typename T::difference_type  citer1_idx,
const typename T::difference_type  citer2_idx 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 176 of file test_cow_iterator_01.cpp.

◆ test_iterator_dereference()

template<class T , typename iterator_type1 , typename iterator_type2 >
static void test_iterator_dereference ( const typename T::size_type  size,
iterator_type1 &  begin,
iterator_type2 &  end 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 243 of file test_cow_iterator_01.cpp.

◆ test_iterator_equal()

template<class T , typename iterator_type1 , typename iterator_type2 >
static void test_iterator_equal ( iterator_type1 &  citer1,
iterator_type2 &  citer2 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 144 of file test_cow_iterator_01.cpp.

◆ test_iterator_notequal()

template<class T , typename iterator_type1 , typename iterator_type2 >
static void test_iterator_notequal ( iterator_type1 &  citer1,
iterator_type2 &  citer2 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 159 of file test_cow_iterator_01.cpp.

◆ test_mutable_iterator_ops() [1/2]

template<class T >
static bool test_mutable_iterator_ops ( const std::string &  type_id,
std::enable_if_t< !is_cow_type< T >::value, bool >  = true 
)
static

Definition at line 802 of file test_cow_iterator_01.cpp.

Here is the call graph for this function:

◆ test_mutable_iterator_ops() [2/2]

template<class T >
static bool test_mutable_iterator_ops ( const std::string &  type_id,
std::enable_if_t< is_cow_type< T >::value, bool >  = true 
)
static
Examples
test_cow_iterator_01.cpp.

Definition at line 465 of file test_cow_iterator_01.cpp.

Here is the call graph for this function: