[pygccxml-commit] SF.net SVN: pygccxml: [920] pygccxml_dev
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2007-02-22 19:04:07
|
Revision: 920
http://svn.sourceforge.net/pygccxml/?rev=920&view=rev
Author: roman_yakovenko
Date: 2007-02-22 11:04:04 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
adding new unittest - is_noncopyable
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/type_traits.py
pygccxml_dev/unittests/data/type_traits.hpp
pygccxml_dev/unittests/type_traits_tester.py
Modified: pygccxml_dev/pygccxml/declarations/type_traits.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/type_traits.py 2007-02-22 12:19:27 UTC (rev 919)
+++ pygccxml_dev/pygccxml/declarations/type_traits.py 2007-02-22 19:04:04 UTC (rev 920)
@@ -823,6 +823,8 @@
def is_noncopyable( class_ ):
"""returns True, if class is noncopyable, False otherwise"""
+ class_ = class_traits.get_declaration( class_ )
+
if class_.class_type == class_declaration.CLASS_TYPES.UNION:
return False
for base_desc in class_.recursive_bases:
Modified: pygccxml_dev/unittests/data/type_traits.hpp
===================================================================
--- pygccxml_dev/unittests/data/type_traits.hpp 2007-02-22 12:19:27 UTC (rev 919)
+++ pygccxml_dev/unittests/data/type_traits.hpp 2007-02-22 19:04:04 UTC (rev 920)
@@ -6,6 +6,8 @@
//Almost all test cases have been taken
//from boost.type_traits (http://www.boost.org) library.
+#include <string>
+
#define TYPE_PERMUTATION( BASE, NAME ) \
typedef BASE NAME##_t; \
typedef BASE const NAME##_const_t; \
@@ -33,6 +35,24 @@
typedef void (some_struct_t::*member_function_t)();
} }
+namespace is_noncopyable{
+
+namespace detail{
+ struct x{
+ private:
+ x( const x& );
+ x& operator=(const x& );
+ };
+}
+
+namespace yes{
+ typedef detail::x x;
+}
+namespace no{
+ typedef std::string string_type;
+}
+}
+
namespace is_integral{
namespace yes{
Modified: pygccxml_dev/unittests/type_traits_tester.py
===================================================================
--- pygccxml_dev/unittests/type_traits_tester.py 2007-02-22 12:19:27 UTC (rev 919)
+++ pygccxml_dev/unittests/type_traits_tester.py 2007-02-22 19:04:04 UTC (rev 920)
@@ -101,7 +101,10 @@
def test_is_fundamental(self):
self.__test_type_category( 'is_fundamental', declarations.is_fundamental )
-
+
+ def test_is_noncopyable(self):
+ self.__test_type_category( 'is_noncopyable', declarations.is_noncopyable )
+
def test_has_trivial_constructor(self):
self.__test_type_category( 'has_trivial_constructor', declarations.has_trivial_constructor )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|