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>
19
19
class prevector_tester {
20
20
typedef std::vector<T> realtype;
21
21
realtype real_vector;
22
+ realtype real_vector_alt;
22
23
23
24
typedef prevector<N, T> pretype;
24
25
pretype pre_vector;
26
+ pretype pre_vector_alt;
25
27
26
28
typedef typename pretype::size_type Size;
27
29
@@ -149,6 +151,12 @@ class prevector_tester {
149
151
pre_vector.shrink_to_fit ();
150
152
test ();
151
153
}
154
+
155
+ void swap () {
156
+ real_vector.swap (real_vector_alt);
157
+ pre_vector.swap (pre_vector_alt);
158
+ test ();
159
+ }
152
160
};
153
161
154
162
BOOST_AUTO_TEST_CASE (PrevectorTestInt)
@@ -204,12 +212,15 @@ BOOST_AUTO_TEST_CASE(PrevectorTestInt)
204
212
if (test.size () > 0 ) {
205
213
test.update (insecure_rand () % test.size (), insecure_rand ());
206
214
}
207
- if (((r >> 11 ) & 1024 ) == 11 ) {
215
+ if (((r >> 11 ) % 1024 ) == 11 ) {
208
216
test.clear ();
209
217
}
210
- if (((r >> 21 ) & 512 ) == 12 ) {
218
+ if (((r >> 21 ) % 512 ) == 12 ) {
211
219
test.assign (insecure_rand () % 32 , insecure_rand ());
212
220
}
221
+ if (((r >> 15 ) % 64 ) == 3 ) {
222
+ test.swap ();
223
+ }
213
224
}
214
225
}
215
226
}
You can’t perform that action at this time.
0 commit comments