|
|
|
|
@ -31,17 +31,18 @@ class test_const_vector;
|
|
|
|
|
#define ASSERT_RANGE_VEC_ARR_EQ(vec, startI, endI, eq) ASSERT_ARR_EQ((vec._arr + startI), (vec._arr + endI), eq)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class test_const_vector {
|
|
|
|
|
struct TestStruct {
|
|
|
|
|
int x = 0;
|
|
|
|
|
char c = 0;
|
|
|
|
|
const char * s = "This is a string";
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
constexpr bool operator==(const TestStruct &other) const { return x == other.x && c == other.c && std::string_view(s) == other.s; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct TestStruct {
|
|
|
|
|
int x = 0;
|
|
|
|
|
char c = 0;
|
|
|
|
|
const char * s = "This is a string";
|
|
|
|
|
|
|
|
|
|
constexpr bool operator==(const TestStruct &other) const { return x == other.x && c == other.c && std::string_view(s) == other.s; }
|
|
|
|
|
};
|
|
|
|
|
class test_defs {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
#define GEN_TEST_STRUCT_ARR(nr, i) TestStruct(C_VI_TEST_ARR##nr[i], C_VC_TEST_ARR##nr[i], C_VS_TEST_ARR##nr[i])
|
|
|
|
|
|
|
|
|
|
@ -59,30 +60,12 @@ class test_const_vector {
|
|
|
|
|
|
|
|
|
|
#define VI_TEST_ARR1 { 1, 2, 3, 4 }
|
|
|
|
|
#define VI_TEST_ARR2 { 5, 6, 7, 8, 9, 10, 11, 12 }
|
|
|
|
|
static constexpr const int C_VI_TEST_ARR1[] = VI_TEST_ARR1;
|
|
|
|
|
static constexpr const int C_VI_TEST_ARR2[] = VI_TEST_ARR2;
|
|
|
|
|
static constexpr const std::array STD_VI_TEST_ARR1 = VI_TEST_ARR1;
|
|
|
|
|
static constexpr const std::array STD_VI_TEST_ARR2 = VI_TEST_ARR2;
|
|
|
|
|
static constexpr const std::size_t VI_TEST_ARR1_LEN = C_ARR_LEN(C_VI_TEST_ARR1);
|
|
|
|
|
static constexpr const std::size_t VI_TEST_ARR2_LEN = C_ARR_LEN(C_VI_TEST_ARR2);
|
|
|
|
|
|
|
|
|
|
#define VC_TEST_ARR1 { 'a', 'B', 'c', 'D' }
|
|
|
|
|
#define VC_TEST_ARR2 { 'e', 'F', 'g', 'H', 'i', 'J', '\n', '\0' }
|
|
|
|
|
static constexpr const char C_VC_TEST_ARR1[] = VC_TEST_ARR1;
|
|
|
|
|
static constexpr const char C_VC_TEST_ARR2[] = VC_TEST_ARR2;
|
|
|
|
|
static constexpr const std::array STD_VC_TEST_ARR1 = VC_TEST_ARR1;
|
|
|
|
|
static constexpr const std::array STD_VC_TEST_ARR2 = VC_TEST_ARR2;
|
|
|
|
|
static constexpr const std::size_t VC_TEST_ARR1_LEN = C_ARR_LEN(C_VC_TEST_ARR1);
|
|
|
|
|
static constexpr const std::size_t VC_TEST_ARR2_LEN = C_ARR_LEN(C_VC_TEST_ARR2);
|
|
|
|
|
|
|
|
|
|
#define VS_TEST_ARR1 { "Lorem", "ipsum", "dolor", "sit" }
|
|
|
|
|
#define VS_TEST_ARR2 { "amet", "consetetur", "sadipscing", "elitr", "sed", "diam", "nonumy", "eirmod", "tempor", "\0" }
|
|
|
|
|
static constexpr const char * C_VS_TEST_ARR1[] = VS_TEST_ARR1;
|
|
|
|
|
static constexpr const char * C_VS_TEST_ARR2[] = VS_TEST_ARR2;
|
|
|
|
|
static constexpr const std::array STD_VS_TEST_ARR1 = VS_TEST_ARR1;
|
|
|
|
|
static constexpr const std::array STD_VS_TEST_ARR2 = VS_TEST_ARR2;
|
|
|
|
|
static constexpr const std::size_t VS_TEST_ARR1_LEN = C_ARR_LEN(C_VS_TEST_ARR1);
|
|
|
|
|
static constexpr const std::size_t VS_TEST_ARR2_LEN = C_ARR_LEN(C_VS_TEST_ARR2);
|
|
|
|
|
|
|
|
|
|
#define VO_TEST_ARR1 { GEN_TEST_STRUCT_ARR(1, 0), \
|
|
|
|
|
GEN_TEST_STRUCT_ARR(1, 1), \
|
|
|
|
|
@ -96,13 +79,72 @@ class test_const_vector {
|
|
|
|
|
GEN_TEST_STRUCT_ARR(2, 5), \
|
|
|
|
|
GEN_TEST_STRUCT_ARR(2, 6), \
|
|
|
|
|
GEN_TEST_STRUCT_ARR(2, 7) }
|
|
|
|
|
static constexpr TestStruct C_VO_TEST_ARR1[] = VO_TEST_ARR1;
|
|
|
|
|
static constexpr TestStruct C_VO_TEST_ARR2[] = VO_TEST_ARR2;
|
|
|
|
|
static constexpr const std::array STD_VO_TEST_ARR1 = VO_TEST_ARR1;
|
|
|
|
|
static constexpr const std::array STD_VO_TEST_ARR2 = VO_TEST_ARR2;
|
|
|
|
|
static constexpr const std::size_t VO_TEST_ARR1_LEN = C_ARR_LEN(C_VO_TEST_ARR1);
|
|
|
|
|
static constexpr const std::size_t VO_TEST_ARR2_LEN = C_ARR_LEN(C_VO_TEST_ARR2);
|
|
|
|
|
|
|
|
|
|
static constexpr const int C_VI_TEST_ARR1[] = VI_TEST_ARR1;
|
|
|
|
|
static constexpr const int C_VI_TEST_ARR2[] = VI_TEST_ARR2;
|
|
|
|
|
static constexpr const std::array STD_VI_TEST_ARR1 = VI_TEST_ARR1;
|
|
|
|
|
static constexpr const std::array STD_VI_TEST_ARR2 = VI_TEST_ARR2;
|
|
|
|
|
static constexpr const std::size_t VI_TEST_ARR1_LEN = C_ARR_LEN(C_VI_TEST_ARR1);
|
|
|
|
|
static constexpr const std::size_t VI_TEST_ARR2_LEN = C_ARR_LEN(C_VI_TEST_ARR2);
|
|
|
|
|
static constexpr const char C_VC_TEST_ARR1[] = VC_TEST_ARR1;
|
|
|
|
|
static constexpr const char C_VC_TEST_ARR2[] = VC_TEST_ARR2;
|
|
|
|
|
static constexpr const std::array STD_VC_TEST_ARR1 = VC_TEST_ARR1;
|
|
|
|
|
static constexpr const std::array STD_VC_TEST_ARR2 = VC_TEST_ARR2;
|
|
|
|
|
static constexpr const std::size_t VC_TEST_ARR1_LEN = C_ARR_LEN(C_VC_TEST_ARR1);
|
|
|
|
|
static constexpr const std::size_t VC_TEST_ARR2_LEN = C_ARR_LEN(C_VC_TEST_ARR2);
|
|
|
|
|
static constexpr const char * C_VS_TEST_ARR1[] = VS_TEST_ARR1;
|
|
|
|
|
static constexpr const char * C_VS_TEST_ARR2[] = VS_TEST_ARR2;
|
|
|
|
|
static constexpr const std::array STD_VS_TEST_ARR1 = VS_TEST_ARR1;
|
|
|
|
|
static constexpr const std::array STD_VS_TEST_ARR2 = VS_TEST_ARR2;
|
|
|
|
|
static constexpr const std::size_t VS_TEST_ARR1_LEN = C_ARR_LEN(C_VS_TEST_ARR1);
|
|
|
|
|
static constexpr const std::size_t VS_TEST_ARR2_LEN = C_ARR_LEN(C_VS_TEST_ARR2);
|
|
|
|
|
static constexpr TestStruct C_VO_TEST_ARR1[] = VO_TEST_ARR1;
|
|
|
|
|
static constexpr TestStruct C_VO_TEST_ARR2[] = VO_TEST_ARR2;
|
|
|
|
|
static constexpr const std::array STD_VO_TEST_ARR1 = VO_TEST_ARR1;
|
|
|
|
|
static constexpr const std::array STD_VO_TEST_ARR2 = VO_TEST_ARR2;
|
|
|
|
|
static constexpr const std::size_t VO_TEST_ARR1_LEN = C_ARR_LEN(C_VO_TEST_ARR1);
|
|
|
|
|
static constexpr const std::size_t VO_TEST_ARR2_LEN = C_ARR_LEN(C_VO_TEST_ARR2);
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
struct get_test_def {
|
|
|
|
|
template<unsigned long long int nr>
|
|
|
|
|
static consteval auto& get_arr_for_type();
|
|
|
|
|
|
|
|
|
|
template<unsigned long long int nr>
|
|
|
|
|
static consteval unsigned long long int get_arr_len_for_type();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
using int_defs = test_defs::get_test_def<int>;
|
|
|
|
|
using char_defs = test_defs::get_test_def<char>;
|
|
|
|
|
using string_defs = test_defs::get_test_def<const char *>;
|
|
|
|
|
using obj_defs = test_defs::get_test_def<TestStruct>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<> template<> consteval auto& int_defs::get_arr_for_type<1>() { return C_VI_TEST_ARR1; }
|
|
|
|
|
template<> template<> consteval auto& int_defs::get_arr_for_type<2>() { return C_VI_TEST_ARR2; }
|
|
|
|
|
template<> template<> consteval auto& char_defs::get_arr_for_type<1>() { return C_VC_TEST_ARR1; }
|
|
|
|
|
template<> template<> consteval auto& char_defs::get_arr_for_type<2>() { return C_VC_TEST_ARR2; }
|
|
|
|
|
template<> template<> consteval auto& string_defs::get_arr_for_type<1>() { return C_VS_TEST_ARR1; }
|
|
|
|
|
template<> template<> consteval auto& string_defs::get_arr_for_type<2>() { return C_VS_TEST_ARR2; }
|
|
|
|
|
template<> template<> consteval auto& obj_defs::get_arr_for_type<1>() { return C_VO_TEST_ARR1; }
|
|
|
|
|
template<> template<> consteval auto& obj_defs::get_arr_for_type<2>() { return C_VO_TEST_ARR2; }
|
|
|
|
|
|
|
|
|
|
template<> template<> consteval std::size_t int_defs::get_arr_len_for_type<1>() { return VI_TEST_ARR1_LEN; }
|
|
|
|
|
template<> template<> consteval std::size_t int_defs::get_arr_len_for_type<2>() { return VI_TEST_ARR2_LEN; }
|
|
|
|
|
template<> template<> consteval std::size_t char_defs::get_arr_len_for_type<1>() { return VC_TEST_ARR1_LEN; }
|
|
|
|
|
template<> template<> consteval std::size_t char_defs::get_arr_len_for_type<2>() { return VC_TEST_ARR2_LEN; }
|
|
|
|
|
template<> template<> consteval std::size_t string_defs::get_arr_len_for_type<1>() { return VS_TEST_ARR1_LEN; }
|
|
|
|
|
template<> template<> consteval std::size_t string_defs::get_arr_len_for_type<2>() { return VS_TEST_ARR2_LEN; }
|
|
|
|
|
template<> template<> consteval std::size_t obj_defs::get_arr_len_for_type<1>() { return VO_TEST_ARR1_LEN; }
|
|
|
|
|
template<> template<> consteval std::size_t obj_defs::get_arr_len_for_type<2>() { return VO_TEST_ARR2_LEN; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class test_const_vector : public test_defs {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
static consteval bool test_constructor_default() {
|
|
|
|
|
|
|
|
|
|
@ -693,6 +735,184 @@ class test_const_vector {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static consteval bool test_operator_eq() {
|
|
|
|
|
|
|
|
|
|
#pragma message("Testing operator=")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define DEFINE_APPLICATOR(type) DEFINE_APPLICATOR_EXT(type, type)
|
|
|
|
|
#define DEFINE_APPLICATOR_EXT(type_abbr, type) constexpr auto type_abbr##_applicator = []() consteval { \
|
|
|
|
|
constexpr auto& arr1 = type_abbr##_defs::get_arr_for_type<1>(); \
|
|
|
|
|
constexpr auto& arr2 = type_abbr##_defs::get_arr_for_type<2>(); \
|
|
|
|
|
constexpr auto arr1_len = type_abbr##_defs::get_arr_len_for_type<1>(); \
|
|
|
|
|
constexpr auto arr2_len = type_abbr##_defs::get_arr_len_for_type<2>(); \
|
|
|
|
|
cc::const_vector v1o(arr1); \
|
|
|
|
|
cc::const_vector v2o(arr2); \
|
|
|
|
|
\
|
|
|
|
|
struct { \
|
|
|
|
|
decltype(v1o) v1cs; \
|
|
|
|
|
decltype(v2o) v2cs; \
|
|
|
|
|
cc::const_vector<type, TEST_VEC1_CAPACITY> v1cd; \
|
|
|
|
|
cc::const_vector<type, TEST_VEC2_CAPACITY> v2cd; \
|
|
|
|
|
decltype(v1o) v1m; \
|
|
|
|
|
decltype(v2o) v2m; \
|
|
|
|
|
cc::const_vector<type, TEST_VEC1_CAPACITY> v1a; \
|
|
|
|
|
cc::const_vector<type, TEST_VEC2_CAPACITY> v2a; \
|
|
|
|
|
} ret; \
|
|
|
|
|
\
|
|
|
|
|
ret.v1cs = v1o; \
|
|
|
|
|
ret.v2cs = v2o; \
|
|
|
|
|
ret.v1cd = v1o; \
|
|
|
|
|
ret.v2cd = v2o; \
|
|
|
|
|
ret.v1m = const_cast<cc::const_vector<decltype(v1o)::value_type, decltype(v1o)::_len>&&>(v1o); \
|
|
|
|
|
ret.v2m = const_cast<cc::const_vector<decltype(v2o)::value_type, decltype(v2o)::_len>&&>(v2o); \
|
|
|
|
|
ret.v1a = arr1; \
|
|
|
|
|
ret.v2a = arr2; \
|
|
|
|
|
\
|
|
|
|
|
return ret; \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DEFINE_APPLICATOR(int);
|
|
|
|
|
DEFINE_APPLICATOR(char);
|
|
|
|
|
DEFINE_APPLICATOR_EXT(string, const char *);
|
|
|
|
|
DEFINE_APPLICATOR_EXT(obj, TestStruct);
|
|
|
|
|
|
|
|
|
|
/*auto int_applicator = []() consteval {
|
|
|
|
|
cc::const_vector vi1o(C_VI_TEST_ARR1);
|
|
|
|
|
cc::const_vector vi2o(C_VI_TEST_ARR2);
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
decltype(vi1o) vi1cs;
|
|
|
|
|
decltype(vi2o) vi2cs;
|
|
|
|
|
cc::const_vector<int, TEST_VEC1_CAPACITY> vi1cd;
|
|
|
|
|
cc::const_vector<int, TEST_VEC2_CAPACITY> vi2cd;
|
|
|
|
|
decltype(vi1o) vi1m;
|
|
|
|
|
decltype(vi2o) vi2m;
|
|
|
|
|
cc::const_vector<int, int_defs::get_arr_len_for_type<1>()> vi1a;
|
|
|
|
|
cc::const_vector<int, VI_TEST_ARR2_LEN> vi2a;
|
|
|
|
|
} ret;
|
|
|
|
|
|
|
|
|
|
ret.vi1cs = vi1o;
|
|
|
|
|
ret.vi2cs = vi2o;
|
|
|
|
|
ret.vi1cd = vi1o;
|
|
|
|
|
ret.vi2cd = vi2o;
|
|
|
|
|
ret.vi1m = vi1o;
|
|
|
|
|
ret.vi2m = vi2o;
|
|
|
|
|
ret.vi1a = C_VI_TEST_ARR1;
|
|
|
|
|
ret.vi2a = C_VI_TEST_ARR2;
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
};*/
|
|
|
|
|
|
|
|
|
|
constexpr auto int_res = int_applicator();
|
|
|
|
|
constexpr auto char_res = char_applicator();
|
|
|
|
|
constexpr auto string_res = string_applicator();
|
|
|
|
|
constexpr auto obj_res = obj_applicator();
|
|
|
|
|
|
|
|
|
|
ASSERT(int_res.v1cs._len == VI_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(int_res.v2cs._len == VI_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT(int_res.v1cs._size == VI_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(int_res.v2cs._size == VI_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(int_res.v1cs, C_VI_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(int_res.v2cs, C_VI_TEST_ARR2)
|
|
|
|
|
ASSERT(int_res.v1cd._len == TEST_VEC1_CAPACITY)
|
|
|
|
|
ASSERT(int_res.v2cd._len == TEST_VEC2_CAPACITY)
|
|
|
|
|
ASSERT(int_res.v1cd._size == VI_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(int_res.v2cd._size == VI_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(int_res.v1cd, C_VI_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(int_res.v2cd, C_VI_TEST_ARR2)
|
|
|
|
|
ASSERT(int_res.v1m._len == VI_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(int_res.v2m._len == VI_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT(int_res.v1m._size == VI_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(int_res.v2m._size == VI_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(int_res.v1m, C_VI_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(int_res.v2m, C_VI_TEST_ARR2)
|
|
|
|
|
ASSERT(int_res.v1a._len == TEST_VEC1_CAPACITY)
|
|
|
|
|
ASSERT(int_res.v2a._len == TEST_VEC2_CAPACITY)
|
|
|
|
|
ASSERT(int_res.v1a._size == VI_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(int_res.v2a._size == VI_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(int_res.v1a, C_VI_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(int_res.v2a, C_VI_TEST_ARR2)
|
|
|
|
|
|
|
|
|
|
ASSERT(char_res.v1cs._len == VC_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(char_res.v2cs._len == VC_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT(char_res.v1cs._size == VC_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(char_res.v2cs._size == VC_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(char_res.v1cs, C_VC_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(char_res.v2cs, C_VC_TEST_ARR2)
|
|
|
|
|
ASSERT(char_res.v1cd._len == TEST_VEC1_CAPACITY)
|
|
|
|
|
ASSERT(char_res.v2cd._len == TEST_VEC2_CAPACITY)
|
|
|
|
|
ASSERT(char_res.v1cd._size == VC_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(char_res.v2cd._size == VC_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(char_res.v1cd, C_VC_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(char_res.v2cd, C_VC_TEST_ARR2)
|
|
|
|
|
ASSERT(char_res.v1m._len == VC_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(char_res.v2m._len == VC_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT(char_res.v1m._size == VC_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(char_res.v2m._size == VC_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(char_res.v1m, C_VC_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(char_res.v2m, C_VC_TEST_ARR2)
|
|
|
|
|
ASSERT(char_res.v1a._len == TEST_VEC1_CAPACITY)
|
|
|
|
|
ASSERT(char_res.v2a._len == TEST_VEC2_CAPACITY)
|
|
|
|
|
ASSERT(char_res.v1a._size == VC_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(char_res.v2a._size == VC_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(char_res.v1a, C_VC_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(char_res.v2a, C_VC_TEST_ARR2)
|
|
|
|
|
|
|
|
|
|
ASSERT(string_res.v1cs._len == VS_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(string_res.v2cs._len == VS_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT(string_res.v1cs._size == VS_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(string_res.v2cs._size == VS_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(string_res.v1cs, C_VS_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(string_res.v2cs, C_VS_TEST_ARR2)
|
|
|
|
|
ASSERT(string_res.v1cd._len == TEST_VEC1_CAPACITY)
|
|
|
|
|
ASSERT(string_res.v2cd._len == TEST_VEC2_CAPACITY)
|
|
|
|
|
ASSERT(string_res.v1cd._size == VS_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(string_res.v2cd._size == VS_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(string_res.v1cd, C_VS_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(string_res.v2cd, C_VS_TEST_ARR2)
|
|
|
|
|
ASSERT(string_res.v1m._len == VS_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(string_res.v2m._len == VS_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT(string_res.v1m._size == VS_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(string_res.v2m._size == VS_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(string_res.v1m, C_VS_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(string_res.v2m, C_VS_TEST_ARR2)
|
|
|
|
|
ASSERT(string_res.v1a._len == TEST_VEC1_CAPACITY)
|
|
|
|
|
ASSERT(string_res.v2a._len == TEST_VEC2_CAPACITY)
|
|
|
|
|
ASSERT(string_res.v1a._size == VS_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(string_res.v2a._size == VS_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(string_res.v1a, C_VS_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(string_res.v2a, C_VS_TEST_ARR2)
|
|
|
|
|
|
|
|
|
|
ASSERT(obj_res.v1cs._len == VO_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(obj_res.v2cs._len == VO_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT(obj_res.v1cs._size == VO_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(obj_res.v2cs._size == VO_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(obj_res.v1cs, C_VO_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(obj_res.v2cs, C_VO_TEST_ARR2)
|
|
|
|
|
ASSERT(obj_res.v1cd._len == TEST_VEC1_CAPACITY)
|
|
|
|
|
ASSERT(obj_res.v2cd._len == TEST_VEC2_CAPACITY)
|
|
|
|
|
ASSERT(obj_res.v1cd._size == VO_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(obj_res.v2cd._size == VO_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(obj_res.v1cd, C_VO_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(obj_res.v2cd, C_VO_TEST_ARR2)
|
|
|
|
|
ASSERT(obj_res.v1m._len == VO_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(obj_res.v2m._len == VO_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT(obj_res.v1m._size == VO_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(obj_res.v2m._size == VO_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(obj_res.v1m, C_VO_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(obj_res.v2m, C_VO_TEST_ARR2)
|
|
|
|
|
ASSERT(obj_res.v1a._len == TEST_VEC1_CAPACITY)
|
|
|
|
|
ASSERT(obj_res.v2a._len == TEST_VEC2_CAPACITY)
|
|
|
|
|
ASSERT(obj_res.v1a._size == VO_TEST_ARR1_LEN)
|
|
|
|
|
ASSERT(obj_res.v2a._size == VO_TEST_ARR2_LEN)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(obj_res.v1a, C_VO_TEST_ARR1)
|
|
|
|
|
ASSERT_VEC_ARR_EQ(obj_res.v2a, C_VO_TEST_ARR2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
@ -709,6 +929,7 @@ int main(int, char *[])
|
|
|
|
|
std::cout << "Test of constructor 'const_vector(InputIt first, InputIt last)': " << test_const_vector::test_constructor_iterator() << std::endl;
|
|
|
|
|
std::cout << "Test of copy constructors: " << test_const_vector::test_constructor_copy() << std::endl;
|
|
|
|
|
std::cout << "Test of move constructor: " << test_const_vector::test_constructor_move() << std::endl;
|
|
|
|
|
std::cout << "Test of move constructor: " << test_const_vector::test_operator_eq() << std::endl;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|