File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,11 @@ template<unsigned int N, typename T>
1919class prevector_tester {
2020 typedef std::vector<T> realtype;
2121 realtype real_vector;
22+ realtype real_vector_alt;
2223
2324 typedef prevector<N, T> pretype;
2425 pretype pre_vector;
26+ pretype pre_vector_alt;
2527
2628 typedef typename pretype::size_type Size;
2729
@@ -149,6 +151,12 @@ class prevector_tester {
149151 pre_vector.shrink_to_fit ();
150152 test ();
151153 }
154+
155+ void swap () {
156+ real_vector.swap (real_vector_alt);
157+ pre_vector.swap (pre_vector_alt);
158+ test ();
159+ }
152160};
153161
154162BOOST_AUTO_TEST_CASE (PrevectorTestInt)
@@ -204,12 +212,15 @@ BOOST_AUTO_TEST_CASE(PrevectorTestInt)
204212 if (test.size () > 0 ) {
205213 test.update (insecure_rand () % test.size (), insecure_rand ());
206214 }
207- if (((r >> 11 ) & 1024 ) == 11 ) {
215+ if (((r >> 11 ) % 1024 ) == 11 ) {
208216 test.clear ();
209217 }
210- if (((r >> 21 ) & 512 ) == 12 ) {
218+ if (((r >> 21 ) % 512 ) == 12 ) {
211219 test.assign (insecure_rand () % 32 , insecure_rand ());
212220 }
221+ if (((r >> 15 ) % 64 ) == 3 ) {
222+ test.swap ();
223+ }
213224 }
214225 }
215226}
You can’t perform that action at this time.
0 commit comments