Permalink
Browse files

Add array swap test

  • Loading branch information...
1 parent fe47191 commit 9c0081a907bc4b1431abe3de09a21450308d56f0 @Mortal Mortal committed Aug 27, 2012
Showing with 13 additions and 2 deletions.
  1. +1 −1 test/unit/CMakeLists.txt
  2. +12 −1 test/unit/test_array.cpp
View
@@ -19,7 +19,7 @@ endmacro(add_fulltest)
add_unittest(allocator deque list)
add_unittest(ami_stream basic truncate)
-add_unittest(array basic iterators auto_ptr memory segmented memory_segmented bit_basic bit_iterators bit_memory copyempty arrayarray frontback)
+add_unittest(array basic iterators auto_ptr memory segmented memory_segmented bit_basic bit_iterators bit_memory copyempty arrayarray frontback swap)
add_unittest(disjoint_set basic memory)
add_unittest(external_priority_queue basic)
add_unittest(external_queue basic sized)
View
@@ -293,6 +293,15 @@ bool frontback() {
return true;
}
+bool swap_test() {
+ {
+ array<int> a(42, 42);
+ array<int> b(84);
+ a.swap(b);
+ }
+ return true;
+}
+
int main(int argc, char **argv) {
BOOST_CONCEPT_ASSERT((linear_memory_structure_concept<array<int> >));
BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<array<int>::const_iterator>));
@@ -315,5 +324,7 @@ int main(int argc, char **argv) {
.test(array_bool_memory_test(), "bit_memory")
.test(copyempty, "copyempty")
.test(arrayarray, "arrayarray")
- .test(frontback, "frontback");
+ .test(frontback, "frontback")
+ .test(swap_test, "swap")
+ ;
}

0 comments on commit 9c0081a

Please sign in to comment.