2 // Copyright 2007-2009 Daniel James.
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include "../helpers/prefix.hpp"
7 #include <boost/unordered_map.hpp>
8 #include "../helpers/postfix.hpp"
10 #include "../helpers/test.hpp"
15 UNORDERED_AUTO_TEST(at_tests
) {
16 BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< "Create Map" << std::endl
;
18 boost::unordered_map
<std::string
, int> x
;
20 BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< "Add elements" << std::endl
;
25 BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< "Check existing elements" << std::endl
;
27 BOOST_TEST(x
.at("one") == 1);
28 BOOST_TEST(x
.at("two") == 2);
30 BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< "Check missing element" << std::endl
;
34 BOOST_ERROR("Should have thrown.");
36 catch(std::out_of_range
) {
39 BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< "Finished" << std::endl
;