Update of /cvsroot/luabind/luabind/luabind/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28775
Modified Files:
Tag: beta7-devel2
Jamfile test_object.cpp
Added Files:
Tag: beta7-devel2
test_value_wrapper.cpp
Log Message:
Added value_wrapper tests
--- NEW FILE: test_value_wrapper.cpp ---
// Copyright (c) 2005 Daniel Wallin and Arvid Norberg
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
// OR OTHER DEALINGS IN THE SOFTWARE.
#include <luabind/value_wrapper.hpp>
#include <boost/mpl/assert.hpp>
struct X_tag;
struct X
{
typedef X_tag value_wrapper_tag;
};
namespace luabind
{
template<>
struct value_wrapper_traits<X_tag>
{
typedef boost::mpl::true_ is_specialized;
};
} // namespace luabind
BOOST_MPL_ASSERT(( luabind::is_value_wrapper<X> ));
BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X> ));
BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X const> ));
BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X&> ));
BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X const&> ));
BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper_arg<int> ));
BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper_arg<int[4]> ));
BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper<X&> ));
BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper<X const&> ));
int main()
{
}
Index: test_object.cpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/test/test_object.cpp,v
retrieving revision 1.27.2.5
retrieving revision 1.27.2.6
diff -u -d -r1.27.2.5 -r1.27.2.6
--- test_object.cpp 4 Sep 2005 20:57:04 -0000 1.27.2.5
+++ test_object.cpp 30 Sep 2005 09:19:29 -0000 1.27.2.6
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
// OR OTHER DEALINGS IN THE SOFTWARE.
+
#include "test.hpp"
#include <luabind/luabind.hpp>
#include <luabind/adopt_policy.hpp>
@@ -240,4 +241,3 @@
TEST_CHECK(inner_sum == 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8);
TEST_CHECK(object_cast<int>(globals(L)["t"][2][2]) == 4);
}
-
Index: Jamfile
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/test/Jamfile,v
retrieving revision 1.15.2.2
retrieving revision 1.15.2.3
diff -u -d -r1.15.2.2 -r1.15.2.3
--- Jamfile 27 Jul 2005 21:25:40 -0000 1.15.2.2
+++ Jamfile 30 Sep 2005 09:19:29 -0000 1.15.2.3
@@ -21,6 +21,7 @@
test_separation.cpp
test_simple_class.cpp
test_yield.cpp
+ test_value_wrapper.cpp
;
project : default-build <link>static ;
|