mirror of
https://github.com/boostorg/core.git
synced 2025-05-09 23:03:54 +00:00
Trim trailing spaces in boost::swap tests.
This commit is contained in:
parent
8a8738a981
commit
eda68d4086
@ -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);
|
||||
|
||||
|
@ -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));
|
||||
|
@ -52,13 +52,13 @@ int main()
|
||||
const std::size_t array_size = 2;
|
||||
const swap_test_template<int> initial_array1[array_size] = { { swap_test_class(1) }, { swap_test_class(2) } };
|
||||
const swap_test_template<int> initial_array2[array_size] = { { swap_test_class(3) }, { swap_test_class(4) } };
|
||||
|
||||
|
||||
swap_test_template<int> array1[array_size];
|
||||
swap_test_template<int> 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);
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
|
||||
template<class T> struct Wrapper
|
||||
{
|
||||
T value;
|
||||
@ -16,9 +16,9 @@ template<class T> inline void swap( Wrapper<T> & w, Wrapper<T> & v )
|
||||
{
|
||||
boost::swap( w, v );
|
||||
}
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::Wrapper<int> const w = { 2 };
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 <boost/utility/swap.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
@ -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);
|
||||
|
||||
|
@ -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 <boost/utility/swap.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
@ -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);
|
||||
|
@ -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 <boost/utility/swap.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user