From eda68d40862506466d68ff3059089f8a3ff969b7 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 7 Jan 2023 01:54:22 +0300 Subject: [PATCH] Trim trailing spaces in boost::swap tests. --- test/swap/swap_array_of_class.cpp | 4 ++-- test/swap/swap_array_of_int.cpp | 4 ++-- test/swap/swap_array_of_template.cpp | 4 ++-- test/swap/swap_const_wrapper_fail.cpp | 6 +++--- test/swap/swap_specialized_in_boost.cpp | 2 +- test/swap/swap_specialized_in_boost_and_other.cpp | 6 +++--- test/swap/swap_specialized_in_global.cpp | 4 ++-- test/swap/swap_specialized_in_other.cpp | 4 ++-- test/swap/swap_specialized_in_std.cpp | 4 ++-- test/swap/swap_std_typeinfo_ptr.cpp | 2 +- test/swap/swap_std_vector_of_boost.cpp | 8 ++++---- test/swap/swap_std_vector_of_global.cpp | 8 ++++---- test/swap/swap_std_vector_of_other.cpp | 6 +++--- test/swap/swap_test_class.hpp | 10 +++++----- 14 files changed, 36 insertions(+), 36 deletions(-) diff --git a/test/swap/swap_array_of_class.cpp b/test/swap/swap_array_of_class.cpp index 245602d..b8b496a 100644 --- a/test/swap/swap_array_of_class.cpp +++ b/test/swap/swap_array_of_class.cpp @@ -46,13 +46,13 @@ int main() const std::size_t array_size = 2; const swap_test_class initial_array1[array_size] = { swap_test_class(1), swap_test_class(2) }; const swap_test_class initial_array2[array_size] = { swap_test_class(3), swap_test_class(4) }; - + swap_test_class array1[array_size]; swap_test_class array2[array_size]; std::copy(initial_array1, initial_array1 + array_size, array1); std::copy(initial_array2, initial_array2 + array_size, array2); - + swap_test_class::reset(); boost::swap(array1, array2); diff --git a/test/swap/swap_array_of_int.cpp b/test/swap/swap_array_of_int.cpp index e8285e0..1978d90 100644 --- a/test/swap/swap_array_of_int.cpp +++ b/test/swap/swap_array_of_int.cpp @@ -20,13 +20,13 @@ int main() const std::size_t array_size = 3; const int initial_array1[array_size] = { 1, 2, 3 }; const int initial_array2[array_size] = { 4, 5, 6 }; - + int array1[array_size]; int array2[array_size]; std::copy(initial_array1, initial_array1 + array_size, array1); std::copy(initial_array2, initial_array2 + array_size, array2); - + boost::swap(array1, array2); BOOST_CHECK(std::equal(array1, array1 + array_size, initial_array2)); diff --git a/test/swap/swap_array_of_template.cpp b/test/swap/swap_array_of_template.cpp index 1ec33fd..652d418 100644 --- a/test/swap/swap_array_of_template.cpp +++ b/test/swap/swap_array_of_template.cpp @@ -52,13 +52,13 @@ int main() const std::size_t array_size = 2; const swap_test_template initial_array1[array_size] = { { swap_test_class(1) }, { swap_test_class(2) } }; const swap_test_template initial_array2[array_size] = { { swap_test_class(3) }, { swap_test_class(4) } }; - + swap_test_template array1[array_size]; swap_test_template array2[array_size]; std::copy(initial_array1, initial_array1 + array_size, array1); std::copy(initial_array2, initial_array2 + array_size, array2); - + swap_test_class::reset(); boost::swap(array1, array2); diff --git a/test/swap/swap_const_wrapper_fail.cpp b/test/swap/swap_const_wrapper_fail.cpp index da2e4c6..ea44a4d 100644 --- a/test/swap/swap_const_wrapper_fail.cpp +++ b/test/swap/swap_const_wrapper_fail.cpp @@ -6,7 +6,7 @@ namespace boost { - + template struct Wrapper { T value; @@ -16,9 +16,9 @@ template inline void swap( Wrapper & w, Wrapper & v ) { boost::swap( w, v ); } - + } // namespace boost - + int main() { boost::Wrapper const w = { 2 }; diff --git a/test/swap/swap_specialized_in_boost.cpp b/test/swap/swap_specialized_in_boost.cpp index dcb015d..ab74b5e 100644 --- a/test/swap/swap_specialized_in_boost.cpp +++ b/test/swap/swap_specialized_in_boost.cpp @@ -31,7 +31,7 @@ int main() boost::swap_test_class object1 = initial_value1; boost::swap_test_class object2 = initial_value2; - + boost::swap_test_class::reset(); boost::swap(object1,object2); diff --git a/test/swap/swap_specialized_in_boost_and_other.cpp b/test/swap/swap_specialized_in_boost_and_other.cpp index d596775..3f874bc 100644 --- a/test/swap/swap_specialized_in_boost_and_other.cpp +++ b/test/swap/swap_specialized_in_boost_and_other.cpp @@ -10,7 +10,7 @@ // in an other namespace to have a custom swap function in boost, because the // boost::swap utility should find the swap function in the other namespace, by // argument dependent lookup (ADL). Unfortunately ADL isn't fully implemented -// by some specific compiler versions, including Intel C++ 8.1, MSVC 7.1, and +// by some specific compiler versions, including Intel C++ 8.1, MSVC 7.1, and // Borland 5.9.3. Users of those compilers might consider adding a swap overload // to the boost namespace. @@ -50,13 +50,13 @@ int main() other::swap_test_class object1 = initial_value1; other::swap_test_class object2 = initial_value2; - + other::swap_test_class::reset(); boost::swap(object1,object2); BOOST_CHECK(object1 == initial_value2); BOOST_CHECK(object2 == initial_value1); - + BOOST_CHECK_EQUAL(other::swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(other::swap_test_class::copy_count(),0); diff --git a/test/swap/swap_specialized_in_global.cpp b/test/swap/swap_specialized_in_global.cpp index 8b0f10a..72eb15c 100644 --- a/test/swap/swap_specialized_in_global.cpp +++ b/test/swap/swap_specialized_in_global.cpp @@ -25,13 +25,13 @@ int main() swap_test_class object1 = initial_value1; swap_test_class object2 = initial_value2; - + swap_test_class::reset(); boost::swap(object1,object2); BOOST_CHECK(object1 == initial_value2); BOOST_CHECK(object2 == initial_value1); - + BOOST_CHECK_EQUAL(swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0); diff --git a/test/swap/swap_specialized_in_other.cpp b/test/swap/swap_specialized_in_other.cpp index 016cc8a..74240fc 100644 --- a/test/swap/swap_specialized_in_other.cpp +++ b/test/swap/swap_specialized_in_other.cpp @@ -31,13 +31,13 @@ int main() other::swap_test_class object1 = initial_value1; other::swap_test_class object2 = initial_value2; - + other::swap_test_class::reset(); boost::swap(object1,object2); BOOST_CHECK(object1 == initial_value2); BOOST_CHECK(object2 == initial_value1); - + BOOST_CHECK_EQUAL(other::swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(other::swap_test_class::copy_count(),0); diff --git a/test/swap/swap_specialized_in_std.cpp b/test/swap/swap_specialized_in_std.cpp index 62d4ee4..6be5e77 100644 --- a/test/swap/swap_specialized_in_std.cpp +++ b/test/swap/swap_specialized_in_std.cpp @@ -30,13 +30,13 @@ int main() swap_test_class object1 = initial_value1; swap_test_class object2 = initial_value2; - + swap_test_class::reset(); boost::swap(object1,object2); BOOST_CHECK(object1 == initial_value2); BOOST_CHECK(object2 == initial_value1); - + BOOST_CHECK_EQUAL(swap_test_class::swap_count(),1); BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0); diff --git a/test/swap/swap_std_typeinfo_ptr.cpp b/test/swap/swap_std_typeinfo_ptr.cpp index 10fd6e5..dfd35a5 100644 --- a/test/swap/swap_std_typeinfo_ptr.cpp +++ b/test/swap/swap_std_typeinfo_ptr.cpp @@ -19,7 +19,7 @@ int main() { const std::type_info * const initial_value1 = 0; const std::type_info * const initial_value2 = &typeid(double); - + const std::type_info * ptr1 = initial_value1; const std::type_info * ptr2 = initial_value2; diff --git a/test/swap/swap_std_vector_of_boost.cpp b/test/swap/swap_std_vector_of_boost.cpp index 93d5d61..e2badc5 100644 --- a/test/swap/swap_std_vector_of_boost.cpp +++ b/test/swap/swap_std_vector_of_boost.cpp @@ -5,7 +5,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // Tests swapping std::vector objects by means of boost::swap, -// having boost::swap_test_class as vector element type. +// having boost::swap_test_class as vector element type. #include #include @@ -39,12 +39,12 @@ int main() const vector_type initial_value1(initial_size1, swap_test_class_type(1)); const vector_type initial_value2(initial_size2, swap_test_class_type(2)); - + vector_type object1 = initial_value1; vector_type object2 = initial_value2; swap_test_class_type::reset(); - + boost::swap(object1,object2); BOOST_CHECK_EQUAL(object1.size(),initial_size2); @@ -52,7 +52,7 @@ int main() BOOST_CHECK(object1 == initial_value2); BOOST_CHECK(object2 == initial_value1); - + BOOST_CHECK_EQUAL(swap_test_class_type::swap_count(),0); BOOST_CHECK_EQUAL(swap_test_class_type::copy_count(),0); diff --git a/test/swap/swap_std_vector_of_global.cpp b/test/swap/swap_std_vector_of_global.cpp index 08d6974..11fe9b3 100644 --- a/test/swap/swap_std_vector_of_global.cpp +++ b/test/swap/swap_std_vector_of_global.cpp @@ -5,7 +5,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // Tests swapping std::vector objects by means of boost::swap, -// having ::swap_test_class as vector element type. +// having ::swap_test_class as vector element type. #include #include @@ -17,7 +17,7 @@ //Put test class in the global namespace #include "./swap_test_class.hpp" -//Provide swap function in the global namespace +//Provide swap function in the global namespace void swap(swap_test_class& left, swap_test_class& right) { left.swap(right); @@ -32,12 +32,12 @@ int main() const vector_type initial_value1(initial_size1, swap_test_class(1)); const vector_type initial_value2(initial_size2, swap_test_class(2)); - + vector_type object1 = initial_value1; vector_type object2 = initial_value2; swap_test_class::reset(); - + boost::swap(object1,object2); BOOST_CHECK_EQUAL(object1.size(),initial_size2); diff --git a/test/swap/swap_std_vector_of_other.cpp b/test/swap/swap_std_vector_of_other.cpp index 77a3525..a713767 100644 --- a/test/swap/swap_std_vector_of_other.cpp +++ b/test/swap/swap_std_vector_of_other.cpp @@ -5,7 +5,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // Tests swapping std::vector objects by means of boost::swap, -// having other::swap_test_class as vector element type. +// having other::swap_test_class as vector element type. #include #include @@ -39,12 +39,12 @@ int main() const vector_type initial_value1(initial_size1, swap_test_class_type(1)); const vector_type initial_value2(initial_size2, swap_test_class_type(2)); - + vector_type object1 = initial_value1; vector_type object2 = initial_value2; swap_test_class_type::reset(); - + boost::swap(object1,object2); BOOST_CHECK_EQUAL(object1.size(),initial_size2); diff --git a/test/swap/swap_test_class.hpp b/test/swap/swap_test_class.hpp index a25dbbd..a36bd41 100644 --- a/test/swap/swap_test_class.hpp +++ b/test/swap/swap_test_class.hpp @@ -59,7 +59,7 @@ public: { m_data = arg; } - + static unsigned int swap_count(){ return swapCount(); } static unsigned int copy_count(){ return copyCount(); } static unsigned int construct_count(){ return constructCount(); } @@ -68,7 +68,7 @@ public: static void reset() { swapCount() = 0; - copyCount() = 0; + copyCount() = 0; constructCount() = 0; destructCount() = 0; } @@ -80,19 +80,19 @@ private: return value; } - static unsigned int& copyCount() + static unsigned int& copyCount() { static unsigned int value = 0; return value; } - static unsigned int& constructCount() + static unsigned int& constructCount() { static unsigned int value = 0; return value; } - static unsigned int& destructCount() + static unsigned int& destructCount() { static unsigned int value = 0; return value;