diff --git a/tests/check-array.cpp b/tests/check-array.cpp index b3337b82..c0470d4d 100644 --- a/tests/check-array.cpp +++ b/tests/check-array.cpp @@ -58,4 +58,6 @@ void cmp_cont(array_int_t a, std::vector b) } #define DEFAULT_NUMBER 1000000 +#define HAVE_RESERVE +#define HAVE_RESIZE #include "check-generic.hpp" diff --git a/tests/check-generic.hpp b/tests/check-generic.hpp index ff279993..c777ea13 100644 --- a/tests/check-generic.hpp +++ b/tests/check-generic.hpp @@ -44,7 +44,7 @@ #define CONT_NAME_(CONT_OPL) M_GET_NAME CONT_OPL #define CONT_NAME CONT_NAME_(CONT_OPL) -#define MAX_TEST 25 +#define MAX_TEST 28 #ifdef HAVE_REVERSE_IT // Scan the C++ sequence in reverse @@ -380,6 +380,27 @@ void test(int select_test, int index, break; #endif +#ifdef HAVE_RESIZE + case 25: + index = (1 + (c1.size() < 1000000)) * (index % ( c1.size() + 1) ); + M_C(CONT_NAME, _resize)(c0, index); + c1.resize(index); + break; +#endif + +#ifdef HAVE_RESERVE + case 26: + index = c1.size() + ( index % (c1.size() + 1) ); + M_C(CONT_NAME, _reserve)(c0, index); + c1.reserve(index); + break; + + case 27: + M_C(CONT_NAME, _reserve)(c0, 0); + c1.shrink_to_fit(); + break; +#endif + // SPLICE_BACK // SPLICE_AT // Needs SPLICE ?