|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83665 - in trunk: boost/tti libs/tti/test
From: eldiener_at_[hidden]
Date: 2013-03-31 10:34:09
Author: eldiener
Date: 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
New Revision: 83665
URL: http://svn.boost.org/trac/boost/changeset/83665
Log:
Updated tests for functions with default parameters.
Added:
trunk/libs/tti/test/test_has_fun_fail5.cpp (contents, props changed)
trunk/libs/tti/test/test_has_mem_fun_cv_fail5.cpp (contents, props changed)
trunk/libs/tti/test/test_has_mem_fun_cv_fail6.cpp (contents, props changed)
trunk/libs/tti/test/test_has_mem_fun_fail3.cpp (contents, props changed)
trunk/libs/tti/test/test_has_member_cv_fail5.cpp (contents, props changed)
trunk/libs/tti/test/test_has_member_fail3.cpp (contents, props changed)
Removed:
trunk/libs/tti/test/test_has_static_member.hpp
Text files modified:
trunk/boost/tti/has_function.hpp | 8 ++++----
trunk/boost/tti/has_member_function.hpp | 2 +-
trunk/libs/tti/test/Jamfile.v2 | 6 ++++++
trunk/libs/tti/test/test_has_static_member.cpp | 2 +-
trunk/libs/tti/test/test_has_static_member_compile.cpp | 2 +-
trunk/libs/tti/test/test_has_static_member_fail.cpp | 2 +-
trunk/libs/tti/test/test_has_static_member_fail2.cpp | 2 +-
trunk/libs/tti/test/test_structs.hpp | 14 +++++++-------
8 files changed, 22 insertions(+), 16 deletions(-)
Modified: trunk/boost/tti/has_function.hpp
==============================================================================
--- trunk/boost/tti/has_function.hpp (original)
+++ trunk/boost/tti/has_function.hpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -45,10 +45,10 @@
TTI_R = the return type of the function
TTI_FS = (optional) the parameters of the function as a boost::mpl forward sequence
- if the second parameter is a return type and the function parameters exist.
+ if function parameters are not empty.
TTI_TAG = (optional) a boost::function_types tag to apply to the function
- if the second parameter is a return type and the need for a tag exists.
+ if the need for a tag exists.
returns = 'value' is true if the 'name' exists,
with the appropriate static member function type,
@@ -85,10 +85,10 @@
TTI_R = the return type of the function
TTI_FS = (optional) the parameters of the function as a boost::mpl forward sequence
- if the second parameter is a return type and the function parameters exist.
+ if function parameters are not empty.
TTI_TAG = (optional) a boost::function_types tag to apply to the function
- if the second parameter is a return type and the need for a tag exists.
+ if the need for a tag exists.
returns = 'value' is true if the 'name' exists,
with the appropriate function type,
Modified: trunk/boost/tti/has_member_function.hpp
==============================================================================
--- trunk/boost/tti/has_member_function.hpp (original)
+++ trunk/boost/tti/has_member_function.hpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -44,7 +44,7 @@
TTI_T = the enclosing type in which to look for our 'name'
OR
- a pointer to member function as a single type.
+ a pointer to member function as a single type.
TTI_R = (optional) the return type of the member function
if the first parameter is the enclosing type.
Modified: trunk/libs/tti/test/Jamfile.v2
==============================================================================
--- trunk/libs/tti/test/Jamfile.v2 (original)
+++ trunk/libs/tti/test/Jamfile.v2 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -33,6 +33,7 @@
[ compile test_has_member_compile.cpp ]
[ compile-fail test_has_member_fail.cpp ]
[ compile-fail test_has_member_fail2.cpp ]
+ [ compile-fail test_has_member_fail3.cpp ]
;
#
@@ -46,6 +47,7 @@
[ compile-fail test_has_member_cv_fail2.cpp ]
[ compile-fail test_has_member_cv_fail3.cpp ]
[ compile-fail test_has_member_cv_fail4.cpp ]
+ [ compile-fail test_has_member_cv_fail5.cpp ]
;
#
@@ -70,6 +72,7 @@
[ compile test_has_mem_fun_compile.cpp ]
[ compile-fail test_has_mem_fun_fail.cpp ]
[ compile-fail test_has_mem_fun_fail2.cpp ]
+ [ compile-fail test_has_mem_fun_fail3.cpp ]
;
#
@@ -83,6 +86,8 @@
[ compile-fail test_has_mem_fun_cv_fail2.cpp ]
[ compile-fail test_has_mem_fun_cv_fail3.cpp ]
[ compile-fail test_has_mem_fun_cv_fail4.cpp ]
+ [ compile-fail test_has_mem_fun_cv_fail5.cpp ]
+ [ compile-fail test_has_mem_fun_cv_fail6.cpp ]
;
#
@@ -145,6 +150,7 @@
[ compile-fail test_has_fun_fail2.cpp ]
[ compile-fail test_has_fun_fail3.cpp ]
[ compile-fail test_has_fun_fail4.cpp ]
+ [ compile-fail test_has_fun_fail5.cpp ]
;
#
Added: trunk/libs/tti/test/test_has_fun_fail5.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/tti/test/test_has_fun_fail5.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -0,0 +1,19 @@
+
+// (C) Copyright Edward Diener 2012,2013
+// Use, modification and distribution are subject to 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 "test_has_fun.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // With default parameters you must still specify complete function prototype
+
+ BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(aFunction)<AnotherType,AType>));
+
+ return 0;
+
+ }
Added: trunk/libs/tti/test/test_has_mem_fun_cv_fail5.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/tti/test/test_has_mem_fun_cv_fail5.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -0,0 +1,19 @@
+
+// (C) Copyright Edward Diener 2013
+// Use, modification and distribution are subject to 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 "test_has_mem_fun.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // With default parameters you must still specify complete member function prototype
+
+ BOOST_MPL_ASSERT((AskIfConst<const AType,void,boost::mpl::vector<float> >));
+
+ return 0;
+
+ }
Added: trunk/libs/tti/test/test_has_mem_fun_cv_fail6.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/tti/test/test_has_mem_fun_cv_fail6.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -0,0 +1,19 @@
+
+// (C) Copyright Edward Diener 2013
+// Use, modification and distribution are subject to 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 "test_has_mem_fun.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // With default parameters you must still specify complete member function prototype
+
+ BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillCV)<const volatile AnotherType,short>));
+
+ return 0;
+
+ }
Added: trunk/libs/tti/test/test_has_mem_fun_fail3.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/tti/test/test_has_mem_fun_fail3.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -0,0 +1,19 @@
+
+// (C) Copyright Edward Diener 2011,2012,2013
+// Use, modification and distribution are subject to 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 "test_has_mem_fun.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // With default parameters you must still specify complete member function prototype
+
+ BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction)<AnotherType,AType::AnIntType,boost::mpl::vector<int> >));
+
+ return 0;
+
+ }
Added: trunk/libs/tti/test/test_has_member_cv_fail5.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/tti/test/test_has_member_cv_fail5.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -0,0 +1,19 @@
+
+// (C) Copyright Edward Diener 2013
+// Use, modification and distribution are subject to 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 "test_has_mem_fun.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // With default parameters you must still specify complete member function prototype
+
+ BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AVolatileFunction)<double (AType::*)(long) volatile>));
+
+ return 0;
+
+ }
Added: trunk/libs/tti/test/test_has_member_fail3.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/tti/test/test_has_member_fail3.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -0,0 +1,19 @@
+
+// (C) Copyright Edward Diener 2011,2012,2013
+// Use, modification and distribution are subject to 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 "test_has_mem_fun.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // With default parameters you must still specify complete member function prototype
+
+ BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction)<AType::AnIntType (AnotherType::*)(int,long)>));
+
+ return 0;
+
+ }
Modified: trunk/libs/tti/test/test_has_static_member.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_static_member.cpp (original)
+++ trunk/libs/tti/test/test_has_static_member.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -4,7 +4,7 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
-#include "test_has_static_member.hpp"
+#include "test_has_static_mem_fun.hpp"
#include <boost/detail/lightweight_test.hpp>
int main()
Deleted: trunk/libs/tti/test/test_has_static_member.hpp
==============================================================================
--- trunk/libs/tti/test/test_has_static_member.hpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
+++ (empty file)
@@ -1,18 +0,0 @@
-
-// (C) Copyright Edward Diener 2011
-// Use, modification and distribution are subject to 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).
-
-#if !defined(TEST_HAS_STATIC_MEMBER_HPP)
-#define TEST_HAS_STATIC_MEMBER_HPP
-
-#include "test_structs.hpp"
-#include <boost/tti/has_static_member_function.hpp>
-
-BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(HaveTheSIntFunction,SIntFunction)
-BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(TheTIntFunction,TIntFunction)
-BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(TSFunction)
-BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(Pickedname,SomeStaticFunction)
-
-#endif // TEST_HAS_STATIC_MEMBER_HPP
Modified: trunk/libs/tti/test/test_has_static_member_compile.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_static_member_compile.cpp (original)
+++ trunk/libs/tti/test/test_has_static_member_compile.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -4,7 +4,7 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
-#include "test_has_static_member.hpp"
+#include "test_has_static_mem_fun.hpp"
#include <boost/mpl/assert.hpp>
int main()
Modified: trunk/libs/tti/test/test_has_static_member_fail.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_static_member_fail.cpp (original)
+++ trunk/libs/tti/test/test_has_static_member_fail.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -4,7 +4,7 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
-#include "test_has_static_member.hpp"
+#include "test_has_static_mem_fun.hpp"
#include <boost/mpl/assert.hpp>
int main()
Modified: trunk/libs/tti/test/test_has_static_member_fail2.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_static_member_fail2.cpp (original)
+++ trunk/libs/tti/test/test_has_static_member_fail2.cpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -4,7 +4,7 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
-#include "test_has_static_member.hpp"
+#include "test_has_static_mem_fun.hpp"
int main()
{
Modified: trunk/libs/tti/test/test_structs.hpp
==============================================================================
--- trunk/libs/tti/test/test_structs.hpp (original)
+++ trunk/libs/tti/test/test_structs.hpp 2013-03-31 10:34:07 EDT (Sun, 31 Mar 2013)
@@ -51,11 +51,11 @@
// Const function
double AConstFunction(long, char) const { return 2.57; }
- void WFunction(float, double) const { }
+ void WFunction(float, double = 4.3) const { }
// Volatile function
- double AVolatileFunction(long, char) volatile { return 2.58; }
+ double AVolatileFunction(long, char = 'c') volatile { return 2.58; }
void VolFunction(float, double) volatile { }
// Const Volatile function
@@ -105,10 +105,10 @@
// Function
- AType aFunction(int) { return AType(); }
+ AType aFunction(int = 7) { return AType(); }
int anotherFunction(AType) { return 0; }
- AType::AnIntType sFunction(int,long,double) { return 0; }
- double IntFunction(int) { return 0; }
+ AType::AnIntType sFunction(int,long = 88,double = 1.0) { return 0; }
+ double IntFunction(int = 9922) { return 0; }
// Const function
@@ -123,7 +123,7 @@
// Const Volatile function
int AnotherConstVolatileFunction(AType *, short) const volatile { return 0; }
- short StillCV(int) const volatile { return 32; }
+ short StillCV(int = 3) const volatile { return 32; }
// Function Templates
@@ -131,7 +131,7 @@
// Static Function
- static AType TIntFunction(long,double) { return AType(); }
+ static AType TIntFunction(long,double = 3.0) { return AType(); }
static AType::AStructType TSFunction(AType::AnIntType,double) { return AType::AStructType(); }
// Static Data
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