14 #include "quickcheck.hh"
16 #ifndef _PASL_DATA_TEST_GENERATORS_H_
17 #define _PASL_DATA_TEST_GENERATORS_H_
31 return quickcheck::generateInRange(
Item(1),
Item(1<<8));
34 static inline bool flip_coin() {
40 template <
class T,
class U,
class C,
class S>
43 for (
size_t i = 0; i < nb_items; i++) {
56 template <
class T,
class U,
class C>
59 for (
size_t i = 0; i < nb_items; i++) {
61 dst.trusted.push_back(v);
62 dst.untrusted.push_back(v);
67 template <
class T,
class U,
class C,
class S>
70 for (
size_t i = 0; i < nb; i++) {
71 int sz = (int)dst.
trusted.size();
72 int pos = (sz == 0) ? 0 : quickcheck::generateInRange(0, sz-1);
82 template <
class Item,
class U,
class C,
class S>
84 if (generate_by_insert)
90 template <
class Key,
class T,
class Compare,
class Alloc,
class U,
class C,
class S>
92 for (
size_t i = 0; i < nb; i++) {
93 Key key = quickcheck::generateInRange(0, Key(1<<18));
94 T val = generate_value<T>();
95 dst.trusted[key] = val;
96 dst.untrusted[key] = val;
trusted_container_type trusted
void random_insert_sequence(size_t nb, container_pair< T, U, C, S > &dst)
Data generation for randomize unit testing.
void generate(size_t &nb, container_pair< std::map< Key, T, Compare, Alloc >, U, C, S > &dst)
untrusted_container_type untrusted
void random_push_pop_sequence(size_t nb_items, container_pair< T, U, C, S > &dst)
void generate(size_t &nb, container_pair< pasl::data::stl::deque_seq< Item >, U, C, S > &dst)