mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Corrected duplicated file contents
[SVN r47607]
This commit is contained in:
parent
28fff2d821
commit
6098304ea8
@ -7,12 +7,3 @@
|
||||
// Tests that the swap header compiles as a standalone translation unit
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Tests that the swap header compiles as a standalone translation unit
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
|
@ -8,13 +8,4 @@
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#include <boost/utility/swap.hpp>
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Tests that the swap header include guards work correctly
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#include <boost/utility/swap.hpp>
|
||||
|
@ -8,13 +8,4 @@
|
||||
|
||||
#include <boost/swap.hpp>
|
||||
#include <boost/utility/swap.hpp>
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Tests that the swap headers work when both are included
|
||||
|
||||
#include <boost/swap.hpp>
|
||||
#include <boost/utility/swap.hpp>
|
||||
|
@ -8,13 +8,5 @@
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Tests that the swap headers work when both are included
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
|
@ -20,25 +20,4 @@ int test_main(int, char*[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
int test_main(int, char*[])
|
||||
{
|
||||
int object1 = 1;
|
||||
int object2 = 2;
|
||||
|
||||
boost::swap(object1,object2);
|
||||
|
||||
BOOST_CHECK_EQUAL(object1,2);
|
||||
BOOST_CHECK_EQUAL(object2,1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -7,12 +7,4 @@
|
||||
// Tests that the swap header compiles as a standalone translation unit
|
||||
|
||||
#include <boost/swap.hpp>
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Tests that the swap header compiles as a standalone translation unit
|
||||
|
||||
#include <boost/swap.hpp>
|
||||
|
@ -8,13 +8,4 @@
|
||||
|
||||
#include <boost/swap.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Tests that the swap header include guards work correctly
|
||||
|
||||
#include <boost/swap.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
|
@ -34,39 +34,4 @@ int test_main(int, char*[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
//Put test class in namespace boost
|
||||
namespace boost
|
||||
{
|
||||
#include "./swap_test_class.hpp"
|
||||
}
|
||||
|
||||
//Provide swap function in namespace boost
|
||||
namespace boost
|
||||
{
|
||||
void swap(swap_test_class& left, swap_test_class& right)
|
||||
{
|
||||
left.swap(right);
|
||||
}
|
||||
}
|
||||
|
||||
int test_main(int, char*[])
|
||||
{
|
||||
boost::swap_test_class object1;
|
||||
boost::swap_test_class object2;
|
||||
boost::swap(object1,object2);
|
||||
|
||||
BOOST_CHECK_EQUAL(boost::swap_test_class::swap_count(),1);
|
||||
BOOST_CHECK_EQUAL(boost::swap_test_class::copy_count(),0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,33 +28,4 @@ int test_main(int, char*[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
//Put test class in the global namespace
|
||||
#include "./swap_test_class.hpp"
|
||||
|
||||
//Provide swap function in gloabl namespace
|
||||
void swap(swap_test_class& left, swap_test_class& right)
|
||||
{
|
||||
left.swap(right);
|
||||
}
|
||||
|
||||
int test_main(int, char*[])
|
||||
{
|
||||
swap_test_class object1;
|
||||
swap_test_class object2;
|
||||
boost::swap(object1,object2);
|
||||
|
||||
BOOST_CHECK_EQUAL(swap_test_class::swap_count(),1);
|
||||
BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -34,39 +34,4 @@ int test_main(int, char*[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
//Put test class in namespace other
|
||||
namespace other
|
||||
{
|
||||
#include "./swap_test_class.hpp"
|
||||
}
|
||||
|
||||
//Provide swap function in namespace other
|
||||
namespace other
|
||||
{
|
||||
void swap(swap_test_class& left, swap_test_class& right)
|
||||
{
|
||||
left.swap(right);
|
||||
}
|
||||
}
|
||||
|
||||
int test_main(int, char*[])
|
||||
{
|
||||
other::swap_test_class object1;
|
||||
other::swap_test_class object2;
|
||||
boost::swap(object1,object2);
|
||||
|
||||
BOOST_CHECK_EQUAL(other::swap_test_class::swap_count(),1);
|
||||
BOOST_CHECK_EQUAL(other::swap_test_class::copy_count(),0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -33,38 +33,4 @@ int test_main(int, char*[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
//Put test class in the global namespace
|
||||
#include "./swap_test_class.hpp"
|
||||
|
||||
|
||||
//Provide swap function in namespace std
|
||||
namespace std
|
||||
{
|
||||
template <>
|
||||
void swap(swap_test_class& left, swap_test_class& right)
|
||||
{
|
||||
left.swap(right);
|
||||
}
|
||||
}
|
||||
|
||||
int test_main(int, char*[])
|
||||
{
|
||||
swap_test_class object1;
|
||||
swap_test_class object2;
|
||||
boost::swap(object1,object2);
|
||||
|
||||
BOOST_CHECK_EQUAL(swap_test_class::swap_count(),1);
|
||||
BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -37,42 +37,4 @@ int test_main(int, char*[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/utility/swap.hpp>
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
//Put test class in the global namespace
|
||||
#include "./swap_test_class.hpp"
|
||||
|
||||
|
||||
int test_main(int, char*[])
|
||||
{
|
||||
const std::size_t dimension = 7;
|
||||
|
||||
swap_test_class array1[dimension];
|
||||
swap_test_class array2[dimension];
|
||||
boost::swap(array1, array2);
|
||||
|
||||
BOOST_CHECK_EQUAL(swap_test_class::swap_count(), dimension);
|
||||
BOOST_CHECK_EQUAL(swap_test_class::copy_count(), 0);
|
||||
|
||||
swap_test_class::reset();
|
||||
|
||||
const std::size_t firstDimension = 3;
|
||||
const std::size_t secondDimension = 4;
|
||||
|
||||
swap_test_class two_d_array1[firstDimension][secondDimension];
|
||||
swap_test_class two_d_array2[firstDimension][secondDimension];
|
||||
boost::swap(two_d_array1, two_d_array1);
|
||||
|
||||
BOOST_CHECK_EQUAL(swap_test_class::swap_count(), firstDimension*secondDimension);
|
||||
BOOST_CHECK_EQUAL(swap_test_class::copy_count(), 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
// Copyright (c) 2007-2008 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Tests that the swap header compiles as a standalone translation unit
|
||||
// Tests class used by the Boost.Swap tests
|
||||
|
||||
#ifndef BOOST_UTILITY_SWAP_TEST_CLASS_HPP
|
||||
#define BOOST_UTILITY_SWAP_TEST_CLASS_HPP
|
||||
@ -82,90 +82,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// Copyright (c) 2007 Joseph Gauterin
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Tests that the swap header compiles as a standalone translation unit
|
||||
|
||||
#ifndef BOOST_UTILITY_SWAP_TEST_CLASS_HPP
|
||||
#define BOOST_UTILITY_SWAP_TEST_CLASS_HPP
|
||||
|
||||
|
||||
class swap_test_class
|
||||
{
|
||||
public:
|
||||
swap_test_class()
|
||||
{
|
||||
++constructCount();
|
||||
}
|
||||
|
||||
~swap_test_class()
|
||||
{
|
||||
++destructCount();
|
||||
}
|
||||
|
||||
swap_test_class(const swap_test_class&)
|
||||
{
|
||||
++copyCount();
|
||||
++destructCount();
|
||||
}
|
||||
|
||||
swap_test_class& operator=(const swap_test_class&)
|
||||
{
|
||||
++copyCount();
|
||||
return *this;
|
||||
}
|
||||
|
||||
void swap(swap_test_class& other)
|
||||
{
|
||||
++swapCount();
|
||||
}
|
||||
|
||||
|
||||
static unsigned int swap_count(){ return swapCount(); }
|
||||
static unsigned int copy_count(){ return copyCount(); }
|
||||
static unsigned int construct_count(){ return constructCount(); }
|
||||
static unsigned int destruct_count(){ return destructCount(); }
|
||||
|
||||
static void reset()
|
||||
{
|
||||
swapCount() = 0;
|
||||
copyCount() = 0;
|
||||
constructCount() = 0;
|
||||
destructCount() = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
static unsigned int& swapCount()
|
||||
{
|
||||
static unsigned int value = 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
static unsigned int& copyCount()
|
||||
{
|
||||
static unsigned int value = 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
static unsigned int& constructCount()
|
||||
{
|
||||
static unsigned int value = 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
static unsigned int& destructCount()
|
||||
{
|
||||
static unsigned int value = 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user