Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69492 - in sandbox/enums/libs/enums/test: . enum_set/cons
From: vicente.botet_at_[hidden]
Date: 2011-03-02 17:31:47


Author: viboes
Date: 2011-03-02 17:31:46 EST (Wed, 02 Mar 2011)
New Revision: 69492
URL: http://svn.boost.org/trac/boost/changeset/69492

Log:
Enums: Added constructor from ull test
Added:
   sandbox/enums/libs/enums/test/enum_set/cons/ull_ctor.pass.cpp (contents, props changed)
Text files modified:
   sandbox/enums/libs/enums/test/Jamfile.v2 | 1 +
   1 files changed, 1 insertions(+), 0 deletions(-)

Modified: sandbox/enums/libs/enums/test/Jamfile.v2
==============================================================================
--- sandbox/enums/libs/enums/test/Jamfile.v2 (original)
+++ sandbox/enums/libs/enums/test/Jamfile.v2 2011-03-02 17:31:46 EST (Wed, 02 Mar 2011)
@@ -74,5 +74,6 @@
         [ run enum_set/version.pass.cpp : : : : enum_set__version__pass ]
         #[ run enum_set/types.pass.cpp : : : : enum_set__types__pass ]
         [ run enum_set/cons/default.pass.cpp : : : : enum_set__cons_default__pass ]
+ [ run enum_set/cons/ull_ctor.pass.cpp : : : : enum_set__cons_ull_ctor__pass ]
   ;
   
\ No newline at end of file

Added: sandbox/enums/libs/enums/test/enum_set/cons/ull_ctor.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/enums/libs/enums/test/enum_set/cons/ull_ctor.pass.cpp 2011-03-02 17:31:46 EST (Wed, 02 Mar 2011)
@@ -0,0 +1,57 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011.
+// 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)
+//
+// See http://www.boost.org/libs/enums for documentation.
+//
+// Adapted from libcxx tests
+//
+//////////////////////////////////////////////////////////////////////////////
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test bitset(unsigned long long val);
+
+#include "./Ex.hpp"
+#include <boost/enums/enum_set.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using namespace boost::enums;
+
+template <typename EC>
+void test_val_ctor()
+{
+ {
+ enum_set<EC> v(0xAAAAAAAAAAAAAAAAULL);
+ BOOST_TEST(v.size() == meta::size<EC>::value);
+ unsigned M = std::min<std::size_t>(meta::size<EC>::value, 64);
+ for (std::size_t i = 0; i < M; ++i)
+ BOOST_TEST(v[val<EC>(i)] == ((i & 1)));
+ for (std::size_t i = M; i < meta::size<EC>::value; ++i)
+ BOOST_TEST(v[val<EC>(i)] == false);
+ }
+}
+
+int main()
+{
+ test_val_ctor<EC3>();
+ //~ test_val_ctor<1>();
+ //~ test_val_ctor<31>();
+ //~ test_val_ctor<32>();
+ //~ test_val_ctor<33>();
+ //~ test_val_ctor<63>();
+ //~ test_val_ctor<64>();
+ //~ test_val_ctor<65>();
+ //~ test_val_ctor<1000>();
+ return boost::report_errors();
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk