forked from boostorg/unordered
		
	https://svn.boost.org/svn/boost/branches/unordered/trunk ........ r43840 | danieljames | 2008-03-24 17:25:07 +0000 (Mon, 24 Mar 2008) | 1 line Fix a g++ warning. ........ r43844 | danieljames | 2008-03-24 17:56:28 +0000 (Mon, 24 Mar 2008) | 1 line It's a new-ish year. ........ r43885 | danieljames | 2008-03-27 20:36:10 +0000 (Thu, 27 Mar 2008) | 1 line The release script doesn't need to copy images and css - because that's now done in the jamfiles. Also tweak the shell script a tad bit. ........ r43890 | danieljames | 2008-03-27 23:01:40 +0000 (Thu, 27 Mar 2008) | 1 line Starting to add a docbook bibliography. ........ r43894 | danieljames | 2008-03-27 23:24:18 +0000 (Thu, 27 Mar 2008) | 1 line Redeclare 'data' in iterator_base to help compilers which have trouble with accessing the nested typedef. ........ [SVN r43895]
		
			
				
	
	
		
			99 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			99 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
 | 
						|
// Copyright 2006-2008 Daniel James.
 | 
						|
// 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)
 | 
						|
 | 
						|
// This test creates the containers with members that meet their minimum
 | 
						|
// requirements. Makes sure everything compiles and is defined correctly.
 | 
						|
 | 
						|
#include <boost/unordered_set.hpp>
 | 
						|
 | 
						|
#include <iostream>
 | 
						|
#include "../helpers/test.hpp"
 | 
						|
#include "../objects/minimal.hpp"
 | 
						|
#include "./compile_tests.hpp"
 | 
						|
 | 
						|
UNORDERED_AUTO_TEST(test0)
 | 
						|
{
 | 
						|
    test::minimal::assignable assignable = test::minimal::assignable::create();
 | 
						|
 | 
						|
    std::cout<<"Test unordered_set.\n";
 | 
						|
    boost::unordered_set<
 | 
						|
        test::minimal::assignable,
 | 
						|
        test::minimal::hash<test::minimal::assignable>,
 | 
						|
        test::minimal::equal_to<test::minimal::assignable>,
 | 
						|
        test::minimal::allocator<test::minimal::assignable> > set;
 | 
						|
 | 
						|
    container_test(set, assignable);
 | 
						|
 | 
						|
    std::cout<<"Test unordered_multiset.\n";
 | 
						|
    boost::unordered_multiset<
 | 
						|
        test::minimal::assignable,
 | 
						|
        test::minimal::hash<test::minimal::assignable>,
 | 
						|
        test::minimal::equal_to<test::minimal::assignable>,
 | 
						|
        test::minimal::allocator<test::minimal::assignable> > multiset;
 | 
						|
 | 
						|
    container_test(multiset, assignable);
 | 
						|
}
 | 
						|
 | 
						|
UNORDERED_AUTO_TEST(test1)
 | 
						|
{
 | 
						|
    boost::hash<int> hash;
 | 
						|
    std::equal_to<int> equal_to;
 | 
						|
    int value = 0;
 | 
						|
 | 
						|
    std::cout<<"Test unordered_set.\n";
 | 
						|
 | 
						|
    boost::unordered_set<int> set;
 | 
						|
    
 | 
						|
    unordered_unique_test(set, value);
 | 
						|
    unordered_set_test(set, value);
 | 
						|
    unordered_test(set, value, value, hash, equal_to);
 | 
						|
 | 
						|
    std::cout<<"Test unordered_multiset.\n";
 | 
						|
 | 
						|
    boost::unordered_multiset<int> multiset;
 | 
						|
    
 | 
						|
    unordered_equivalent_test(multiset, value);
 | 
						|
    unordered_set_test(multiset, value);
 | 
						|
    unordered_test(multiset, value, value, hash, equal_to);
 | 
						|
}
 | 
						|
 | 
						|
UNORDERED_AUTO_TEST(test2)
 | 
						|
{
 | 
						|
    test::minimal::assignable assignable
 | 
						|
        = test::minimal::assignable::create();
 | 
						|
    test::minimal::copy_constructible copy_constructible
 | 
						|
        = test::minimal::copy_constructible::create();
 | 
						|
    test::minimal::hash<test::minimal::assignable> hash
 | 
						|
        = test::minimal::hash<test::minimal::assignable>::create();
 | 
						|
    test::minimal::equal_to<test::minimal::assignable> equal_to
 | 
						|
        = test::minimal::equal_to<test::minimal::assignable>::create();
 | 
						|
 | 
						|
    std::cout<<"Test unordered_set.\n";
 | 
						|
 | 
						|
    boost::unordered_set<
 | 
						|
        test::minimal::assignable,
 | 
						|
        test::minimal::hash<test::minimal::assignable>,
 | 
						|
        test::minimal::equal_to<test::minimal::assignable>,
 | 
						|
        test::minimal::allocator<test::minimal::assignable> > set;
 | 
						|
 | 
						|
    unordered_unique_test(set, assignable);
 | 
						|
    unordered_set_test(set, assignable);
 | 
						|
    unordered_test(set, assignable, assignable, hash, equal_to);
 | 
						|
 | 
						|
    std::cout<<"Test unordered_multiset.\n";
 | 
						|
 | 
						|
    boost::unordered_multiset<
 | 
						|
        test::minimal::assignable,
 | 
						|
        test::minimal::hash<test::minimal::assignable>,
 | 
						|
        test::minimal::equal_to<test::minimal::assignable>,
 | 
						|
        test::minimal::allocator<test::minimal::assignable> > multiset;
 | 
						|
 | 
						|
    unordered_equivalent_test(multiset, assignable);
 | 
						|
    unordered_set_test(multiset, assignable);
 | 
						|
    unordered_test(multiset, assignable, assignable, hash, equal_to);
 | 
						|
}
 | 
						|
 | 
						|
RUN_TESTS()
 |