chunkedseq
container library for large in-memory data sets
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
properties.hpp
Go to the documentation of this file.
1 
13 #include "generators.hpp"
14 
15 #ifndef _PASL_DATA_TEST_PROPERTIES_H_
16 #define _PASL_DATA_TEST_PROPERTIES_H_
17 
18 namespace pasl {
19 namespace data {
20 
21 /***********************************************************************/
22 
23 /*---------------------------------------------------------------------*/
24 /* Unit test properties for chunked bag */
25 
26 template <class Bag_pair>
28 public:
29 
30  using bag_pair_type = Bag_pair;
31  using trusted_type = typename bag_pair_type::trusted_container_type;
32  using untrusted_type = typename bag_pair_type::untrusted_container_type;
34 
35  // to check that a random sequence of pushes and pops give consistent results
36  class push_pop_sequence_same : public quickcheck::Property<size_t, bag_pair_type> {
37  public:
38  bool holdsFor(const size_t& _nb_items, const bag_pair_type& _items) {
39  bag_pair_type items(_items);
40  size_t nb_items = _nb_items;
41  random_push_pop_sequence(nb_items, items);
42  return check_and_print_container_pair(items);
43  }
44  };
45 
46  static bool split_and_check(bag_pair_type& items_src,
47  bag_pair_type& items_dst,
48  size_t split_position) {
49  assert(items_src.ok());
50  assert(split_position <= items_src.trusted.size());
51  items_src.trusted.split(split_position, items_dst.trusted);
52  items_src.untrusted.split(split_position, items_dst.untrusted);
53  bool ok_src_sz = items_src.trusted.size() == items_src.untrusted.size();
54  bool ok_dst_sz = items_dst.trusted.size() == items_dst.untrusted.size();
55  items_src.trusted.concat(items_dst.trusted);
56  items_src.untrusted.concat(items_dst.untrusted);
57  bool ok = check_and_print_container_pair(items_src);
58  bool all_ok = ok_src_sz && ok_dst_sz && ok;
59  return all_ok;
60  }
61 
62  // to check that a call to split on a random position gives consistent results
63  class split_same : public quickcheck::Property<bag_pair_type> {
64  public:
65  bool holdsFor(const bag_pair_type& _items) {
66  size_t sz = _items.trusted.size();
67  size_t split_position = quickcheck::generateInRange(size_t(0), sz);
68  bag_pair_type items_src(_items);
69  bag_pair_type items_dst;
70  assert(items_dst.trusted.empty());
71  assert(items_dst.untrusted.empty());
72  return split_and_check(items_src, items_dst, split_position);
73  }
74  };
75 
76  // to check that a concatentation gives consistent results
77  class concat_same : public quickcheck::Property<bag_pair_type, bag_pair_type> {
78  public:
79  bool holdsFor(const bag_pair_type& _items1, const bag_pair_type& _items2) {
80  bag_pair_type items1(_items1);
81  bag_pair_type items2(_items2);
82  items1.trusted.concat(items2.trusted);
83  items1.untrusted.concat(items2.untrusted);
84  bool items1_ok = check_and_print_container_pair(items1, "items1");
85  bool items2_ok = check_and_print_container_pair(items2, "items2");
86  return items1_ok && items2_ok;
87  }
88  };
89 
90  // to check that iterating via the iterator gives consistent results
91  class iterator_same : public quickcheck::Property<bag_pair_type> {
92  public:
93  int nb = 0;
94  bool holdsFor(const bag_pair_type& _items) {
95  bag_pair_type items(_items);
96  if (items.trusted.size() == 0)
97  return true;
98  assert(check_and_print_container_pair(items, ""));
99  assert(items.untrusted.begin().size() == 1);
100  assert(items.untrusted.size() + 1 == items.untrusted.end().size());
101  nb++;
102  if (nb == 33)
103  std::cout << "" << std::endl;
104  typename bag_pair_type::trusted_container_type t;
105  typename bag_pair_type::trusted_container_type u;
106  bool go_forward = flip_coin();
107  if (go_forward) { // iterate forward
108  for (auto it = items.trusted.begin(); it != items.trusted.end(); it++)
109  t.push_back(*it);
110  for (auto it = items.untrusted.begin(); it != items.untrusted.end(); it++)
111  u.push_back(*it);
112  } else { // iterate in reverse
113  for (auto it = items.trusted.end() - 1; it != items.trusted.begin(); it--)
114  t.push_back(*it);
115  for (auto it = items.untrusted.end() - 1; it != items.untrusted.begin(); it--)
116  u.push_back(*it);
117  t.push_back(*items.trusted.begin());
118  u.push_back(*items.untrusted.begin());
119  }
120  bool ok = bag_pair_type::trusted_same::same(t, u);
121  if (! ok) {
122  std::cout << "t.size=" <<t.size() << "u.size=" << u.size() << std::endl;
123  std::cout << t << std::endl;
124  std::cout << u << std::endl;
125  }
126  return ok;
127  }
128  };
129 
130  // to check that the for_each_segment operator gives correct results
131  class for_each_segment_correct : public quickcheck::Property<bag_pair_type> {
132  public:
133  bool holdsFor(const bag_pair_type& _items) {
134  bag_pair_type items(_items);
135  for (size_t i = 0; i < items.trusted.size(); i++)
136  items.trusted[i]++;
137  items.untrusted.for_each_segment([&] (value_type* lo, value_type* hi) {
138  for (value_type* p = lo; p != hi; p++)
139  (*p)++;
140  });
141  bool ok = check_and_print_container_pair(items);
142  return ok;
143  }
144  };
145 
146  // to check that multi-push and multi-pop operations give correct results
147  class pushn_popn_sequence_same : public quickcheck::Property<bag_pair_type,std::vector<int>> {
148  public:
149  bool holdsFor(const bag_pair_type& _items, const std::vector<int>& _vec) {
150  bag_pair_type items(_items);
151  size_t sz_items = items.trusted.size();
152  std::vector<int> trusted_vec(_vec);
153  std::vector<int> untrusted_vec(_vec);
154  size_t sz_vec = _vec.size();
155  int* trusted_data_vec = trusted_vec.data();
156  int* untrusted_data_vec = untrusted_vec.data();
157  bool should_push = flip_coin();
158  bool ok1;
159  if (should_push) {
160  items.trusted.pushn_back(trusted_data_vec, sz_vec);
161  items.untrusted.pushn_back(untrusted_data_vec, sz_vec);
162  ok1 = check_and_print_container_pair(items);
163  } else { // should pop
164  size_t nb_to_pop = std::min(sz_items, sz_vec);
165  trusted_vec.resize(nb_to_pop);
166  untrusted_vec.resize(nb_to_pop);
167  items.trusted.popn_back(trusted_data_vec, nb_to_pop);
168  items.untrusted.popn_back(untrusted_data_vec, nb_to_pop);
169  ok1 = items.trusted.size() == items.untrusted.size();
170  }
171  bool ok2 = trusted_vec.size() == untrusted_vec.size();
172  if (! ok2) {
173  std::cout << " trusted vec:" << trusted_vec << std::endl;
174  std::cout << "untrusted vec:" << untrusted_vec << std::endl;
175  }
176  return ok1 && ok2;
177  }
178  };
179 
180  class backn_frontn_sequence_same : public quickcheck::Property<bag_pair_type> {
181  public:
182  bool holdsFor(const bag_pair_type& _items) {
183  bag_pair_type items(_items);
184  size_t sz_items = items.trusted.size();
185  size_t nb = (size_t)quickcheck::generateInRange(0, (int)sz_items);
186  std::vector<int> trusted_vec(nb, -1);
187  std::vector<int> untrusted_vec(nb, -1);
188  bool act_on_front = flip_coin();
189  if (act_on_front) {
190  items.trusted.frontn(trusted_vec.data(), nb);
191  items.untrusted.frontn(untrusted_vec.data(), nb);
192  } else { // read from back
193  items.trusted.backn(trusted_vec.data(), nb);
194  items.untrusted.backn(untrusted_vec.data(), nb);
195  }
196  bool ok = trusted_vec.size() == untrusted_vec.size();
197  if (! ok) {
198  std::cout << " trusted vec:" << trusted_vec << std::endl;
199  std::cout << "untrusted vec:" << untrusted_vec << std::endl;
200  }
201  return ok;
202  }
203  };
204 
205 };
206 
207 /*---------------------------------------------------------------------*/
208 /* Unit test properties for chunked sequence */
209 
210 template <class Container_pair>
212 public:
213 
214  using container_pair_type = Container_pair;
215  using trusted_type = typename container_pair_type::trusted_container_type;
216  using untrusted_type = typename container_pair_type::untrusted_container_type;
218 
219  // to check that a random sequence of pushes and pops give consistent results
220  class push_pop_sequence_same : public quickcheck::Property<size_t, container_pair_type> {
221  public:
222  bool holdsFor(const size_t& _nb_items, const container_pair_type& _items) {
223  container_pair_type items(_items);
224  size_t nb_items = _nb_items;
225  random_push_pop_sequence(nb_items, items);
226  return check_and_print_container_pair(items);
227  }
228  };
229 
230  static bool split_and_check(container_pair_type& items_src,
231  container_pair_type& items_dst,
232  size_t split_position) {
233  assert(items_src.ok());
234  assert(split_position <= items_src.trusted.size());
235  items_src.trusted.split(split_position, items_dst.trusted);
236  items_src.untrusted.split(split_position, items_dst.untrusted);
237  bool src_ok = check_and_print_container_pair(items_src, "src");
238  bool dst_ok = check_and_print_container_pair(items_dst, "dst");
239  bool all_ok = src_ok && dst_ok;
240  if (! all_ok) {
241  std::cout << "split position is " << split_position << std::endl;
242  }
243  return all_ok;
244  }
245 
246  // to check that a call to split on a random position gives consistent results
247  class split_same : public quickcheck::Property<container_pair_type> {
248  public:
249  bool holdsFor(const container_pair_type& _items) {
250  size_t sz = _items.trusted.size();
251  size_t split_position = quickcheck::generateInRange(size_t(0), sz);
252  container_pair_type items_src(_items);
253  container_pair_type items_dst;
254  assert(items_dst.trusted.empty());
255  assert(items_dst.untrusted.empty());
256  return split_and_check(items_src, items_dst, split_position);
257  }
258  };
259 
260  // to check that calls to split at all legal positions in a randomly selected range gives consistent results
261  class split_in_range_same : public quickcheck::Property<container_pair_type> {
262  public:
263  bool holdsFor(const container_pair_type& _items) {
264  size_t sz = _items.trusted.size();
265  size_t start = quickcheck::generateInRange(size_t(0), sz);
266  size_t end = std::min(sz, start + 10);
267  for (size_t split_position = start; split_position <= end; split_position++) {
268  container_pair_type items_src(_items);
269  container_pair_type items_dst;
270  if (! split_and_check(items_src, items_dst, split_position))
271  return false;
272  }
273  return true;
274  }
275  };
276 
277  // to check that a concatentation gives consistent results
278  class concat_same : public quickcheck::Property<container_pair_type, container_pair_type> {
279  public:
280  bool holdsFor(const container_pair_type& _items1, const container_pair_type& _items2) {
281  container_pair_type items1(_items1);
282  container_pair_type items2(_items2);
283  items1.trusted.concat(items2.trusted);
284  items1.untrusted.concat(items2.untrusted);
285  bool items1_ok = check_and_print_container_pair(items1, "items1");
286  bool items2_ok = check_and_print_container_pair(items2, "items2");
287  return items1_ok && items2_ok;
288  }
289  };
290 
291  // to check that the subscript operator gives consistent results
292  class random_access_same : public quickcheck::Property<container_pair_type> {
293  public:
294  bool holdsFor(const container_pair_type& _items) {
295  container_pair_type items(_items);
296  size_t sz = items.trusted.size();
297  size_t i = quickcheck::generateInRange(size_t(0), sz-1);
298  value_type t = items.trusted[i];
299  value_type u = items.untrusted[i];
300  bool ok = t == u;
301  if (! ok) {
302  std::cout << "trusted[" << i << "]=" << t << std::endl;
303  std::cout << "untrusted[" << i << "]=" << u << std::endl;
304  }
305  return ok;
306  }
307  };
308 
309  // to check that iterating via the iterator gives consistent results
310  class iterator_same : public quickcheck::Property<container_pair_type> {
311  public:
312  int nb = 0;
313  bool holdsFor(const container_pair_type& _items) {
314  container_pair_type items(_items);
315  if (items.trusted.size() == 0)
316  return true;
317  assert(check_and_print_container_pair(items, ""));
318  assert(items.untrusted.begin().size() == 1);
319  assert(items.untrusted.size() + 1 == items.untrusted.end().size());
320  nb++;
321  if (nb == 33)
322  std::cout << "" << std::endl;
323  typename container_pair_type::trusted_container_type t;
324  typename container_pair_type::trusted_container_type u;
325  bool go_forward = flip_coin();
326  if (go_forward) { // iterate forward
327  for (auto it = items.trusted.begin(); it != items.trusted.end(); it++)
328  t.push_back(*it);
329  for (auto it = items.untrusted.begin(); it != items.untrusted.end(); it++)
330  u.push_back(*it);
331  } else { // iterate in reverse
332  for (auto it = items.trusted.end() - 1; it != items.trusted.begin(); it--)
333  t.push_back(*it);
334  for (auto it = items.untrusted.end() - 1; it != items.untrusted.begin(); it--)
335  u.push_back(*it);
336  }
337  bool ok = t == u;
338  if (! ok) {
339  std::cout << "t.size=" <<t.size() << "u.size=" << u.size() << std::endl;
340  std::cout << t << std::endl;
341  std::cout << u << std::endl;
342  }
343  return ok;
344  }
345  };
346 
347  // to check that backtracking search gives correct results via random repositionings of the iterator
348  class random_access_iterator_same : public quickcheck::Property<container_pair_type> {
349  public:
350  bool holdsFor(const container_pair_type& _items) {
351  class itemprinter {
352  public:
353  static void print(int x) {
354  std::cout << x;
355  }
356  };
357  container_pair_type items(_items);
358  size_t sz = items.trusted.size();
359  typename container_pair_type::trusted_container_type::iterator it_t = items.trusted.begin();
360  typename container_pair_type::untrusted_container_type::iterator it_u = items.untrusted.begin();
361  const int nb = 50;
362  for (int i = 0; i < nb; i++) {
363  int cur = (int)it_u.size() - 1;
364  int k = quickcheck::generateInRange(0, (int)sz-1);
365  int l = k - cur;
366 
367  if (l >= 0) {
368  it_t += l;
369  it_u += l;
370  } else {
371  it_t -= -1 * l;
372  it_u -= -1 * l;
373  }
374  size_t it_u_sz = it_u.size();
375  if (it_u_sz != k + 1)
376  return false;
377  int sz_t = int(it_t - items.trusted.begin());
378  int sz_u = int(it_u.size() - items.untrusted.begin().size());
379  if (sz_t != sz_u)
380  return false;
381  int xu = *it_u;
382  int xt = *it_t;
383  if (xu != xt) {
384  return false;
385  }
386  }
387  return true;
388  }
389  };
390 
391  // to check that the insert operator gives consistent results
392  class insert_same : public quickcheck::Property<container_pair_type> {
393  public:
394  int nb=0;
395  bool holdsFor(const container_pair_type& _items) {
396  container_pair_type items(_items);
397  int nb_to_insert = quickcheck::generateInRange(1, 20);
398  for (int i = 0; i < nb_to_insert; i++) {
399  nb++;
400  if (nb == 8) {
401  //std::cout << items.untrusted << std::endl;
402  }
403  //assert(items.untrusted.begin().size()==1);
404  int sz = (int)items.trusted.size();
405  size_t pos = quickcheck::generateInRange(0, sz-1);
406  value_type x = generate_value<value_type>();
407  items.trusted.insert(items.trusted.begin() + pos, x);
408  items.untrusted.insert(items.untrusted.begin() + pos, x);
409  if (! check_and_print_container_pair(items, "insert1")) {
410  std::cout << "insert at pos=" << pos << std::endl;
411  std::cout << "val=" << x << std::endl;
412  //std::cout << "itsz=" << (items.untrusted.begin()+pos).size() << std::endl;
413  return false;
414  }
415  }
416  bool ok = check_and_print_container_pair(items, "final result");
417  return ok;
418  }
419  };
420 
421  // to check that the erase operator gives consistent results
422  class erase_same : public quickcheck::Property<container_pair_type> {
423  public:
424  bool holdsFor(const container_pair_type& _items) {
425  container_pair_type items(_items);
426  int target_nb_calls_to_erase = quickcheck::generateInRange(1, 100);
427  for (int i = 0; i < target_nb_calls_to_erase; i++) {
428  int sz = items.trusted.size();
429  if (sz == 0)
430  break;
431  size_t first = (size_t)quickcheck::generateInRange(0, sz-1);
432  size_t nb_rem = sz - first;
433  size_t last = (size_t)quickcheck::generateInRange(first, first + nb_rem - 1);
434  assert(first >= 0);
435  assert(first <= last);
436  items.trusted.erase(items.trusted.begin() + first, items.trusted.begin() + last);
437  items.untrusted.erase(items.untrusted.begin() + first, items.untrusted.begin() + last);
438  if (! check_and_print_container_pair(items, "erase")) {
439  std::cout << "first=" << first << " last=" << last << std::endl;
440  return false;
441  }
442  }
443  bool ok = check_and_print_container_pair(items, "final result");
444  return ok;
445  }
446  };
447 
448  // to check that the for_each_segment operator gives correct results
449  class for_each_segment_correct : public quickcheck::Property<container_pair_type> {
450  public:
451  bool holdsFor(const container_pair_type& _items) {
452  container_pair_type items(_items);
453  for (size_t i = 0; i < items.trusted.size(); i++)
454  items.trusted[i]++;
455  items.untrusted.for_each_segment([&] (value_type* lo, value_type* hi) {
456  for (value_type* p = lo; p != hi; p++)
457  (*p)++;
458  });
459  bool ok = check_and_print_container_pair(items);
460  return ok;
461  }
462  };
463 
464  // to check that the for_each_segment-in-interval operator gives correct results
465  class for_each_in_interval_correct : public quickcheck::Property<container_pair_type> {
466  public:
467  bool holdsFor(const container_pair_type& _items) {
468  container_pair_type items(_items);
469  int sz = items.trusted.size();
470  size_t first = (size_t)quickcheck::generateInRange(0, sz-1);
471  size_t nb_rem = sz - first;
472  size_t last = (size_t)quickcheck::generateInRange(first, first + nb_rem - 1);
473  for (size_t i = first; i <= last; i++)
474  items.trusted[i]++;
475  auto beg = items.untrusted.begin() + first;
476  auto end = items.untrusted.begin() + last + 1;
477  items.untrusted.for_each(beg, end, [&] (value_type& p) { p++; });
478  bool ok = check_and_print_container_pair(items);
479  return ok;
480  }
481  };
482 
483  // to check that multi-push and multi-pop operations give correct results
484  class pushn_popn_sequence_same : public quickcheck::Property<container_pair_type,std::vector<int>> {
485  public:
486  bool holdsFor(const container_pair_type& _items, const std::vector<int>& _vec) {
487  container_pair_type items(_items);
488  size_t sz_items = items.trusted.size();
489  std::vector<int> trusted_vec(_vec);
490  std::vector<int> untrusted_vec(_vec);
491  size_t sz_vec = _vec.size();
492  int* trusted_data_vec = trusted_vec.data();
493  int* untrusted_data_vec = untrusted_vec.data();
494  bool should_push = flip_coin();
495  bool act_on_front = flip_coin();
496  if (should_push) {
497  if (act_on_front) {
498  items.trusted.pushn_front(trusted_data_vec, sz_vec);
499  items.untrusted.pushn_front(untrusted_data_vec, sz_vec);
500  } else { // push on back
501  items.trusted.pushn_back(trusted_data_vec, sz_vec);
502  items.untrusted.pushn_back(untrusted_data_vec, sz_vec);
503  }
504  } else { // should pop
505  size_t nb_to_pop = std::min(sz_items, sz_vec);
506  trusted_vec.resize(nb_to_pop);
507  untrusted_vec.resize(nb_to_pop);
508  if (act_on_front) {
509  items.trusted.popn_front(trusted_data_vec, nb_to_pop);
510  items.untrusted.popn_front(untrusted_data_vec, nb_to_pop);
511  } else { // pop from back
512  items.trusted.popn_back(trusted_data_vec, nb_to_pop);
513  items.untrusted.popn_back(untrusted_data_vec, nb_to_pop);
514  }
515  }
516  bool ok1 = check_and_print_container_pair(items);
517  bool ok2 = trusted_vec == untrusted_vec;
518  if (! ok2) {
519  std::cout << " trusted vec:" << trusted_vec << std::endl;
520  std::cout << "untrusted vec:" << untrusted_vec << std::endl;
521  }
522  return ok1 && ok2;
523  }
524  };
525 
526  class backn_frontn_sequence_same : public quickcheck::Property<container_pair_type> {
527  public:
528  bool holdsFor(const container_pair_type& _items) {
529  container_pair_type items(_items);
530  size_t sz_items = items.trusted.size();
531  size_t nb = (size_t)quickcheck::generateInRange(0, (int)sz_items);
532  std::vector<int> trusted_vec(nb, -1);
533  std::vector<int> untrusted_vec(nb, -1);
534  bool act_on_front = flip_coin();
535  if (act_on_front) {
536  items.trusted.frontn(trusted_vec.data(), nb);
537  items.untrusted.frontn(untrusted_vec.data(), nb);
538  } else { // read from back
539  items.trusted.backn(trusted_vec.data(), nb);
540  items.untrusted.backn(untrusted_vec.data(), nb);
541  }
542  bool ok = trusted_vec == untrusted_vec;
543  if (! ok) {
544  std::cout << " trusted vec:" << trusted_vec << std::endl;
545  std::cout << "untrusted vec:" << untrusted_vec << std::endl;
546  }
547  return ok;
548  }
549  };
550 
551 };
552 
553 /*---------------------------------------------------------------------*/
554 
555 template <class Container_pair>
557 public:
558 
559  using container_pair_type = Container_pair;
560  using trusted_type = typename container_pair_type::trusted_container_type;
561  using untrusted_type = typename container_pair_type::untrusted_container_type;
563 
564  // to check that our implementation of dynamic dictionary gives consistent results with std::map
565  class map_same : public quickcheck::Property<container_pair_type> {
566  public:
567  int nb = 0;
568  bool holdsFor(const container_pair_type& _map) {
569  container_pair_type map(_map);
570  bool ok = true;
571  int nb_new = quickcheck::generateInRange(0, 100);
572  static constexpr int lo = 0;
573  static constexpr int hi = 1<<15;
574  for (int i = 0; i < nb_new; i++) {
575  int key = quickcheck::generateInRange(lo, hi);
576  int val = generate_value<int>();
577  if (map.trusted.find(key) != map.trusted.end()) {
578  nb++;
579  // key should be in map
580  auto it1 = map.trusted.find(key);
581  auto it2 = map.untrusted.find(key);
582  if (it2 == map.untrusted.end())
583  return false;
584  bool ok2 = (*it1).second == (*it2).second;
585  if (! ok2) {
586  std::cout << "trusted=" << (*it1).first << " " << (*it1).second << " untrusted=" << (*it2).first << " " << (*it2).second << std::endl;
587  assert(check_and_print_container_pair(map));
588  std::cout << map << std::endl;
589  return false;
590  }
591  ok = ok && ok2;
592  }
593  map.trusted[key] = val;
594  map.untrusted[key] = val;
595  }
596  bool ok2 = check_and_print_container_pair(map);
597  if (! ok) {
598  return false;
599  }
600  if (!ok2) {
601  return false;
602  }
603  ok = ok && ok2;
604  return ok;
605  }
606  };
607 
608 };
609 
610 /***********************************************************************/
611 
612 } // end namespace
613 } // end namespace
614 
615 #endif
typename trusted_type::value_type value_type
Definition: properties.hpp:33
typename container_pair_type::trusted_container_type trusted_type
Definition: properties.hpp:560
bool holdsFor(const container_pair_type &_map)
Definition: properties.hpp:568
typename container_pair_type::untrusted_container_type untrusted_type
Definition: properties.hpp:561
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:424
bool holdsFor(const container_pair_type &_items, const std::vector< int > &_vec)
Definition: properties.hpp:486
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:294
typename container_pair_type::trusted_container_type trusted_type
Definition: properties.hpp:215
bool holdsFor(const container_pair_type &_items1, const container_pair_type &_items2)
Definition: properties.hpp:280
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:467
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:313
bool holdsFor(const size_t &_nb_items, const bag_pair_type &_items)
Definition: properties.hpp:38
bool holdsFor(const bag_pair_type &_items)
Definition: properties.hpp:94
Definition: algebra.hpp:18
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:395
Data generation for randomize unit testing.
typename trusted_type::value_type value_type
Definition: properties.hpp:562
typename bag_pair_type::trusted_container_type trusted_type
Definition: properties.hpp:31
typename container_pair_type::untrusted_container_type untrusted_type
Definition: properties.hpp:216
bool holdsFor(const bag_pair_type &_items)
Definition: properties.hpp:65
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:263
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:451
void random_push_pop_sequence(size_t nb_items, container_pair< T, U, C, S > &dst)
Definition: generators.hpp:41
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:528
typename trusted_type::value_type value_type
Definition: properties.hpp:217
Container_pair container_pair_type
Definition: properties.hpp:214
bool holdsFor(const bag_pair_type &_items1, const bag_pair_type &_items2)
Definition: properties.hpp:79
bool check_and_print_container_pair(const container_pair< T, U, C, S > &cp, std::string msg="")
Definition: prelims.hpp:198
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:249
Container_pair container_pair_type
Definition: properties.hpp:559
bool holdsFor(const bag_pair_type &_items, const std::vector< int > &_vec)
Definition: properties.hpp:149
bool holdsFor(const size_t &_nb_items, const container_pair_type &_items)
Definition: properties.hpp:222
static bool split_and_check(container_pair_type &items_src, container_pair_type &items_dst, size_t split_position)
Definition: properties.hpp:230
static bool split_and_check(bag_pair_type &items_src, bag_pair_type &items_dst, size_t split_position)
Definition: properties.hpp:46
bool holdsFor(const container_pair_type &_items)
Definition: properties.hpp:350
typename bag_pair_type::untrusted_container_type untrusted_type
Definition: properties.hpp:32